Avoid double restores by invoking NuGet.targets directly

This commit is contained in:
Nate McMaster 2018-10-25 13:28:19 -07:00
parent ab40e68727
commit dbc28c523e
No known key found for this signature in database
GPG Key ID: A778D9601BD78810
1 changed files with 8 additions and 13 deletions

View File

@ -1,12 +1,6 @@
<Project>
<Import Project="SharedFx.props" />
<ItemDefinitionGroup>
<ProjectToBuild>
<Restore>true</Restore>
</ProjectToBuild>
</ItemDefinitionGroup>
<PropertyGroup>
<UnitTestFxProject>$(RepositoryRoot)\src\Framework\Framework.UnitTests\Framework.UnitTests.csproj</UnitTestFxProject>
</PropertyGroup>
@ -15,18 +9,19 @@
<ProjectToBuild Include="$(RepositoryRoot)src\Framework\**\*.pkgproj" />
<ProjectToBuild Include="$(RepositoryRoot)src\Framework\**\*.shfxproj" />
<ProjectToBuild Include="$(UnitTestFxProject)" />
<ProjectToBuild Include="$(RepositoryRoot)src\Installers\Archive.Internal\*.*proj" Restore="false" />
<ProjectToBuild Include="$(RepositoryRoot)src\Installers\Archive.Redist\*.*proj" Restore="false" />
<ProjectToBuild Include="$(RepositoryRoot)src\Installers\Archive.Internal\*.*proj" />
<ProjectToBuild Include="$(RepositoryRoot)src\Installers\Archive.Redist\*.*proj" />
</ItemGroup>
<Target Name="_BuildSharedFxProjects" DependsOnTargets="ResolveCommitHash">
<MSBuild Projects="@(ProjectToBuild)"
<PropertyGroup>
<_RestoreGraphProjectInput>@(ProjectToBuild)</_RestoreGraphProjectInput>
</PropertyGroup>
<MSBuild Projects="$(MSBuildToolsPath)\NuGet.targets"
Targets="Restore"
Properties="$(SolutionProperties);_DummyTarget=Restore"
BuildInParallel="true"
SkipNonexistentTargets="true"
Condition=" '%(Restore)' != 'false' " />
Properties="$(SolutionProperties);RestoreGraphProjectInput=$(_RestoreGraphProjectInput);_DummyTarget=Restore" />
<MSBuild Projects="@(ProjectToBuild)"
Properties="$(SolutionProperties)"