@@ -30,6 +30,8 @@ Copyright (c) .NET Foundation. All rights reserved.
3030 <SelfContained Condition =" '$(RuntimeIdentifier)' == ''" >false</SelfContained >
3131 <PublishTrimmed Condition =" '$(RuntimeIdentifier)' == ''" >false</PublishTrimmed >
3232 <PublishReadyToRun Condition =" '$(RuntimeIdentifier)' == ''" >false</PublishReadyToRun >
33+ <_InnerToolsPublishAot >false</_InnerToolsPublishAot >
34+ <_InnerToolsPublishAot Condition =" '$(RuntimeIdentifier)' == '' and '$(PublishAot)' == 'true'" >true</_InnerToolsPublishAot >
3335 <PublishAot Condition =" '$(RuntimeIdentifier)' == ''" >false</PublishAot >
3436
3537 <!-- we want to ensure that we don't publish any AppHosts for the 'outer', RID-agnostic builds -->
@@ -47,7 +49,7 @@ Copyright (c) .NET Foundation. All rights reserved.
4749 <!-- Tool implementation files are not included in the primary package when the tool has RID-specific packages. So only pack the tool implementation
4850 (and only depend on publish) if there are no RID-specific packages, or if the RuntimeIdentifier is set. -->
4951 <_ToolPackageShouldIncludeImplementation Condition =" '$(PackAsTool)' == 'true' And
50- ('$(ToolPackageRuntimeIdentifiers )' == '' Or '$(RuntimeIdentifier)' != '')" >true</_ToolPackageShouldIncludeImplementation >
52+ ('$(_UserSpecifiedToolPackageRids )' == '' Or '$(RuntimeIdentifier)' != '')" >true</_ToolPackageShouldIncludeImplementation >
5153 <_ToolPackageShouldIncludeImplementation Condition =" '$(_ToolPackageShouldIncludeImplementation)' == ''" >false</_ToolPackageShouldIncludeImplementation >
5254 <_HasRIDSpecificTools Condition =" '$(_UserSpecifiedToolPackageRids)' != '' " >true</_HasRIDSpecificTools >
5355 <_HasRIDSpecificTools Condition =" '$(_HasRIDSpecificTools)' == ''" >false</_HasRIDSpecificTools >
@@ -60,7 +62,7 @@ Copyright (c) .NET Foundation. All rights reserved.
6062 <_PackToolPublishDependency Condition =" '$(_ToolPackageShouldIncludeImplementation)' != '' and '$(GeneratePackageOnBuild)' == 'true' and $(IsPublishable) == 'true' " >$(_PublishNoBuildAlternativeDependsOn)</_PackToolPublishDependency >
6163
6264 <!-- Trigger RID-specific inner builds if RID-specific mode is enabled-->
63- <GenerateNuspecDependsOn >$(GenerateNuspecDependsOn);_CreateRIDSpecificToolPackages</GenerateNuspecDependsOn >
65+ <GenerateNuspecDependsOn >$(GenerateNuspecDependsOn);SetDotnetToolPackageType; _CreateRIDSpecificToolPackages</GenerateNuspecDependsOn >
6466
6567 <!-- finally set up the entrypoint for all tool-content regardless of tool type-->
6668 <TargetsForTfmSpecificContentInPackage >$(TargetsForTfmSpecificContentInPackage);PackTool</TargetsForTfmSpecificContentInPackage >
@@ -321,9 +323,7 @@ Copyright (c) .NET Foundation. All rights reserved.
321323
322324 <UsingTask TaskName =" AddPackageType" AssemblyFile =" $(MicrosoftNETBuildTasksAssembly)" />
323325
324- <Target Name =" SetDotnetToolPackageType"
325- Condition =" '$(PackAsTool)' == 'true' "
326- BeforeTargets =" GenerateNuspec" >
326+ <Target Name =" SetDotnetToolPackageType" >
327327
328328 <PropertyGroup >
329329 <_ToolPackageType Condition =" '$(RuntimeIdentifier)' != '' And '$(_HasRIDSpecificTools)' != ''" >DotnetToolRidPackage</_ToolPackageType >
@@ -354,7 +354,7 @@ Copyright (c) .NET Foundation. All rights reserved.
354354 </Target >
355355
356356 <!-- orchestrator for making the N RID-specific tool packages -->
357- <Target Name =" _CreateRIDSpecificToolPackages" Condition =" '$(RuntimeIdentifier)' == '' and $(_HasRIDSpecificTools) and '$(PublishAot)' != 'true' " >
357+ <Target Name =" _CreateRIDSpecificToolPackages" Condition =" '$(RuntimeIdentifier)' == '' and $(_HasRIDSpecificTools) and !$(_InnerToolsPublishAot) and !$(_ToolPackageShouldIncludeImplementation) " >
358358 <PropertyGroup >
359359 <_PackageRids >$(ToolPackageRuntimeIdentifiers)</_PackageRids >
360360 <_PackageRids Condition =" '$(_PackageRids)' == ''" >$(RuntimeIdentifiers)</_PackageRids >
0 commit comments