Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Categorize shipping/nonshipping NuGet packages #7776

Merged
merged 1 commit into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 31 additions & 17 deletions publish/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@
Include="$(DownloadDirectory)**\*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />

<!-- RID-specific nupkg. These are published from every job. -->
<!-- Add files that are not affected by filtering. -->
<UploadToBlobStorageFile
Include="@(DownloadedArtifactFile)"
Exclude="@(DownloadedSymbolNupkgFile);@(DownloadedNupkgFile)" />

<!--
Filter out the RID-specific (Runtime) nupkgs and RID-agnostic nupkgs. RID-specific packages
are published from every job. RID-agnostic nupkgs are built with the same ID/version by
every job, so one specific job's outputs must be picked to sign and publish.
-->
<RuntimeNupkgFile
Include="
$(DownloadDirectory)**\runtime.*.nupkg;
Expand All @@ -32,29 +41,34 @@
$(DownloadDirectory)**\VS.Redist.Common.*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />

<!--
RID-agnostic nupkg. These are built with the same ID/version by every job, so only one job's
results are picked for signing and publishing.
-->
<RidAgnosticNupkgToPublishFile
Include="$(DownloadDirectory)*\$(PublishRidAgnosticPackagesFromJobName)\**\*.nupkg"
Exclude="@(RuntimeNupkgFile);@(DownloadedSymbolNupkgFile)" />

<RidAgnosticNupkgToIgnoreFile
Include="@(DownloadedNupkgFile)"
Exclude="@(RidAgnosticNupkgToPublishFile);@(RuntimeNupkgFile)" />

<RidAgnosticSymbolNupkgToIgnoreFile
Include="@(RidAgnosticNupkgToIgnoreFile -> '%(RootDir)%(Directory)%(Filename).symbols.nupkg')" />

<NupkgToPublishFile Include="@(RuntimeNupkgFile);@(RidAgnosticNupkgToPublishFile)" />
<SymbolNupkgToPublishFile Include="@(DownloadedSymbolNupkgFile)" Exclude="@(RidAgnosticSymbolNupkgToIgnoreFile)" />

<!-- Filter out duplicate nupkgs/symbols.nupkgs, but other artifacts are fine. -->
<UploadToBlobStorageFile
Include="@(DownloadedArtifactFile)"
Exclude="@(RidAgnosticNupkgToIgnoreFile);@(RidAgnosticSymbolNupkgToIgnoreFile)" />
<UploadToBlobStorageFile Include="@(NupkgToPublishFile)" />

<!--
Assuming all symbol packages ship and can be found by turning .nupkg => .symbols.nupkg, find
them. Don't check for missing symbol packages here: some nupkgs don't have them for valid
reasons, such as the VS insertion packages that transport MSIs. Symbol package validation
will check for symbol completeness with file-by-file granularity rather than looking for
missing symbols.nupkg files: https://github.com/dotnet/arcade/issues/2499.
-->
<PotentialSymbolNupkgToPublishFile
Include="@(NupkgToPublishFile->Replace('\NonShipping\', '\Shipping\')->Replace('.nupkg', '.symbols.nupkg'))" />

<SymbolNupkgToPublishFile
Include="@(PotentialSymbolNupkgToPublishFile)"
Condition="Exists('%(Identity)')" />

<UploadToBlobStorageFile Include="@(SymbolNupkgToPublishFile)" />
</ItemGroup>

<Error
Condition="'@(SymbolNupkgToPublishFile)' == ''"
Text="No symbol packages found." />
</Target>

<Import Project="..\Directory.Build.targets" />
Expand Down
12 changes: 11 additions & 1 deletion publish/prepare-artifacts.proj
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,19 @@
</PropertyGroup>

<ItemGroup>
<!-- Split nupkgs into shipping/nonshipping for BAR categorization. -->
<ShippingNupkgToPublishFile
Include="@(NupkgToPublishFile)"
Condition="$([System.String]::new('%(Identity)').Contains('\Shipping\'))" />

<NonShippingNupkgToPublishFile
Include="@(NupkgToPublishFile)"
Exclude="@(ShippingNupkgToPublishFile)" />

<ItemsToPush Remove="@(ItemsToPush)" />

<ItemsToPush Include="@(NupkgToPublishFile)" />
<ItemsToPush Include="@(ShippingNupkgToPublishFile)" />
<ItemsToPush Include="@(NonShippingNupkgToPublishFile)" ManifestArtifactData="NonShipping=true" />
<ItemsToPush Include="@(SymbolNupkgToPublishFile)" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/pkg/packaging-tools/framework.sharedfx.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<MicrosoftNETPlatformLibrary>do-not-consider-existing-platform</MicrosoftNETPlatformLibrary>

<!-- Only Restore from our built packages -->
<RestoreSources>$(ArtifactsShippingPackagesDir)</RestoreSources>
<RestoreSources>$(ArtifactsShippingPackagesDir);$(ArtifactsNonShippingPackagesDir)</RestoreSources>
<AddDotnetfeedProjectSource>false</AddDotnetfeedProjectSource>
<RestoreAllBuildRids>false</RestoreAllBuildRids>
<!-- Ensure only this repo's NuGet.config file is used. -->
Expand Down
2 changes: 2 additions & 0 deletions src/pkg/projects/netcoreapp/pkg/legacy/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<PropertyGroup>
<PreventImplementationReference Condition="'$(PackageTargetRuntime)' != ''">true</PreventImplementationReference>
<BuildTargetPath>build/$(NETCoreAppFramework)/</BuildTargetPath>

<IsShippingPackage>false</IsShippingPackage>
</PropertyGroup>

<!-- Identity / Reference package content -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<ExcludeLineupReference>true</ExcludeLineupReference>

<BuildRuntimePackages>false</BuildRuntimePackages>

<IsShippingPackage>false</IsShippingPackage>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
it in correctly. Being wrong means dependency failures at runtime.
-->
<SkipValidatePackage>false</SkipValidatePackage>

<IsShippingPackage>false</IsShippingPackage>
</PropertyGroup>

<!-- Temporarily ignore duplicate types until WPF updates. https://github.com/dotnet/core-setup/issues/6838 -->
Expand Down
1 change: 1 addition & 0 deletions src/test/Assets/TestProjects/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<ItemGroup>
<RestoreTestFallbackSource Include="$(ArtifactsShippingPackagesDir)" />
<RestoreTestFallbackSource Include="$(ArtifactsNonShippingPackagesDir)" />
<RestoreTestSource Include="$(RestoreSources)" />
<RestoreTestSource Include="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<RestoreTestSource Include="https://api.nuget.org/v3/index.json" />
Expand Down
1 change: 1 addition & 0 deletions src/test/PrepareTestAssets/PrepareTestAssets.proj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
Targets="Restore"
Properties="
ArtifactsShippingPackagesDir=$(ArtifactsShippingPackagesDir);
ArtifactsNonShippingPackagesDir=$(ArtifactsNonShippingPackagesDir);
TestRestorePackagesPath=$(TestRestorePackagesPath);
TestTargetRid=$(TestTargetRid);
MNAVersion=$(ProductVersion)" />
Expand Down