Skip to content

Commit 5b27bb6

Browse files
committed
Use Microsoft.Build.Traversal for Tools.proj to import NuGet targets as expected
1 parent 28df9e5 commit 5b27bb6

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,28 +134,32 @@
134134
</ItemGroup>
135135

136136
<ItemGroup>
137-
<_RestoreToolsProps Include="@(_CommonProps)"/>
138-
<_RestoreToolsProps Include="BaseIntermediateOutputPath=$(ArtifactsToolsetDir)Common"/>
139-
<_RestoreToolsProps Include="ExcludeRestorePackageImports=true"/>
140-
<_RestoreToolsProps Include="_NuGetRestoreTargets=$(_NuGetRestoreTargets)"/>
137+
<_CommonToolsProps Include="@(_CommonProps)"/>
138+
<_CommonToolsProps Include="BaseIntermediateOutputPath=$(ArtifactsToolsetDir)Common"/>
139+
<_CommonToolsProps Include="_NuGetRestoreTargets=$(_NuGetRestoreTargets)"/>
141140

142141
<!-- Used in the SDK (Tools.proj) to control whether Build.Tasks.Feed will be restored or not. -->
143-
<_RestoreToolsProps Include="Publish=$(Publish)"/>
142+
<_CommonToolsProps Include="Publish=$(Publish)"/>
144143

145144
<!-- Used in the SDK (Tools.proj) to control whether SymbolUploader.Build.Task will be restored or not. -->
146-
<_RestoreToolsProps Include="PublishToSymbolServer=$(PublishToSymbolServer)"/>
145+
<_CommonToolsProps Include="PublishToSymbolServer=$(PublishToSymbolServer)"/>
147146

148147
<!-- Forward this property because we can't assume it will be available globally. -->
149-
<_RestoreToolsProps Include="DotNetPublishUsingPipelines=$(DotNetPublishUsingPipelines)"/>
148+
<_CommonToolsProps Include="DotNetPublishUsingPipelines=$(DotNetPublishUsingPipelines)"/>
150149
</ItemGroup>
151150

152151
<!--
153152
Builds from the 'internal' project, and only those, can download the .net Runtime
154153
from a private location.
155154
-->
156155
<ItemGroup Condition="'$(SYSTEM_TEAMPROJECT)' == 'internal'">
157-
<_RestoreToolsProps Include="DotNetRuntimeSourceFeed=$(DotNetRuntimeSourceFeed)"/>
158-
<_RestoreToolsProps Include="DotNetRuntimeSourceFeedKey=$(DotNetRuntimeSourceFeedKey)"/>
156+
<_CommonToolsProps Include="DotNetRuntimeSourceFeed=$(DotNetRuntimeSourceFeed)"/>
157+
<_CommonToolsProps Include="DotNetRuntimeSourceFeedKey=$(DotNetRuntimeSourceFeedKey)"/>
158+
</ItemGroup>
159+
160+
<ItemGroup>
161+
<_RestoreToolsProps Include="@(_CommonToolsProps)"/>
162+
<_RestoreToolsProps Include="ExcludeRestorePackageImports=true"/>
159163
</ItemGroup>
160164

161165
<!--
@@ -168,7 +172,7 @@
168172

169173
<MSBuild Projects="Tools.proj"
170174
Targets="ReturnNuGetPackageRoot"
171-
Properties="@(_RestoreToolsProps);_NETCORE_ENGINEERING_TELEMETRY=ReturnNuGetPackageRoot">
175+
Properties="@(_CommonToolsProps);_NETCORE_ENGINEERING_TELEMETRY=ReturnNuGetPackageRoot">
172176
<Output TaskParameter="TargetOutputs" ItemName="_RestoreToolsOutput" />
173177
</MSBuild>
174178

src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
2-
<Project>
2+
<Project Sdk="Microsoft.Build.Traversal">
33

44
<Import Project="BuildStep.props" />
55

66
<!-- Properties requires by NuGet.targets to restore PackageReferences -->
77
<PropertyGroup>
88
<TargetFramework>net472</TargetFramework>
99
<!-- Workaround changes from newer MSBuild requiring additional properties -->
10-
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">5</TargetFrameworkVersion>
10+
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.7.2</TargetFrameworkVersion>
1111
<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
1212
<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">.NETFramework,Version=v4.7.2</TargetFrameworkMoniker>
1313
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>

0 commit comments

Comments
 (0)