Add $script:Output to store location of executable
This commit is contained in:
parent
fde63f4bc0
commit
2b46e0d5eb
@ -114,12 +114,27 @@ function Start-PSBuild {
|
|||||||
# define key build variables
|
# define key build variables
|
||||||
if ($FullCLR) {
|
if ($FullCLR) {
|
||||||
$Top = "$PSScriptRoot\src\Microsoft.PowerShell.ConsoleHost"
|
$Top = "$PSScriptRoot\src\Microsoft.PowerShell.ConsoleHost"
|
||||||
$framework = 'net451'
|
$Framework = 'net451'
|
||||||
} else {
|
} else {
|
||||||
$Top = "$PSScriptRoot/src/Microsoft.PowerShell.Linux.Host"
|
$Top = "$PSScriptRoot/src/Microsoft.PowerShell.Linux.Host"
|
||||||
$framework = 'netstandardapp1.5'
|
$Framework = 'netstandardapp1.5'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($IsLinux -Or $IsOSX) {
|
||||||
|
$Configuration = "Linux"
|
||||||
|
$Executable = "powershell"
|
||||||
|
} else {
|
||||||
|
$Configuration = "Debug"
|
||||||
|
$Executable = "powershell.exe"
|
||||||
|
}
|
||||||
|
|
||||||
|
$Arguments = @()
|
||||||
|
$Arguments += "--framework", $Framework
|
||||||
|
$Arguments += "--configuration", $Configuration
|
||||||
|
$Arguments += "--runtime", $Runtime
|
||||||
|
$script:Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Runtime, $Executable)
|
||||||
|
Write-Verbose "script:Output is $script:Output"
|
||||||
|
|
||||||
# handle Restore
|
# handle Restore
|
||||||
if ($Restore -Or -Not (Test-Path "$Top/project.lock.json")) {
|
if ($Restore -Or -Not (Test-Path "$Top/project.lock.json")) {
|
||||||
log "Run dotnet restore"
|
log "Run dotnet restore"
|
||||||
@ -182,25 +197,19 @@ function Start-PSBuild {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log "Building PowerShell"
|
|
||||||
|
|
||||||
$Arguments = "--framework", $framework
|
|
||||||
|
|
||||||
if ($IsLinux -Or $IsOSX) {
|
|
||||||
$Arguments += "--configuration", "Linux"
|
|
||||||
}
|
|
||||||
|
|
||||||
$Arguments += "--runtime", $Runtime
|
|
||||||
|
|
||||||
log "Run dotnet build $Arguments from $pwd"
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
# Relative paths do not work well if cwd is not changed to project
|
# Relative paths do not work well if cwd is not changed to project
|
||||||
|
log "Run `dotnet build $Arguments` from $pwd"
|
||||||
Push-Location $Top
|
Push-Location $Top
|
||||||
dotnet build $Arguments
|
dotnet build $Arguments
|
||||||
} finally {
|
} finally {
|
||||||
Pop-Location
|
Pop-Location
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get-PSOutput {
|
||||||
|
$script:Output
|
||||||
}
|
}
|
||||||
|
|
||||||
function Start-PSPackage {
|
function Start-PSPackage {
|
||||||
|
Loading…
Reference in New Issue
Block a user