Apply tool prefix to installation and restore in addition to run

This commit is contained in:
Daniel Plaisted 2019-09-09 15:10:06 -07:00
parent 7ef178c88f
commit 394129e334

View file

@ -191,7 +191,18 @@
<MakeDir Directories="$(ArtifactsTestResultsDir)" />
<Exec Command="dotnet new tool-manifest"
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<ToolRunPrefix>$(ToolRunPrefix)set MSBuildSDKsPath= &amp;&amp; </ToolRunPrefix>
<ToolRunPrefix>$(ToolRunPrefix)set DOTNET_HOST_PATH= &amp;&amp; </ToolRunPrefix>
<ToolRunPrefix>$(ToolRunPrefix)set DOTNET_INSTALLDIR= &amp;&amp; </ToolRunPrefix>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<ToolRunPrefix>$(ToolRunPrefix)unset MSBuildSDKsPath &amp;&amp; </ToolRunPrefix>
<ToolRunPrefix>$(ToolRunPrefix)unset DOTNET_HOST_PATH &amp;&amp; </ToolRunPrefix>
<ToolRunPrefix>$(ToolRunPrefix)unset DOTNET_INSTALLDIR &amp;&amp; </ToolRunPrefix>
</PropertyGroup>
<Exec Command="$(ToolRunPrefix)dotnet new tool-manifest"
WorkingDirectory="$(TestLocalToolFolder)"/>
<PropertyGroup>
@ -202,14 +213,12 @@
<InstallToolCommand>$(InstallToolCommand) --version $(SdkTestPackageVersion)</InstallToolCommand>
<InstallToolCommand>$(InstallToolCommand) --add-source $(SdkTestPackageFeed)</InstallToolCommand>
</PropertyGroup>
<Exec Command="$(InstallToolCommand)"
<Exec Command="$(ToolRunPrefix)$(InstallToolCommand)"
WorkingDirectory="$(TestLocalToolFolder)"/>
<Exec Command="dotnet tool restore"
<Exec Command="$(ToolRunPrefix)dotnet tool restore"
WorkingDirectory="$(TestLocalToolFolder)"/>
<PropertyGroup>
@ -233,17 +242,6 @@
<TestArgs>$(TestArgs) -testConfigFile "$(MSBuildThisFileDirectory)TestsToSkipx86.xml"</TestArgs>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<ToolRunPrefix>$(ToolRunPrefix)set MSBuildSDKsPath= &amp;&amp; </ToolRunPrefix>
<ToolRunPrefix>$(ToolRunPrefix)set DOTNET_HOST_PATH= &amp;&amp; </ToolRunPrefix>
<ToolRunPrefix>$(ToolRunPrefix)set DOTNET_INSTALLDIR= &amp;&amp; </ToolRunPrefix>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<ToolRunPrefix>$(ToolRunPrefix)unset MSBuildSDKsPath &amp;&amp; </ToolRunPrefix>
<ToolRunPrefix>$(ToolRunPrefix)unset DOTNET_HOST_PATH &amp;&amp; </ToolRunPrefix>
<ToolRunPrefix>$(ToolRunPrefix)unset DOTNET_INSTALLDIR &amp;&amp; </ToolRunPrefix>
</PropertyGroup>
<Exec Command="$(ToolRunPrefix)dotnet tool run $(ToolCommandName) -- $(TestArgs)"
WorkingDirectory="$(TestLocalToolFolder)" />
</Target>