@@ -41,9 +41,22 @@ NOTE: This file is imported from the following contexts, so be aware when writin
41
41
<!-- tools are specially-formatted packages, so we tell nuget Pack to not even try to include build output -->
42
42
<IncludeBuildOutput >false</IncludeBuildOutput >
43
43
44
+ <!-- Determine information about all of the potential tool packages to build -->
45
+ <!-- If shims are included, we need to make sure we restore for those RIDs so the apphost shims are available during restore/publish.
46
+ This means that we need to set RuntimeIdentifiers. However we need to track certain information about the _users_ decisions around RIDs
47
+ so that we can correctly decide if we need to package RID-specific tools or not. -->
48
+ <_ToolRidsAreOnlyShims >false</_ToolRidsAreOnlyShims >
49
+ <_ToolRidsAreOnlyShims Condition =" '$(RuntimeIdentifiers)' == '' and $(PackAsToolShimRuntimeIdentifiers) != '' " >true</_ToolRidsAreOnlyShims >
50
+ <_UserSpecifiedToolPackageRids Condition =" '$(ToolPackageRuntimeIdentifiers)' != ''" >$(ToolPackageRuntimeIdentifiers)</_UserSpecifiedToolPackageRids >
51
+ <_UserSpecifiedToolPackageRids Condition =" '$(_UserSpecifiedToolPackageRids)' == ''" >$(RuntimeIdentifiers)</_UserSpecifiedToolPackageRids >
52
+ <_HasRIDSpecificTools Condition =" '$(_UserSpecifiedToolPackageRids)' != '' " >true</_HasRIDSpecificTools >
53
+ <_HasRIDSpecificTools Condition =" '$(_HasRIDSpecificTools)' == ''" >false</_HasRIDSpecificTools >
54
+ <RuntimeIdentifiers Condition =" '$(PackAsToolShimRuntimeIdentifiers)' != ''" >$(_UserSpecifiedToolPackageRids);$(PackAsToolShimRuntimeIdentifiers)</RuntimeIdentifiers >
55
+
44
56
<_IsRidSpecific >false</_IsRidSpecific >
45
57
<_IsRidSpecific Condition =" '$(RuntimeIdentifier)' != '' and '$(RuntimeIdentifier)' != 'any'" >true</_IsRidSpecific >
46
58
59
+ <!-- Not determine information about this specific build of a single (or more!) tool packages -->
47
60
<!-- 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 -->
48
61
<!-- RID information is also stripped during Restore, so we need to make sure user
49
62
decisions are preserved when Restoring, so that publishing-related packages are implicitly included. -->
@@ -58,25 +71,14 @@ NOTE: This file is imported from the following contexts, so be aware when writin
58
71
<!-- We need to know if the inner builds are _intended_ to be AOT even if we then explicitly disable AOT for the outer builds.
59
72
Knowing this lets us correctly decide to create the RID-specific inner tools or not when packaging the outer tool. -->
60
73
<_InnerToolsPublishAot >false</_InnerToolsPublishAot >
61
- <_InnerToolsPublishAot Condition =" $(_IsRidSpecific ) and '$(PublishAot)' == 'true'" >true</_InnerToolsPublishAot >
74
+ <_InnerToolsPublishAot Condition =" $(_HasRIDSpecificTools ) and '$(PublishAot)' == 'true'" >true</_InnerToolsPublishAot >
62
75
<PublishAot Condition =" !$(_IsRidSpecific) and '$(MSBuildIsRestoring)' != 'true'" >false</PublishAot >
63
76
64
77
<!-- we want to ensure that we don't publish any AppHosts for the 'outer', RID-agnostic builds -->
65
78
<UseAppHost Condition =" !$(_IsRidSpecific)" >false</UseAppHost >
66
79
<!-- we want to ensure that we _do_ publish any AppHosts for the 'inner', RID-specific builds -->
67
80
<UseAppHost Condition =" $(_IsRidSpecific)" >true</UseAppHost >
68
81
69
- <!-- If shims are included, we need to make sure we restore for those RIDs so the apphost shims are available during restore/publish.
70
- This means that we need to set RuntimeIdentifiers. However we need to track certain information about the _users_ decisions around RIDs
71
- so that we can correctly decide if we need to package RID-specific tools or not. -->
72
- <_ToolRidsAreOnlyShims >false</_ToolRidsAreOnlyShims >
73
- <_ToolRidsAreOnlyShims Condition =" '$(RuntimeIdentifiers)' == '' and $(PackAsToolShimRuntimeIdentifiers) != '' " >true</_ToolRidsAreOnlyShims >
74
- <_UserSpecifiedToolPackageRids Condition =" '$(ToolPackageRuntimeIdentifiers)' != ''" >$(ToolPackageRuntimeIdentifiers)</_UserSpecifiedToolPackageRids >
75
- <_UserSpecifiedToolPackageRids Condition =" '$(_UserSpecifiedToolPackageRids)' == ''" >$(RuntimeIdentifiers)</_UserSpecifiedToolPackageRids >
76
- <_HasRIDSpecificTools Condition =" '$(_UserSpecifiedToolPackageRids)' != '' " >true</_HasRIDSpecificTools >
77
- <_HasRIDSpecificTools Condition =" '$(_HasRIDSpecificTools)' == ''" >false</_HasRIDSpecificTools >
78
- <RuntimeIdentifiers Condition =" '$(PackAsToolShimRuntimeIdentifiers)' != ''" >$(_UserSpecifiedToolPackageRids);$(PackAsToolShimRuntimeIdentifiers)</RuntimeIdentifiers >
79
-
80
82
<!-- Tool implementation files are not included in the primary package when the tool has RID-specific packages. So only pack the tool implementation
81
83
(and only depend on publish) if there are no RID-specific packages, or if the RuntimeIdentifier is set. -->
82
84
<_ToolPackageShouldIncludeImplementation Condition =" '$(PackAsTool)' == 'true' And
0 commit comments