@@ -30,6 +30,8 @@ Copyright (c) .NET Foundation. All rights reserved.
30
30
<SelfContained Condition =" '$(RuntimeIdentifier)' == ''" >false</SelfContained >
31
31
<PublishTrimmed Condition =" '$(RuntimeIdentifier)' == ''" >false</PublishTrimmed >
32
32
<PublishReadyToRun Condition =" '$(RuntimeIdentifier)' == ''" >false</PublishReadyToRun >
33
+ <_InnerToolsPublishAot >false</_InnerToolsPublishAot >
34
+ <_InnerToolsPublishAot Condition =" '$(RuntimeIdentifier)' == '' and '$(PublishAot)' == 'true'" >true</_InnerToolsPublishAot >
33
35
<PublishAot Condition =" '$(RuntimeIdentifier)' == ''" >false</PublishAot >
34
36
35
37
<!-- 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.
47
49
<!-- Tool implementation files are not included in the primary package when the tool has RID-specific packages. So only pack the tool implementation
48
50
(and only depend on publish) if there are no RID-specific packages, or if the RuntimeIdentifier is set. -->
49
51
<_ToolPackageShouldIncludeImplementation Condition =" '$(PackAsTool)' == 'true' And
50
- ('$(ToolPackageRuntimeIdentifiers )' == '' Or '$(RuntimeIdentifier)' != '')" >true</_ToolPackageShouldIncludeImplementation >
52
+ ('$(_UserSpecifiedToolPackageRids )' == '' Or '$(RuntimeIdentifier)' != '')" >true</_ToolPackageShouldIncludeImplementation >
51
53
<_ToolPackageShouldIncludeImplementation Condition =" '$(_ToolPackageShouldIncludeImplementation)' == ''" >false</_ToolPackageShouldIncludeImplementation >
52
54
<_HasRIDSpecificTools Condition =" '$(_UserSpecifiedToolPackageRids)' != '' " >true</_HasRIDSpecificTools >
53
55
<_HasRIDSpecificTools Condition =" '$(_HasRIDSpecificTools)' == ''" >false</_HasRIDSpecificTools >
@@ -60,7 +62,7 @@ Copyright (c) .NET Foundation. All rights reserved.
60
62
<_PackToolPublishDependency Condition =" '$(_ToolPackageShouldIncludeImplementation)' != '' and '$(GeneratePackageOnBuild)' == 'true' and $(IsPublishable) == 'true' " >$(_PublishNoBuildAlternativeDependsOn)</_PackToolPublishDependency >
61
63
62
64
<!-- Trigger RID-specific inner builds if RID-specific mode is enabled-->
63
- <GenerateNuspecDependsOn >$(GenerateNuspecDependsOn);_CreateRIDSpecificToolPackages</GenerateNuspecDependsOn >
65
+ <GenerateNuspecDependsOn >$(GenerateNuspecDependsOn);SetDotnetToolPackageType; _CreateRIDSpecificToolPackages</GenerateNuspecDependsOn >
64
66
65
67
<!-- finally set up the entrypoint for all tool-content regardless of tool type-->
66
68
<TargetsForTfmSpecificContentInPackage >$(TargetsForTfmSpecificContentInPackage);PackTool</TargetsForTfmSpecificContentInPackage >
@@ -321,9 +323,7 @@ Copyright (c) .NET Foundation. All rights reserved.
321
323
322
324
<UsingTask TaskName =" AddPackageType" AssemblyFile =" $(MicrosoftNETBuildTasksAssembly)" />
323
325
324
- <Target Name =" SetDotnetToolPackageType"
325
- Condition =" '$(PackAsTool)' == 'true' "
326
- BeforeTargets =" GenerateNuspec" >
326
+ <Target Name =" SetDotnetToolPackageType" >
327
327
328
328
<PropertyGroup >
329
329
<_ToolPackageType Condition =" '$(RuntimeIdentifier)' != '' And '$(_HasRIDSpecificTools)' != ''" >DotnetToolRidPackage</_ToolPackageType >
@@ -354,7 +354,7 @@ Copyright (c) .NET Foundation. All rights reserved.
354
354
</Target >
355
355
356
356
<!-- 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) " >
358
358
<PropertyGroup >
359
359
<_PackageRids >$(ToolPackageRuntimeIdentifiers)</_PackageRids >
360
360
<_PackageRids Condition =" '$(_PackageRids)' == ''" >$(RuntimeIdentifiers)</_PackageRids >
0 commit comments