Update PATH to our xcopy CLI

In the case the CLI was previously downloaded but not yet on `%PATH%` we
need to manually add it there. Not doing it leads to cases where MSBuild
can't find the proper SDK and as a result failing the build.

closes #25649
上级 f6979530
......@@ -136,7 +136,6 @@ function Ensure-NuGet() {
# Ensure the proper SDK in installed in our %PATH%. This is how MSBuild locates the
# SDK. Returns the location to the dotnet exe
function Ensure-DotnetSdk() {
# Check to see if the specified dotnet installations meets our build requirements
function Test-DotnetDir([string]$dotnetDir, [string]$runtimeVersion, [string]$sdkVersion) {
$sdkPath = Join-Path $dotnetDir "sdk\$sdkVersion"
......@@ -180,6 +179,9 @@ function Ensure-DotnetSdk() {
Exec-Block { & $destFile -Version $sdkVersion -InstallDir $cliDir } | Out-Null
Exec-Block { & $destFile -Version $runtimeVersion -SharedRuntime -InstallDir $cliDir } | Out-Null
}
else {
${env:PATH} = "$cliDir;${env:PATH}"
}
return (Join-Path $cliDir "dotnet.exe")
}
......
......@@ -180,7 +180,10 @@ function Restore-Packages() {
Write-Host "Restoring $($both[0])"
$projectFilePath = $both[1]
$projectFileName = [IO.Path]::GetFileNameWithoutExtension($projectFilePath)
$logFilePath = Join-Path $logsDir "Restore-$($projectFileName).binlog"
$logFilePath = ""
if ($binaryLog) {
$logFilePath = Join-Path $logsDir "Restore-$($projectFileName).binlog"
}
Restore-Project $dotnet $both[1] $logFilePath
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册