Skip to content

Commit fd4e6bb

Browse files
committed
fix ordering of some computed properties so that we accurately answer the question of 'would my inner packages be publishing as AOT?'
1 parent 7abd619 commit fd4e6bb

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,22 @@ NOTE: This file is imported from the following contexts, so be aware when writin
4141
<!-- tools are specially-formatted packages, so we tell nuget Pack to not even try to include build output -->
4242
<IncludeBuildOutput>false</IncludeBuildOutput>
4343

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+
4456
<_IsRidSpecific>false</_IsRidSpecific>
4557
<_IsRidSpecific Condition="'$(RuntimeIdentifier)' != '' and '$(RuntimeIdentifier)' != 'any'">true</_IsRidSpecific>
4658

59+
<!-- Not determine information about this specific build of a single (or more!) tool packages -->
4760
<!-- 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 -->
4861
<!-- RID information is also stripped during Restore, so we need to make sure user
4962
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
5871
<!-- We need to know if the inner builds are _intended_ to be AOT even if we then explicitly disable AOT for the outer builds.
5972
Knowing this lets us correctly decide to create the RID-specific inner tools or not when packaging the outer tool. -->
6073
<_InnerToolsPublishAot>false</_InnerToolsPublishAot>
61-
<_InnerToolsPublishAot Condition="$(_IsRidSpecific) and '$(PublishAot)' == 'true'">true</_InnerToolsPublishAot>
74+
<_InnerToolsPublishAot Condition="$(_HasRIDSpecificTools) and '$(PublishAot)' == 'true'">true</_InnerToolsPublishAot>
6275
<PublishAot Condition="!$(_IsRidSpecific) and '$(MSBuildIsRestoring)' != 'true'">false</PublishAot>
6376

6477
<!-- we want to ensure that we don't publish any AppHosts for the 'outer', RID-agnostic builds -->
6578
<UseAppHost Condition="!$(_IsRidSpecific)">false</UseAppHost>
6679
<!-- we want to ensure that we _do_ publish any AppHosts for the 'inner', RID-specific builds -->
6780
<UseAppHost Condition="$(_IsRidSpecific)">true</UseAppHost>
6881

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-
8082
<!-- Tool implementation files are not included in the primary package when the tool has RID-specific packages. So only pack the tool implementation
8183
(and only depend on publish) if there are no RID-specific packages, or if the RuntimeIdentifier is set. -->
8284
<_ToolPackageShouldIncludeImplementation Condition=" '$(PackAsTool)' == 'true' And

0 commit comments

Comments
 (0)