Skip to content

Commit c2875f0

Browse files
authored
Support nuget static graph eval in Build.props (#5226)
1 parent 553a6fd commit c2875f0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@
199199
-->
200200

201201
<PropertyGroup>
202+
<_SolutionRestoreProps Include="@(_SolutionBuildProps)" />
203+
<_SolutionRestoreProps Include="__BuildPhase=SolutionRestore" />
204+
<_SolutionRestoreProps Include="_NETCORE_ENGINEERING_TELEMETRY=Restore" />
205+
<_SolutionRestoreProps Include="MSBuildRestoreSessionId=$([System.Guid]::NewGuid())" />
206+
<_SolutionRestoreProps Include="RestoreUseStaticGraphEvaluation=true" Condition="'$(RestoreUseStaticGraphEvaluation)' == 'true'" />
207+
202208
<!-- This can be set to false as an optimization for repos that don't use NuGet. -->
203209
<RestoreUsingNuGetTargets Condition="'$(RestoreUsingNuGetTargets)' == ''">true</RestoreUsingNuGetTargets>
204210
</PropertyGroup>
@@ -212,7 +218,7 @@
212218
the new msbuild static graph APIs (RestoreUseStaticGraphEvaluation=true).
213219
-->
214220
<MSBuild Projects="@(ProjectToBuild)"
215-
Properties="@(_SolutionBuildProps);__BuildPhase=SolutionRestore;_NETCORE_ENGINEERING_TELEMETRY=Restore"
221+
Properties="@(_SolutionRestoreProps)"
216222
RemoveProperties="$(_RemoveProps)"
217223
Targets="_IsProjectRestoreSupported"
218224
SkipNonexistentTargets="true"
@@ -238,7 +244,7 @@
238244
</ItemGroup>
239245

240246
<MSBuild Projects="@(_ProjectToRestore)"
241-
Properties="@(_SolutionBuildProps);__BuildPhase=SolutionRestore;_NETCORE_ENGINEERING_TELEMETRY=Restore;MSBuildRestoreSessionId=$([System.Guid]::NewGuid())"
247+
Properties="@(_SolutionRestoreProps)"
242248
RemoveProperties="$(_RemoveProps);TreatWarningsAsErrors"
243249
Targets="Restore"
244250
SkipNonexistentTargets="true"

0 commit comments

Comments
 (0)