build: fix Start-PSBuild -Output (#7504)

Make Start-PSBuild -Output $OutDir output the build to the directory properly.
This commit is contained in:
kwkam 2018-10-30 08:43:41 +08:00 committed by Travis Plunk
parent c36e4ad983
commit a4d4c31390

View File

@ -203,6 +203,8 @@ function Start-PSBuild {
[switch]$StopDevPowerShell,
[switch]$Restore,
# Accept a path to the output directory
# When specified, --output <path> will be passed to dotnet
[string]$Output,
[switch]$ResGen,
[switch]$TypeGen,
@ -323,11 +325,8 @@ Fix steps:
# setup arguments
$Arguments = @("publish","--no-restore","/property:GenerateFullPaths=true")
if ($Output) {
$Arguments += "--output", $Output
}
elseif ($SMAOnly) {
$Arguments += "--output", (Split-Path $script:Options.Output)
if ($Output -or $SMAOnly) {
$Arguments += "--output", (Split-Path $Options.Output)
}
$Arguments += "--configuration", $Options.Configuration
@ -605,6 +604,10 @@ function New-PSOptions {
[switch]$CrossGen,
# Accept a path to the output directory
# If not null or empty, name of the executable will be appended to
# this path, otherwise, to the default path, and then the full path
# of the output executable will be assigned to the Output property
[string]$Output,
[switch]$SMAOnly,
@ -683,6 +686,8 @@ function New-PSOptions {
} else {
$Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Runtime, "publish", $Executable)
}
} else {
$Output = [IO.Path]::Combine($Output, $Executable)
}
if ($SMAOnly)