Skip to content

Commit

Permalink
Use Microsoft.Build.Traversal for Tools.proj to import NuGet targets …
Browse files Browse the repository at this point in the history
…as expected
  • Loading branch information
sharwell committed Jun 24, 2024
1 parent 28df9e5 commit 5b27bb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
24 changes: 14 additions & 10 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -134,28 +134,32 @@
</ItemGroup>

<ItemGroup>
<_RestoreToolsProps Include="@(_CommonProps)"/>
<_RestoreToolsProps Include="BaseIntermediateOutputPath=$(ArtifactsToolsetDir)Common"/>
<_RestoreToolsProps Include="ExcludeRestorePackageImports=true"/>
<_RestoreToolsProps Include="_NuGetRestoreTargets=$(_NuGetRestoreTargets)"/>
<_CommonToolsProps Include="@(_CommonProps)"/>
<_CommonToolsProps Include="BaseIntermediateOutputPath=$(ArtifactsToolsetDir)Common"/>
<_CommonToolsProps Include="_NuGetRestoreTargets=$(_NuGetRestoreTargets)"/>

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

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

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

<!--
Builds from the 'internal' project, and only those, can download the .net Runtime
from a private location.
-->
<ItemGroup Condition="'$(SYSTEM_TEAMPROJECT)' == 'internal'">
<_RestoreToolsProps Include="DotNetRuntimeSourceFeed=$(DotNetRuntimeSourceFeed)"/>
<_RestoreToolsProps Include="DotNetRuntimeSourceFeedKey=$(DotNetRuntimeSourceFeedKey)"/>
<_CommonToolsProps Include="DotNetRuntimeSourceFeed=$(DotNetRuntimeSourceFeed)"/>
<_CommonToolsProps Include="DotNetRuntimeSourceFeedKey=$(DotNetRuntimeSourceFeedKey)"/>
</ItemGroup>

<ItemGroup>
<_RestoreToolsProps Include="@(_CommonToolsProps)"/>
<_RestoreToolsProps Include="ExcludeRestorePackageImports=true"/>
</ItemGroup>

<!--
Expand All @@ -168,7 +172,7 @@

<MSBuild Projects="Tools.proj"
Targets="ReturnNuGetPackageRoot"
Properties="@(_RestoreToolsProps);_NETCORE_ENGINEERING_TELEMETRY=ReturnNuGetPackageRoot">
Properties="@(_CommonToolsProps);_NETCORE_ENGINEERING_TELEMETRY=ReturnNuGetPackageRoot">
<Output TaskParameter="TargetOutputs" ItemName="_RestoreToolsOutput" />
</MSBuild>

Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>
<Project Sdk="Microsoft.Build.Traversal">

<Import Project="BuildStep.props" />

<!-- Properties requires by NuGet.targets to restore PackageReferences -->
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<!-- Workaround changes from newer MSBuild requiring additional properties -->
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">5</TargetFrameworkVersion>
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.7.2</TargetFrameworkVersion>
<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">.NETFramework,Version=v4.7.2</TargetFrameworkMoniker>
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
Expand Down

0 comments on commit 5b27bb6

Please sign in to comment.