Skip to content

Commit 11ae747

Browse files
committed
don't use Items for ToolPackageRuntimeIdentifier - use a property instead for ease of use
1 parent d87a4af commit 11ae747

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ Copyright (c) .NET Foundation. All rights reserved.
7070
<ToolEntryPoint Condition=" '$(UseAppHost)' == 'true' ">$(AssemblyName)$(_NativeExecutableExtension)</ToolEntryPoint>
7171
</PropertyGroup>
7272

73-
<PropertyGroup Condition="'@(ToolPackageRuntimeIdentifier)' != '' And '$(RuntimeIdentifier)' != ''">
73+
<!-- inner-build tool packages get a RID suffix -->
74+
<PropertyGroup Condition="'$(ToolPackageRuntimeIdentifier)' != '' And '$(RuntimeIdentifier)' != ''">
7475
<PackageId>$(PackageId).$(RuntimeIdentifier)</PackageId>
7576
</PropertyGroup>
7677

@@ -127,13 +128,14 @@ Copyright (c) .NET Foundation. All rights reserved.
127128

128129
<Target Name="_GenerateToolsSettingsFileInputCache">
129130
<ItemGroup>
131+
<_ToolPackageRuntimeIdentifier Include="$(ToolRuntimeIdentifier)" />
130132
<_GenerateToolsSettingsFileInputCacheToHash Include="$(ToolEntryPoint)" />
131133
<_GenerateToolsSettingsFileInputCacheToHash Include="$(ToolCommandName)" />
132134
<_GenerateToolsSettingsFileInputCacheToHash Include="$(ToolCommandRunner)" />
133135
<_GenerateToolsSettingsFileInputCacheToHash Include="$(ToolRuntimeIdentifier)" />
134136
<_GenerateToolsSettingsFileInputCacheToHash Include="$(PackageId)" />
135137
<_GenerateToolsSettingsFileInputCacheToHash Include="$(Version)" />
136-
<_GenerateToolsSettingsFileInputCacheToHash Include="@(ToolPackageRuntimeIdentifier->'%(Identity)%(Version)')" />
138+
<_GenerateToolsSettingsFileInputCacheToHash Include="@(_ToolPackageRuntimeIdentifier->'%(Identity)')" />
137139
</ItemGroup>
138140

139141
<Hash ItemsToHash="@(_GenerateToolsSettingsFileInputCacheToHash)">
@@ -164,7 +166,7 @@ Copyright (c) .NET Foundation. All rights reserved.
164166
RuntimeIdentifier="$(ToolRuntimeIdentifier)"
165167
ToolPackageId="$(PackageId)"
166168
ToolPackageVersion="$(Version)"
167-
ToolPackageRuntimeIdentifiers="@(ToolPackageRuntimeIdentifier)"
169+
ToolPackageRuntimeIdentifiers="@(_ToolPackageRuntimeIdentifier)"
168170
ToolsSettingsFilePath="$(_ToolsSettingsFilePath)" />
169171
</Target>
170172

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Common.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Copyright (c) .NET Foundation. All rights reserved.
5454
BeforeTargets="GenerateNuspec">
5555

5656
<PropertyGroup>
57-
<_ToolPackageType Condition="'$(RuntimeIdentifier)' != '' And '@(ToolPackageRuntimeIdentifier)' != ''">DotnetToolRidPackage</_ToolPackageType>
57+
<_ToolPackageType Condition="'$(RuntimeIdentifier)' != '' And '$(ToolPackageRuntimeIdentifier)' != ''">DotnetToolRidPackage</_ToolPackageType>
5858
<_ToolPackageType Condition="'$(_ToolPackageType)' == ''">DotnetTool</_ToolPackageType>
5959
</PropertyGroup>
6060

@@ -75,7 +75,7 @@ Copyright (c) .NET Foundation. All rights reserved.
7575
7676
_PaddedPackageType is used to ensure that the PackageType is semicolon delimited and can be easily checked for an existing DotnetTool package type.
7777
-->
78-
78+
7979
<AddPackageType CurrentPackageType="$(PackageType)" PackageTypeToAdd="$(_ToolPackageType)">
8080
<Output TaskParameter="UpdatedPackageType" PropertyName="PackageType" />
8181
</AddPackageType>

0 commit comments

Comments
 (0)