-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
多个框架都会触发打包,打包会写文件,多个框架并行写文件提示文件占用。通过判断多个开发框架不进行打包,只有一个打包应用在多框架写文件 #57
- Loading branch information
Showing
5 changed files
with
136 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Version>0.1.19002-alpha</Version> | ||
<Version>0.1.19003-alpha</Version> | ||
</PropertyGroup> | ||
</Project> |
114 changes: 114 additions & 0 deletions
114
src/dotnetCampus.SourceYard/Assets/Current/SourceYard.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<Project> | ||
|
||
<!-- 打包核心 --> | ||
|
||
<!-- 避免依赖传递。 --> | ||
<Target Name="_SourceYardPrivateAssets" | ||
BeforeTargets="CollectPackageReferences"> | ||
<ItemGroup> | ||
<PackageReference Update="dotnetCampus.SourceYard" PrivateAssets="all" /> | ||
</ItemGroup> | ||
<Message Text="避免 SourceYard 依赖传递导致目标项目也打出源代码包" /> | ||
</Target> | ||
|
||
<Target Name="SourceYard" > | ||
<PropertyGroup> | ||
<SourcePackingDirectory>$(IntermediateOutputPath)SourcePacking\</SourcePackingDirectory> | ||
|
||
<CompileTextFile>$(SourcePackingDirectory)CompileFile.txt</CompileTextFile> | ||
<ResourceTextFile>$(SourcePackingDirectory)ResourceFile.txt</ResourceTextFile> | ||
<ContentTextFile>$(SourcePackingDirectory)ContentFile.txt</ContentTextFile> | ||
<NoneTextFile>$(SourcePackingDirectory)NoneFile.txt</NoneTextFile> | ||
<EmbeddedResourceTextFile>$(SourcePackingDirectory)EmbeddedResourceFile.txt</EmbeddedResourceTextFile> | ||
<PageTextFile>$(SourcePackingDirectory)PageFile.txt</PageTextFile> | ||
<ApplicationDefinitionTextFile>$(SourcePackingDirectory)ApplicationDefinitionFile.txt</ApplicationDefinitionTextFile> | ||
|
||
<DescriptionFile>$(SourcePackingDirectory)DescriptionFile.txt</DescriptionFile> | ||
<CopyrightFile>$(SourcePackingDirectory)CopyrightFile.txt</CopyrightFile> | ||
<PackageReleaseNotesFile>$(SourcePackingDirectory)PackageReleaseNotesFile.txt</PackageReleaseNotesFile> | ||
|
||
<PackageReferenceVersionFile>$(SourcePackingDirectory)PackageReferenceVersionFile.txt</PackageReferenceVersionFile> | ||
<SourceProjectPackageFile>$(SourcePackingDirectory)SourceProjectPackageFile.txt</SourceProjectPackageFile> | ||
</PropertyGroup> | ||
|
||
<MakeDir Condition="!Exists($(SourcePackingDirectory))" Directories="$(SourcePackingDirectory)"></MakeDir> | ||
|
||
<WriteLinesToFile File="$(CompileTextFile)" Lines="@(Compile)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(ResourceTextFile)" Lines="@(Resource)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(ContentTextFile)" Lines="@(Content)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(NoneTextFile)" Lines="@(None)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(EmbeddedResourceTextFile)" Lines="@(EmbeddedResource)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(PageTextFile)" Lines="@(Page)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(ApplicationDefinitionTextFile)" Lines="@(ApplicationDefinition)" Overwrite="true" /> | ||
|
||
<WriteLinesToFile File="$(DescriptionFile)" Lines="$(Description)" Overwrite="true"></WriteLinesToFile> | ||
<WriteLinesToFile File="$(CopyrightFile)" Lines="$(Copyright)" Overwrite="true"></WriteLinesToFile> | ||
<WriteLinesToFile File="$(PackageReleaseNotesFile)" Lines="$(PackageReleaseNotes)" Overwrite="true"></WriteLinesToFile> | ||
|
||
<!-- 写入通用的信息 --> | ||
<!-- 多段写入之前需要先删除文件 --> | ||
<Delete Files="$(SourceProjectPackageFile)" Condition="Exists($(SourceProjectPackageFile))"></Delete> | ||
<!-- 先写入RepositoryType的值,解析时将会根据此值顺序解析 --> | ||
<WriteLinesToFile File="$(SourceProjectPackageFile)" Lines=">;RepositoryType;$(RepositoryType);"></WriteLinesToFile> | ||
<WriteLinesToFile File="$(SourceProjectPackageFile)" Lines=">;PackageProjectUrl;$(PackageProjectUrl);"></WriteLinesToFile> | ||
<WriteLinesToFile File="$(SourceProjectPackageFile)" Lines=">;RepositoryUrl;$(RepositoryUrl);"></WriteLinesToFile> | ||
|
||
<ItemGroup> | ||
<_PackageReferenceVersion | ||
Include="Name='%(PackageReference.Identity)' Version='%(PackageReference.Version)' PrivateAssets='%(PackageReference.PrivateAssets)'"> | ||
</_PackageReferenceVersion> | ||
</ItemGroup> | ||
<WriteLinesToFile File="$(PackageReferenceVersionFile)" Lines="@(_PackageReferenceVersion)" Overwrite="true" /> | ||
|
||
<PropertyGroup> | ||
|
||
<SourceYardAuthors Condition="$(Authors) != ''">--Authors "$(Authors)"</SourceYardAuthors> | ||
|
||
<!-- 这部分长度太长会让命令行无法输入 | ||
<SourceYardRepositoryUrl Condition="$(RepositoryUrl) != ''">RepositoryUrl "$(RepositoryUrl)"</SourceYardRepositoryUrl> | ||
<SourceYardRepositoryType Condition="$(RepositoryType) != ''">RepositoryType "$(RepositoryType)"</SourceYardRepositoryType> | ||
<SourceYardPackageProjectUrl Condition="$(PackageProjectUrl) != ''">PackageProjectUrl "$(PackageProjectUrl)"</SourceYardPackageProjectUrl>--> | ||
<SourceYardPackageLicenseUrl Condition="$(PackageLicenseUrl) != ''">--PackageLicenseUrl "$(PackageLicenseUrl) "</SourceYardPackageLicenseUrl> | ||
|
||
<SourceYardCopyright Condition="$(Copyright) != ''">--CopyrightFile "$(CopyrightFile)"</SourceYardCopyright> | ||
|
||
<SourceYardPackageVersion Condition="$(PackageVersion) != ''">-v $(PackageVersion)</SourceYardPackageVersion> | ||
|
||
<SourceYardDescription Condition="$(Description) != ''">--DescriptionFile "$(DescriptionFile) "</SourceYardDescription> | ||
|
||
<SourceYardTitle Condition="$(Title) != ''">--Title "$(Title)"</SourceYardTitle> | ||
<SourceYardOwner Condition="$(Owner) != ''">--Owner "$(Owner)"</SourceYardOwner> | ||
<SourceYardPackageTags Condition="$(PackageTags) != ''">--PackageTags "$(PackageTags) "</SourceYardPackageTags> | ||
<SourceYardPackageReleaseNotes Condition="$(PackageReleaseNotes) != ''"> --PackageReleaseNotesFile $(PackageReleaseNotesFile)</SourceYardPackageReleaseNotes> | ||
<SourceYardPackageId Condition="'$(PackageId)' != ''">--PackageId "$(PackageId) "</SourceYardPackageId> | ||
|
||
<SourceMSBuildProjectFullPath>-p "$(MSBuildProjectFullPath) "</SourceMSBuildProjectFullPath> | ||
<SourceIntermediateDirectory>-i "$(SourcePackingDirectory)Package "</SourceIntermediateDirectory> | ||
<SourcePackageOutputPath Condition="'$(PackageOutputPath)' != ''">-n "$(PackageOutputPath) "</SourcePackageOutputPath> | ||
<SourcePackageOutputPath Condition="'$(PackageOutputPath)' == '' and $(OutputPath) != ''">-n "$(OutputPath) "</SourcePackageOutputPath> | ||
<SourcePackageReferenceVersion>--PackageReferenceVersion "$(PackageReferenceVersionFile)"</SourcePackageReferenceVersion> | ||
|
||
</PropertyGroup> | ||
|
||
|
||
<Exec | ||
Command="$(MSBuildThisFileDirectory)..\tools\net45\dotnetCampus.SourceYard.exe $(SourceMSBuildProjectFullPath) $(SourceIntermediateDirectory) $(SourcePackageOutputPath) $(SourceYardPackageVersion) --Compile $(CompileTextFile) --Resource $(ResourceTextFile) --Content $(ContentTextFile) --Page $(PageTextFile) --ApplicationDefinition $(ApplicationDefinitionTextFile) --None $(NoneTextFile) --EmbeddedResource $(EmbeddedResourceTextFile) $(SourceYardAuthors) $(SourceYardRepositoryUrl) $(SourceYardRepositoryType) $(SourceYardPackageProjectUrl) $(SourceYardCopyright) $(SourceYardDescription) $(SourceYardTitle) $(SourceYardPackageLicenseUrl) $(SourceYardPackageReleaseNotes) $(SourceYardPackageTags) $(SourceYardOwner) $(SourceYardPackageId) $(SourcePackageReferenceVersion) --SourcePackingDirectory $(SourcePackingDirectory)"> | ||
</Exec> | ||
</Target> | ||
|
||
<PropertyGroup> | ||
<CleanDependsOn>$(CleanDependsOn);_SourceYardClean</CleanDependsOn> | ||
</PropertyGroup> | ||
|
||
<Target Name="_SourceYardClean"> | ||
<PropertyGroup> | ||
<_SourcePackingDirectory>$(IntermediateOutputPath)SourcePacking\</_SourcePackingDirectory> | ||
</PropertyGroup> | ||
<RemoveDir Directories="$(_SourcePackingDirectory)" /> | ||
</Target> | ||
|
||
<Target Name="SourceYardFalsePackSource" AfterTargets="Build" | ||
Condition="$(PackSource) == 'False'"> | ||
<Message Text="因为用户设置 PackSource 为 false 所以没有打包源代码"></Message> | ||
</Target> | ||
</Project> |
10 changes: 10 additions & 0 deletions
10
...otnetCampus.SourceYard/Assets/Current/dotnetCampus.SourceYard.BuildMultiTargeting.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project> | ||
|
||
<Import Project="..\build\SourceYard.targets"/> | ||
|
||
<Target Name="BuildSourceNuGet" AfterTargets="Build" | ||
DependsOnTargets="SourceYard" | ||
Condition="$(PackSource) != 'False'"> | ||
|
||
</Target> | ||
</Project> |
112 changes: 5 additions & 107 deletions
112
src/dotnetCampus.SourceYard/Assets/Current/dotnetCampus.SourceYard.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,11 @@ | ||
<Project> | ||
|
||
<!-- 避免依赖传递。 --> | ||
<Target Name="_SourceYardPrivateAssets" | ||
BeforeTargets="CollectPackageReferences"> | ||
<ItemGroup> | ||
<PackageReference Update="dotnetCampus.SourceYard" PrivateAssets="all" /> | ||
</ItemGroup> | ||
<Message Text="避免 SourceYard 依赖传递导致目标项目也打出源代码包" /> | ||
</Target> | ||
|
||
<Target Name="SourceYard" AfterTargets="GenerateNuspec" | ||
Condition="$(PackSource) != 'False'"> | ||
<PropertyGroup> | ||
<SourcePackingDirectory>$(IntermediateOutputPath)SourcePacking\</SourcePackingDirectory> | ||
|
||
<CompileTextFile>$(SourcePackingDirectory)CompileFile.txt</CompileTextFile> | ||
<ResourceTextFile>$(SourcePackingDirectory)ResourceFile.txt</ResourceTextFile> | ||
<ContentTextFile>$(SourcePackingDirectory)ContentFile.txt</ContentTextFile> | ||
<NoneTextFile>$(SourcePackingDirectory)NoneFile.txt</NoneTextFile> | ||
<EmbeddedResourceTextFile>$(SourcePackingDirectory)EmbeddedResourceFile.txt</EmbeddedResourceTextFile> | ||
<PageTextFile>$(SourcePackingDirectory)PageFile.txt</PageTextFile> | ||
<ApplicationDefinitionTextFile>$(SourcePackingDirectory)ApplicationDefinitionFile.txt</ApplicationDefinitionTextFile> | ||
|
||
<DescriptionFile>$(SourcePackingDirectory)DescriptionFile.txt</DescriptionFile> | ||
<CopyrightFile>$(SourcePackingDirectory)CopyrightFile.txt</CopyrightFile> | ||
<PackageReleaseNotesFile>$(SourcePackingDirectory)PackageReleaseNotesFile.txt</PackageReleaseNotesFile> | ||
|
||
<PackageReferenceVersionFile>$(SourcePackingDirectory)PackageReferenceVersionFile.txt</PackageReferenceVersionFile> | ||
<SourceProjectPackageFile>$(SourcePackingDirectory)SourceProjectPackageFile.txt</SourceProjectPackageFile> | ||
</PropertyGroup> | ||
|
||
<MakeDir Condition="!Exists($(SourcePackingDirectory))" Directories="$(SourcePackingDirectory)"></MakeDir> | ||
|
||
<WriteLinesToFile File="$(CompileTextFile)" Lines="@(Compile)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(ResourceTextFile)" Lines="@(Resource)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(ContentTextFile)" Lines="@(Content)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(NoneTextFile)" Lines="@(None)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(EmbeddedResourceTextFile)" Lines="@(EmbeddedResource)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(PageTextFile)" Lines="@(Page)" Overwrite="true" /> | ||
<WriteLinesToFile File="$(ApplicationDefinitionTextFile)" Lines="@(ApplicationDefinition)" Overwrite="true" /> | ||
|
||
<WriteLinesToFile File="$(DescriptionFile)" Lines="$(Description)" Overwrite="true"></WriteLinesToFile> | ||
<WriteLinesToFile File="$(CopyrightFile)" Lines="$(Copyright)" Overwrite="true"></WriteLinesToFile> | ||
<WriteLinesToFile File="$(PackageReleaseNotesFile)" Lines="$(PackageReleaseNotes)" Overwrite="true"></WriteLinesToFile> | ||
|
||
<!-- 写入通用的信息 --> | ||
<!-- 多段写入之前需要先删除文件 --> | ||
<Delete Files="$(SourceProjectPackageFile)" Condition="Exists($(SourceProjectPackageFile))"></Delete> | ||
<!-- 先写入RepositoryType的值,解析时将会根据此值顺序解析 --> | ||
<WriteLinesToFile File="$(SourceProjectPackageFile)" Lines=">;RepositoryType;$(RepositoryType);"></WriteLinesToFile> | ||
<WriteLinesToFile File="$(SourceProjectPackageFile)" Lines=">;PackageProjectUrl;$(PackageProjectUrl);"></WriteLinesToFile> | ||
<WriteLinesToFile File="$(SourceProjectPackageFile)" Lines=">;RepositoryUrl;$(RepositoryUrl);"></WriteLinesToFile> | ||
|
||
<ItemGroup> | ||
<_PackageReferenceVersion | ||
Include="Name='%(PackageReference.Identity)' Version='%(PackageReference.Version)' PrivateAssets='%(PackageReference.PrivateAssets)'"> | ||
</_PackageReferenceVersion> | ||
</ItemGroup> | ||
<WriteLinesToFile File="$(PackageReferenceVersionFile)" Lines="@(_PackageReferenceVersion)" Overwrite="true" /> | ||
|
||
<PropertyGroup> | ||
|
||
<SourceYardAuthors Condition="$(Authors) != ''">--Authors "$(Authors)"</SourceYardAuthors> | ||
|
||
<!-- 这部分长度太长会让命令行无法输入 | ||
<SourceYardRepositoryUrl Condition="$(RepositoryUrl) != ''">RepositoryUrl "$(RepositoryUrl)"</SourceYardRepositoryUrl> | ||
<SourceYardRepositoryType Condition="$(RepositoryType) != ''">RepositoryType "$(RepositoryType)"</SourceYardRepositoryType> | ||
<SourceYardPackageProjectUrl Condition="$(PackageProjectUrl) != ''">PackageProjectUrl "$(PackageProjectUrl)"</SourceYardPackageProjectUrl>--> | ||
<SourceYardPackageLicenseUrl Condition="$(PackageLicenseUrl) != ''">--PackageLicenseUrl "$(PackageLicenseUrl) "</SourceYardPackageLicenseUrl> | ||
<Import Project="SourceYard.targets"/> | ||
|
||
<SourceYardCopyright Condition="$(Copyright) != ''">--CopyrightFile "$(CopyrightFile)"</SourceYardCopyright> | ||
<Target Name="BuildSourceNuGet" AfterTargets="Build" | ||
DependsOnTargets="SourceYard" | ||
Condition="$(PackSource) != 'False' And '$(TargetFrameworks)' == ''"> | ||
|
||
<SourceYardPackageVersion Condition="$(PackageVersion) != ''">-v $(PackageVersion)</SourceYardPackageVersion> | ||
|
||
<SourceYardDescription Condition="$(Description) != ''">--DescriptionFile "$(DescriptionFile) "</SourceYardDescription> | ||
|
||
<SourceYardTitle Condition="$(Title) != ''">--Title "$(Title)"</SourceYardTitle> | ||
<SourceYardOwner Condition="$(Owner) != ''">--Owner "$(Owner)"</SourceYardOwner> | ||
<SourceYardPackageTags Condition="$(PackageTags) != ''">--PackageTags "$(PackageTags) "</SourceYardPackageTags> | ||
<SourceYardPackageReleaseNotes Condition="$(PackageReleaseNotes) != ''"> --PackageReleaseNotesFile $(PackageReleaseNotesFile)</SourceYardPackageReleaseNotes> | ||
<SourceYardPackageId Condition="'$(PackageId)' != ''">--PackageId "$(PackageId) "</SourceYardPackageId> | ||
|
||
<SourceMSBuildProjectFullPath>-p "$(MSBuildProjectFullPath) "</SourceMSBuildProjectFullPath> | ||
<SourceIntermediateDirectory>-i "$(SourcePackingDirectory)Package "</SourceIntermediateDirectory> | ||
<SourcePackageOutputPath Condition="'$(PackageOutputPath)' != ''">-n "$(PackageOutputPath) "</SourcePackageOutputPath> | ||
<SourcePackageOutputPath Condition="'$(PackageOutputPath)' == '' and $(OutputPath) != ''">-n "$(OutputPath) "</SourcePackageOutputPath> | ||
<SourcePackageReferenceVersion>--PackageReferenceVersion "$(PackageReferenceVersionFile)"</SourcePackageReferenceVersion> | ||
|
||
</PropertyGroup> | ||
|
||
|
||
<Exec | ||
Command="$(MSBuildThisFileDirectory)..\tools\net45\dotnetCampus.SourceYard.exe $(SourceMSBuildProjectFullPath) $(SourceIntermediateDirectory) $(SourcePackageOutputPath) $(SourceYardPackageVersion) --Compile $(CompileTextFile) --Resource $(ResourceTextFile) --Content $(ContentTextFile) --Page $(PageTextFile) --ApplicationDefinition $(ApplicationDefinitionTextFile) --None $(NoneTextFile) --EmbeddedResource $(EmbeddedResourceTextFile) $(SourceYardAuthors) $(SourceYardRepositoryUrl) $(SourceYardRepositoryType) $(SourceYardPackageProjectUrl) $(SourceYardCopyright) $(SourceYardDescription) $(SourceYardTitle) $(SourceYardPackageLicenseUrl) $(SourceYardPackageReleaseNotes) $(SourceYardPackageTags) $(SourceYardOwner) $(SourceYardPackageId) $(SourcePackageReferenceVersion) --SourcePackingDirectory $(SourcePackingDirectory)"> | ||
</Exec> | ||
</Target> | ||
|
||
<PropertyGroup> | ||
<CleanDependsOn>$(CleanDependsOn);_SourceYardClean</CleanDependsOn> | ||
</PropertyGroup> | ||
|
||
<Target Name="_SourceYardClean"> | ||
<PropertyGroup> | ||
<_SourcePackingDirectory>$(IntermediateOutputPath)SourcePacking\</_SourcePackingDirectory> | ||
</PropertyGroup> | ||
<RemoveDir Directories="$(_SourcePackingDirectory)" /> | ||
</Target> | ||
|
||
<Target Name="SourceYardFalsePackSource" AfterTargets="Build" | ||
Condition="$(PackSource) == 'False'"> | ||
<Message Text="因为用户设置 PackSource 为 false 所以没有打包源代码"></Message> | ||
</Target> | ||
</Project> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters