This commit is contained in:
Scott Williams 2017-03-08 08:05:27 +00:00
Родитель ebdb6e29f2
Коммит 4265027af2
2 изменённых файлов: 38 добавлений и 2 удалений

Просмотреть файл

@ -1,11 +1,18 @@
version: 0.0.{build}
install:
# Use the install script to grab the latest dotnet install
- ps: iex .\dotnet-latest.ps1
- choco install gitversion.portable -pre -y
# Prepend newly installed dotnet cli to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- "SET PATH=C:\\Program Files\\dotnet\\bin;%PATH%"
before_build:
- ps: gitversion /l console /output buildserver
- cmd: dotnet --version
- ps: gitversion /l console /output buildserver
build_script:
- cmd: build.cmd

29
dotnet-latest.ps1 Normal file
Просмотреть файл

@ -0,0 +1,29 @@
# Set up everything for using the dotnet cli. This should mean we do not have to wait for Appveyor images to be updated.
# Clean and recreate the folder in which all output packages should be placed
$ArtifactsPath = "artifacts"
if (Test-Path $ArtifactsPath) {
Remove-Item -Path $ArtifactsPath -Recurse -Force -ErrorAction Ignore
}
New-Item $ArtifactsPath -ItemType Directory -ErrorAction Ignore | Out-Null
Write-Host "Created artifacts folder '$ArtifactsPath'"
# Install the latest dotnet cli
if (Get-Command "dotnet.exe" -ErrorAction SilentlyContinue) {
Write-Host "dotnet SDK already installed"
dotnet --version
} else {
Write-Host "Installing dotnet SDK"
$installScript = Join-Path $ArtifactsPath "dotnet-install.ps1"
Write-Host $installScript
Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/install.ps1" `
-OutFile $installScript
& $installScript
}