Use cached 'dotnet' in AppVeyor (#4278)

This commit is contained in:
Travis Plunk 2017-07-18 11:39:04 -07:00 committed by Dongbo Wang
parent 44e377525b
commit 73b3b0895c
2 changed files with 31 additions and 3 deletions

View file

@ -1192,8 +1192,30 @@ function Start-PSBootstrap {
}
}
$DotnetArguments = @{ Channel=$Channel; Version=$Version; NoSudo=$NoSudo }
Install-Dotnet @DotnetArguments
$dotNetExists = precheck 'dotnet' $null
$dotNetVersion = [string]::Empty
if($dotNetExists) {
$dotNetVersion = (dotnet --version)
}
if(!$dotNetExists -or $dotNetVersion -ne $dotnetCLIRequiredVersion -or $Force.IsPresent) {
if($Force.IsPresent) {
log "Installing dotnet due to -Force."
}
elseif(!$dotNetExistis) {
log "dotnet not present. Installing dotnet."
}
else {
log "dotnet out of date ($dotNetVersion). Updating dotnet."
}
$DotnetArguments = @{ Channel=$Channel; Version=$Version; NoSudo=$NoSudo }
Install-Dotnet @DotnetArguments
}
else
{
log "dotnet is already installed. Skipping installation."
}
# Install for Windows
if ($IsWindows) {

View file

@ -3,6 +3,12 @@ $repoRoot = Join-Path $PSScriptRoot '..'
$script:administratorsGroupSID = "S-1-5-32-544"
$script:usersGroupSID = "S-1-5-32-545"
$dotNetPath = "$env:USERPROFILE\Appdata\Local\Microsoft\dotnet"
if(Test-Path $dotNetPath)
{
$env:PATH = $dotNetPath + ';' + $env:PATH
}
Import-Module (Join-Path $repoRoot 'build.psm1')
function New-LocalUser
@ -225,7 +231,7 @@ function Invoke-AppVeyorInstall
}
Set-BuildVariable -Name TestPassed -Value False
Start-PSBootstrap -Force
Start-PSBootstrap -Confirm:$false
}
# A wrapper to ensure that we upload test results