Obtain runtime from dotnet --info

This is a breaking change that requires developers to update their
version of .NET CLI. In order to stop specifying where dotnet should
output the artifacts, we need to be able to guess their location
correctly, which requires knowing the current RID (and framework).
This commit is contained in:
Andrew Schwartzmeyer 2016-04-01 14:43:18 -07:00
parent 6cf8e39d1a
commit bf470de5ca

View File

@ -89,6 +89,20 @@ function Start-PSBuild {
$precheck = $precheck -and (precheck $Dependency "Build dependency '$Dependency' not found. Run '$InstallCommand install $Dependency'")
}
}
if (-Not $Runtime) {
$Runtime = dotnet --info | % {
if ($_ -match "RID") {
$_ -split "\s+" | Select-Object -Last 1
}
}
if (-Not $Runtime) {
Write-Warning "Could not determine Runtime Identifier, please update dotnet"
$precheck = $false
} else {
log "Runtime not specified, using $Runtime"
}
}
# Abort if any precheck failed
@ -171,8 +185,12 @@ function Start-PSBuild {
log "Building PowerShell"
$Arguments = "--framework", $framework
if ($IsLinux -Or $IsOSX) { $Arguments += "--configuration", "Linux" }
if ($Runtime) { $Arguments += "--runtime", $Runtime }
if ($IsLinux -Or $IsOSX) {
$Arguments += "--configuration", "Linux"
}
$Arguments += "--runtime", $Runtime
log "Run dotnet build $Arguments from $pwd"