Skip to content

Commit 918efb0

Browse files
committed
ensure inner-RID packing only happens for multi-RID tools, not tools that include shims
1 parent 1f25962 commit 918efb0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ Copyright (c) .NET Foundation. All rights reserved.
3131
<PublishReadyToRun Condition="'$(RuntimeIdentifier)' == ''">false</PublishReadyToRun>
3232
<PublishAot Condition="'$(RuntimeIdentifier)' == ''">false</PublishAot>
3333
<!-- If shims are included, we need to make sure we restore for those RIDs so the apphost shims are available during restore/publish -->
34+
<_ToolRidsAreOnlyShims Condition="'$(RuntimeIdentifiers)' == '' and $(PackAsToolShimRuntimeIdentifiers) != '' ">true</_ToolRidsAreOnlyShims>
35+
<_ToolRidsAreOnlyShims>false</_ToolRidsAreOnlyShims>
3436
<RuntimeIdentifiers Condition="'$(PackAsToolShimRuntimeIdentifiers)' != ''">$(RuntimeIdentifiers);$(PackAsToolShimRuntimeIdentifiers)</RuntimeIdentifiers>
3537

3638
<!-- Tool implementation files are not included in the primary package when the tool has RID-specific packages. So only pack the tool implementation
3739
(and only depend on publish) if there are no RID-specific packages, or if the RuntimeIdentifier is set. -->
3840
<_ToolPackageShouldIncludeImplementation Condition=" '$(PackAsTool)' == 'true' And
3941
('$(ToolPackageRuntimeIdentifiers)' == '' Or '$(RuntimeIdentifier)' != '')">true</_ToolPackageShouldIncludeImplementation>
4042
<_ToolPackageShouldIncludeImplementation Condition="'$(_ToolPackageShouldIncludeImplementation)' == ''">false</_ToolPackageShouldIncludeImplementation>
41-
<_HasRIDSpecificTools Condition=" '$(ToolPackageRuntimeIdentifiers)' != '' or '$(RuntimeIdentifiers)' != '' ">true</_HasRIDSpecificTools>
43+
<_HasRIDSpecificTools Condition=" '$(ToolPackageRuntimeIdentifiers)' != '' or ( '$(RuntimeIdentifiers)' != '' and $(_ToolRidsAreOnlyShims) == false ) ">true</_HasRIDSpecificTools>
4244
<_HasRIDSpecificTools Condition="'$(_HasRIDSpecificTools)' == ''">false</_HasRIDSpecificTools>
4345

4446
<!-- inner builds and non-RID-specific outer builds need publish content-->

0 commit comments

Comments
 (0)