|
15 | 15 | EnableDefaultArtifacts Includes packages under "/artifacts/packages/**" for publishing. Defaults to true. |
16 | 16 | DotNetBuildPass While building the repo as part of the entire .NET stack, this parameter specifies which build pass the current build is part of. |
17 | 17 | The build pass number gets added to the asset manifest file name to avoid collisions. |
18 | | - |
| 18 | +
|
19 | 19 | Optional items: |
20 | 20 | Artifact (with Metadata) Path to the artifact to publish. Declare the item in Signing.props to sign and publish the artifact. |
21 | 21 | - ChecksumPath The destination path to generate a checksum file for the artifact. Set the `RelativeBlobPathParent` |
|
58 | 58 | <Import Project="StrongName.targets" /> |
59 | 59 | <Import Project="Sign.props" /> |
60 | 60 |
|
61 | | - <!-- Allow for repo specific Publish properties such as add additional files to be published --> |
62 | | - <Import Project="$(RepositoryEngineeringDir)Publishing.props" Condition="Exists('$(RepositoryEngineeringDir)Publishing.props')" /> |
63 | | - |
64 | 61 | <PropertyGroup> |
65 | 62 | <!-- Default publishing target is 3. --> |
66 | | - <PublishingVersion Condition="'$(PublishingVersion)' == ''">3</PublishingVersion> |
| 63 | + <PublishingVersion>3</PublishingVersion> |
67 | 64 |
|
68 | 65 | <!-- Globally set property. --> |
69 | 66 | <IsStableBuild>false</IsStableBuild> |
70 | 67 | <IsStableBuild Condition="'$(DotNetFinalVersionKind)' == 'release'">true</IsStableBuild> |
71 | 68 |
|
72 | 69 | <!-- If `IsReleaseOnlyPackageVersion` is set to true, package safety checks can be skipped--> |
73 | 70 | <IsReleaseOnlyPackageVersion>false</IsReleaseOnlyPackageVersion> |
74 | | - <IsReleaseOnlyPackageVersion Condition ="('$(SkipPackagePublishingVersionChecks)' == 'true') or ('$(PreReleaseVersionLabel)' == '' and '$(AutoGenerateAssemblyVersion)' == 'true')">true</IsReleaseOnlyPackageVersion> |
| 71 | + <IsReleaseOnlyPackageVersion Condition ="'$(SkipPackagePublishingVersionChecks)' == 'true' or ('$(PreReleaseVersionLabel)' == '' and '$(AutoGenerateAssemblyVersion)' == 'true')">true</IsReleaseOnlyPackageVersion> |
75 | 72 |
|
76 | | - <!-- If `AutoGenerateSymbolPackages` is not set we default it to true. --> |
77 | | - <!-- Do not generate symbol packages if in outer source build mode, to avoid creating copies of the intermediates. --> |
78 | | - <!-- Also do not generate symbol packages if in inner source build, in product build. --> |
| 73 | + <!-- If `AutoGenerateSymbolPackages` is not set we default it to true. |
| 74 | + Do not generate symbol packages if in outer source build mode, to avoid creating copies of the intermediates. |
| 75 | + Also do not generate symbol packages if in inner source build, in product build. --> |
79 | 76 | <AutoGenerateSymbolPackages Condition="'$(AutoGenerateSymbolPackages)' == '' and |
80 | 77 | ('$(DotNetBuildSourceOnly)' != 'true' or ('$(DotNetBuildInnerRepo)' == 'true' and '$(DotNetBuildOrchestrator)' != 'true'))">true</AutoGenerateSymbolPackages> |
81 | 78 |
|
82 | | - <SymbolPackagesDir>$(ArtifactsTmpDir)SymbolPackages\</SymbolPackagesDir> |
83 | | - |
| 79 | + <PublishDependsOnTargets>$(PublishDependsOnTargets);BeforePublish;AutoGenerateSymbolPackages</PublishDependsOnTargets> |
84 | 80 | <PublishDependsOnTargets Condition="$(PublishToSymbolServer)">$(PublishDependsOnTargets);PublishSymbols</PublishDependsOnTargets> |
85 | 81 | <PublishDependsOnTargets Condition="$(DotNetPublishUsingPipelines)">$(PublishDependsOnTargets);PublishToAzureDevOpsArtifacts</PublishDependsOnTargets> |
86 | | - |
87 | | - <PublishDependsOnTargets>BeforePublish;$(PublishDependsOnTargets)</PublishDependsOnTargets> |
88 | 82 | </PropertyGroup> |
89 | 83 |
|
90 | 84 | <PropertyGroup> |
|
99 | 93 | <AssetManifestFilePath>$(ArtifactsLogDir)AssetManifest\$(AssetManifestFileName)</AssetManifestFilePath> |
100 | 94 | </PropertyGroup> |
101 | 95 |
|
| 96 | + <ItemGroup Condition="'$(EnableDefaultArtifacts)' == 'true'"> |
| 97 | + <Artifact Include="$(ArtifactsShippingPackagesDir)**/*.nupkg" PublishFlatContainer="false" /> |
| 98 | + <Artifact Include="$(ArtifactsNonShippingPackagesDir)**/*.nupkg" IsShipping="false" PublishFlatContainer="false" /> |
| 99 | + </ItemGroup> |
| 100 | + |
| 101 | + <!-- Allow for repo specific Publish properties such as add additional files to be published --> |
| 102 | + <Import Project="$(RepositoryEngineeringDir)Publishing.props" Condition="Exists('$(RepositoryEngineeringDir)Publishing.props')" /> |
| 103 | + |
102 | 104 | <Import Project="$(NuGetPackageRoot)microsoft.dotnet.build.tasks.feed\$(MicrosoftDotNetBuildTasksFeedVersion)\build\Microsoft.DotNet.Build.Tasks.Feed.targets"/> |
103 | 105 | <Import Project="$(NuGetPackageRoot)microsoft.symboluploader.build.task\$(MicrosoftSymbolUploaderBuildTaskVersion)\build\PublishSymbols.targets" Condition="$(PublishToSymbolServer)"/> |
104 | 106 |
|
105 | | - <Target Name="Publish" |
106 | | - DependsOnTargets="$(PublishDependsOnTargets)" /> |
| 107 | + <Target Name="Publish" DependsOnTargets="$(PublishDependsOnTargets)" /> |
107 | 108 |
|
108 | 109 | <Target Name="BeforePublish"> |
109 | | - <ItemGroup Condition="'$(EnableDefaultArtifacts)' == 'true'"> |
110 | | - <ExistingSymbolPackages Include="$(ArtifactsShippingPackagesDir)**/*.symbols.nupkg" IsShipping="true" /> |
111 | | - <ExistingSymbolPackages Include="$(ArtifactsNonShippingPackagesDir)**/*.symbols.nupkg" IsShipping="false" /> |
112 | | - |
113 | | - <PackagesToPublish Include="$(ArtifactsShippingPackagesDir)**/*.nupkg" IsShipping="true" /> |
114 | | - <PackagesToPublish Include="$(ArtifactsNonShippingPackagesDir)**/*.nupkg" IsShipping="false" /> |
115 | | - </ItemGroup> |
116 | | - |
117 | | - <!-- Respect Artifact item repo extension point for packages --> |
118 | 110 | <ItemGroup Condition="'@(Artifact)' != ''"> |
119 | | - <ExistingSymbolPackages Include="@(Artifact)" Condition="'%(Artifact.SkipPublish)' != 'true' and $([System.String]::Copy('%(Filename)%(Extension)').EndsWith('.symbols.nupkg'))" /> |
120 | | - <PackagesToPublish Include="@(Artifact)" Condition="'%(Artifact.SkipPublish)' != 'true' and '%(Extension)' == '.nupkg'" /> |
| 111 | + <_ExistingSymbolPackage Include="@(Artifact)" Condition="'%(Artifact.SkipPublish)' != 'true' and $([System.String]::Copy('%(Filename)%(Extension)').EndsWith('.symbols.nupkg'))" /> |
| 112 | + <_PackageToPublish Include="@(Artifact)" Exclude="@(_ExistingSymbolPackage)" Condition="'%(Artifact.SkipPublish)' != 'true' and '%(Extension)' == '.nupkg'" /> |
121 | 113 | </ItemGroup> |
| 114 | + </Target> |
122 | 115 |
|
123 | | - <ItemGroup> |
124 | | - <!-- Make sure that PackagesToPublish doesn't contain existing symbol packages. --> |
125 | | - <PackagesToPublish Remove="@(ExistingSymbolPackages)" /> |
| 116 | + <Target Name="AutoGenerateSymbolPackages" DependsOnTargets="BeforePublish" Condition="'$(AutoGenerateSymbolPackages)' == 'true'"> |
| 117 | + <PropertyGroup> |
| 118 | + <SymbolPackagesDir Condition="'$(SymbolPackagesDir)' == ''">$(ArtifactsTmpDir)SymbolPackages\</SymbolPackagesDir> |
| 119 | + </PropertyGroup> |
126 | 120 |
|
127 | | - <!-- Do not generate symbol packages when building from source. The generate package for the source build intermediate |
128 | | - will simply contain the same, non-symbol content. --> |
129 | | - <PackagesToPublish Update="@(PackagesToPublish)" Condition="'$(AutoGenerateSymbolPackages)' == 'true'"> |
| 121 | + <ItemGroup> |
| 122 | + <_PackageToPublish Update="@(_PackageToPublish)"> |
130 | 123 | <SymbolPackageToGenerate Condition="!Exists('%(RootDir)%(Directory)%(Filename).symbols.nupkg')">$(SymbolPackagesDir)%(Filename).symbols.nupkg</SymbolPackageToGenerate> |
131 | | - </PackagesToPublish> |
| 124 | + </_PackageToPublish> |
132 | 125 |
|
133 | | - <SymbolPackagesToGenerate Include="@(PackagesToPublish->'%(SymbolPackageToGenerate)')" Condition="'%(PackagesToPublish.SymbolPackageToGenerate)' != ''" Exclude="@(ExistingSymbolPackages -> '$(SymbolPackagesDir)%(Filename)%(Extension)')"> |
134 | | - <OriginalPackage>%(PackagesToPublish.Identity)</OriginalPackage> |
135 | | - <IsShipping>%(PackagesToPublish.IsShipping)</IsShipping> |
136 | | - </SymbolPackagesToGenerate> |
| 126 | + <_SymbolPackageToGenerate Include="@(_PackageToPublish->'%(SymbolPackageToGenerate)')" |
| 127 | + Exclude="@(_ExistingSymbolPackage -> '$(SymbolPackagesDir)%(Filename)%(Extension)')" |
| 128 | + Condition="'%(_PackageToPublish.SymbolPackageToGenerate)' != ''"> |
| 129 | + <OriginalPackage>%(_PackageToPublish.Identity)</OriginalPackage> |
| 130 | + <IsShipping>%(_PackageToPublish.IsShipping)</IsShipping> |
| 131 | + </_SymbolPackageToGenerate> |
137 | 132 |
|
138 | 133 | <!-- If PostBuildSign is true, then we need to include newly generated packages in ItemsToSignPostBuild. --> |
139 | | - <ItemsToSignPostBuild Include="@(SymbolPackagesToGenerate->'%(Filename)%(Extension)')" Condition="'$(PostBuildSign)' == 'true'" /> |
| 134 | + <ItemsToSignPostBuild Include="@(_SymbolPackageToGenerate->'%(Filename)%(Extension)')" Condition="'$(PostBuildSign)' == 'true'" /> |
140 | 135 | </ItemGroup> |
141 | 136 |
|
142 | 137 | <!-- |
143 | 138 | If a symbol package doesn't exist yet we assume that the regular package contains Portable PDBs. |
144 | 139 | Such packages can act as symbol packages since they have the same structure. |
145 | 140 | We just need to copy them to *.symbols.nupkg. |
146 | 141 | --> |
147 | | - <MakeDir Condition="'@(SymbolPackagesToGenerate)' != ''" Directories="$(SymbolPackagesDir)" /> |
148 | | - <Copy SourceFiles="@(SymbolPackagesToGenerate->'%(OriginalPackage)')" DestinationFiles="@(SymbolPackagesToGenerate)" /> |
| 142 | + <MakeDir Condition="'@(_SymbolPackageToGenerate)' != ''" Directories="$(SymbolPackagesDir)" /> |
| 143 | + <Copy SourceFiles="@(_SymbolPackageToGenerate->'%(OriginalPackage)')" DestinationFiles="@(_SymbolPackageToGenerate)" /> |
149 | 144 |
|
150 | 145 | <ItemGroup> |
151 | 146 | <!-- |
152 | 147 | These packages from Arcade-Services include some native libraries that |
153 | 148 | our current symbol uploader can't handle. Below is a workaround until |
154 | 149 | we get issue: https://github.com/dotnet/arcade/issues/2457 sorted. |
155 | 150 | --> |
156 | | - <SymbolPackagesToGenerate Remove="$(SymbolPackagesDir)**/Microsoft.DotNet.Darc.*" /> |
157 | | - <SymbolPackagesToGenerate Remove="$(SymbolPackagesDir)**/Microsoft.DotNet.Maestro.Tasks.*" /> |
| 151 | + <_SymbolPackageToGenerate Remove="$(SymbolPackagesDir)**/Microsoft.DotNet.Darc.*" /> |
| 152 | + <_SymbolPackageToGenerate Remove="$(SymbolPackagesDir)**/Microsoft.DotNet.Maestro.Tasks.*" /> |
158 | 153 |
|
159 | 154 | <!-- Exclude all existing *.symbols.nupkg in source-only build - we create a unified symbols archive instead. --> |
160 | | - <ExistingSymbolPackages Remove="@(ExistingSymbolPackages)" Condition="'$(DotNetBuildSourceOnly)' == 'true'"/> |
| 155 | + <_ExistingSymbolPackage Remove="@(_ExistingSymbolPackage)" Condition="'$(DotNetBuildSourceOnly)' == 'true'"/> |
161 | 156 |
|
162 | | - <ItemsToPushToBlobFeed Include="@(PackagesToPublish);@(ExistingSymbolPackages);@(SymbolPackagesToGenerate)" Exclude="@(ItemsToPushToBlobFeed)" /> |
| 157 | + <ItemsToPushToBlobFeed Include="@(_PackageToPublish);@(_ExistingSymbolPackage);@(_SymbolPackageToGenerate)" Exclude="@(ItemsToPushToBlobFeed)" /> |
163 | 158 | </ItemGroup> |
164 | | - |
165 | | - <Error Condition="'$(AllowEmptySignPostBuildList)' != 'true' AND '@(ItemsToSignPostBuild)' == ''" |
166 | | - Text="List of files to sign post-build is empty. Make sure that ItemsToSignPostBuild is configured correctly." /> |
167 | 159 | </Target> |
168 | 160 |
|
169 | 161 | <!-- Generate checksums from artifact items that set ChecksumPath. |
|
256 | 248 | </ItemsToPushToBlobFeed> |
257 | 249 | </ItemGroup> |
258 | 250 |
|
| 251 | + <Error Condition="'$(AllowEmptySignPostBuildList)' != 'true' AND '@(ItemsToSignPostBuild)' == ''" |
| 252 | + Text="List of files to sign post-build is empty. Make sure that ItemsToSignPostBuild is configured correctly." /> |
| 253 | + |
259 | 254 | <!-- |
260 | 255 | The user can set `PublishingVersion` via eng\Publishing.props |
261 | 256 | --> |
|
342 | 337 | <!-- |
343 | 338 | Publish Portable PDBs contained in symbol packages. |
344 | 339 | --> |
345 | | - <PackagesToPublishToSymbolServer Include="@(ExistingSymbolPackages);@(SymbolPackagesToGenerate)"/> |
| 340 | + <PackagesToPublishToSymbolServer Include="@(_ExistingSymbolPackage);@(_SymbolPackageToGenerate)"/> |
346 | 341 | </ItemGroup> |
347 | 342 |
|
348 | 343 | <PropertyGroup> |
|
0 commit comments