Skip to content

Commit 5406dc1

Browse files
committed
handle multi-RID publishing as part of outer-packaging
1 parent b7b58e4 commit 5406dc1

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.PackTool.targets

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ Copyright (c) .NET Foundation. All rights reserved.
3232
<PublishTrimmed Condition="'$(RuntimeIdentifier)' == ''">false</PublishTrimmed>
3333
<PublishReadyToRun Condition="'$(RuntimeIdentifier)' == ''">false</PublishReadyToRun>
3434
<PublishAot Condition="'$(RuntimeIdentifier)' == ''">false</PublishAot>
35+
36+
<!-- set up generation dependencies -->
37+
<GenerateNuspecDependsOn Condition=" ('$(GeneratePackageOnBuild)' != 'true' and '$(NoBuild)' != 'true') and $(IsPublishable) == 'true' ">$(GenerateNuspecDependsOn);_PublishBuildAlternative</GenerateNuspecDependsOn>
38+
<GenerateNuspecDependsOn Condition=" ('$(GeneratePackageOnBuild)' == 'true' or '$(NoBuild)' == 'true') and $(IsPublishable) == 'true' ">$(GenerateNuspecDependsOn);$(_PublishNoBuildAlternativeDependsOn)</GenerateNuspecDependsOn>
39+
<GenerateNuspecDependsOn Condition=" '$(ToolPackageRuntimeIdentifiers)' != '' and '$(RuntimeIdentifier)' == '' ">$(GenerateNuspecDependsOn);_CreateRIDSpecificToolPackages</GenerateNuspecDependsOn>
3540
</PropertyGroup>
3641
<!--
3742
@@ -59,10 +64,6 @@ Copyright (c) .NET Foundation. All rights reserved.
5964
-->
6065
<Target Name="SetPackToolProperties"
6166
BeforeTargets="_GenerateRestoreProjectSpec;_GenerateToolsSettingsFileInputCache;_GenerateShimInputCache;_GetOutputItemsFromPack">
62-
<PropertyGroup>
63-
<GenerateNuspecDependsOn Condition=" ('$(GeneratePackageOnBuild)' != 'true' and '$(NoBuild)' != 'true') and $(IsPublishable) == 'true' ">$(GenerateNuspecDependsOn);_PublishBuildAlternative</GenerateNuspecDependsOn>
64-
<GenerateNuspecDependsOn Condition=" ('$(GeneratePackageOnBuild)' == 'true' or '$(NoBuild)' == 'true') and $(IsPublishable) == 'true' ">$(GenerateNuspecDependsOn);$(_PublishNoBuildAlternativeDependsOn)</GenerateNuspecDependsOn>
65-
</PropertyGroup>
6667

6768
<!-- Needs to be in a target so we don't need to worry about evaluation order with NativeBinary property -->
6869
<PropertyGroup Condition="'$(ToolEntryPoint)' == ''">
@@ -290,4 +291,22 @@ Copyright (c) .NET Foundation. All rights reserved.
290291
</ItemGroup>
291292
</Target>
292293

294+
<!-- orchestrator for making the N RID-specific tool packages -->
295+
<Target Name="_CreateRIDSpecificToolPackages">
296+
<PropertyGroup>
297+
<_PackageRids>$(ToolPackageRuntimeIdentifiers)</_PackageRids>
298+
<_PackageRids Condition="'$(_PackageRids)' == ''">$(RuntimeIdentifiers)</_PackageRids>
299+
</PropertyGroup>
300+
301+
<ItemGroup>
302+
<!-- Build the RID-specific packages.-->
303+
<_rids Include="$(_PackageRids)" />
304+
<_RidSpecificToolPackageProject Include="$(MSBuildProjectFullPath)" AdditionalProperties="RuntimeIdentifier=%(_rids.Identity);" />
305+
</ItemGroup>
306+
307+
<MSBuild BuildInParallel="true" Projects="@(_RidSpecificToolPackageProject)" Targets="Pack">
308+
<Output TaskParameter="TargetOutputs" ItemName="_ToolPackageOutputs" />
309+
</MSBuild>
310+
</Target>
311+
293312
</Project>

0 commit comments

Comments
 (0)