mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 09:43:57 +08:00
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:
parent
6cf8e39d1a
commit
bf470de5ca
@ -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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user