@@ -27,24 +27,31 @@ Copyright (c) .NET Foundation. All rights reserved.
27
27
<IncludeBuildOutput >false</IncludeBuildOutput >
28
28
<!-- the publish* properties _can_ be set, but only for the 'inner' RID-specific builds. We need to make sure that for the outer, agnostic build they are unset -->
29
29
<PublishSelfContained Condition =" '$(RuntimeIdentifier)' == ''" >false</PublishSelfContained >
30
+ <!-- Have to set SelfContained similarly because PackTool targets are imported _after_ RuntimeIdentifierInference targets, where the Publish* properties are
31
+ forwarded to the 'base' properties. -->
32
+ <SelfContained Condition =" '$(RuntimeIdentifier)' == ''" >false</SelfContained >
30
33
<PublishTrimmed Condition =" '$(RuntimeIdentifier)' == ''" >false</PublishTrimmed >
31
34
<PublishReadyToRun Condition =" '$(RuntimeIdentifier)' == ''" >false</PublishReadyToRun >
32
35
<PublishAot Condition =" '$(RuntimeIdentifier)' == ''" >false</PublishAot >
33
36
34
37
<!-- we want to ensure that we don't publish any AppHosts for the 'outer', RID-agnostic builds -->
35
38
<UseAppHost Condition =" '$(RuntimeIdentifier)' == ''" >false</UseAppHost >
39
+ <!-- we want to ensure that we _do_ publish any AppHosts for the 'inner', RID-specific builds -->
40
+ <UseAppHost Condition =" '$(RuntimeIdentifier)' != ''" >true</UseAppHost >
36
41
37
42
<!-- If shims are included, we need to make sure we restore for those RIDs so the apphost shims are available during restore/publish -->
38
43
<_ToolRidsAreOnlyShims >false</_ToolRidsAreOnlyShims >
39
44
<_ToolRidsAreOnlyShims Condition =" '$(RuntimeIdentifiers)' == '' and $(PackAsToolShimRuntimeIdentifiers) != '' " >true</_ToolRidsAreOnlyShims >
40
- <RuntimeIdentifiers Condition =" '$(PackAsToolShimRuntimeIdentifiers)' != ''" >$(RuntimeIdentifiers);$(PackAsToolShimRuntimeIdentifiers)</RuntimeIdentifiers >
45
+ <_UserSpecifiedToolPackageRids Condition =" '$(ToolPackageRuntimeIdentifiers)' != ''" >$(ToolPackageRuntimeIdentifiers)</_UserSpecifiedToolPackageRids >
46
+ <_UserSpecifiedToolPackageRids Condition =" '$(_UserSpecifiedToolPackageRids)' == ''" >$(RuntimeIdentifiers)</_UserSpecifiedToolPackageRids >
47
+ <RuntimeIdentifiers Condition =" '$(PackAsToolShimRuntimeIdentifiers)' != ''" >$(_UserSpecifiedToolPackageRids);$(PackAsToolShimRuntimeIdentifiers)</RuntimeIdentifiers >
41
48
42
49
<!-- Tool implementation files are not included in the primary package when the tool has RID-specific packages. So only pack the tool implementation
43
50
(and only depend on publish) if there are no RID-specific packages, or if the RuntimeIdentifier is set. -->
44
51
<_ToolPackageShouldIncludeImplementation Condition =" '$(PackAsTool)' == 'true' And
45
52
('$(ToolPackageRuntimeIdentifiers)' == '' Or '$(RuntimeIdentifier)' != '')" >true</_ToolPackageShouldIncludeImplementation >
46
53
<_ToolPackageShouldIncludeImplementation Condition =" '$(_ToolPackageShouldIncludeImplementation)' == ''" >false</_ToolPackageShouldIncludeImplementation >
47
- <_HasRIDSpecificTools Condition =" '$(ToolPackageRuntimeIdentifiers )' != '' or ( '$(RuntimeIdentifiers)' != '' and $(_ToolRidsAreOnlyShims) == false ) " >true</_HasRIDSpecificTools >
54
+ <_HasRIDSpecificTools Condition =" '$(_UserSpecifiedToolPackageRids )' != '' " >true</_HasRIDSpecificTools >
48
55
<_HasRIDSpecificTools Condition =" '$(_HasRIDSpecificTools)' == ''" >false</_HasRIDSpecificTools >
49
56
50
57
<!-- inner builds and non-RID-specific outer builds need publish content-->
@@ -94,7 +101,7 @@ Copyright (c) .NET Foundation. All rights reserved.
94
101
</PropertyGroup >
95
102
96
103
<!-- inner-build tool packages get a RID suffix -->
97
- <PropertyGroup Condition =" '$(ToolPackageRuntimeIdentifiers )' != '' And '$(RuntimeIdentifier)' != ''" >
104
+ <PropertyGroup Condition =" '$(_HasRIDSpecificTools )' != '' And '$(RuntimeIdentifier)' != ''" >
98
105
<PackageId >$(PackageId).$(RuntimeIdentifier)</PackageId >
99
106
</PropertyGroup >
100
107
@@ -156,7 +163,7 @@ Copyright (c) .NET Foundation. All rights reserved.
156
163
157
164
<Target Name =" _GenerateToolsSettingsFileInputCache" >
158
165
<ItemGroup >
159
- <_ToolPackageRuntimeIdentifier Include =" $(ToolRuntimeIdentifiers )" />
166
+ <_ToolPackageRuntimeIdentifier Include =" $(_UserSpecifiedToolPackageRids )" />
160
167
<_GenerateToolsSettingsFileInputCacheToHash Include =" $(ToolEntryPoint)" />
161
168
<_GenerateToolsSettingsFileInputCacheToHash Include =" $(ToolCommandName)" />
162
169
<_GenerateToolsSettingsFileInputCacheToHash Include =" $(ToolCommandRunner)" />
0 commit comments