From a4d4c31390cab6e7060d3188a8b29e035b686da2 Mon Sep 17 00:00:00 2001 From: kwkam Date: Tue, 30 Oct 2018 08:43:41 +0800 Subject: [PATCH] build: fix Start-PSBuild -Output (#7504) Make Start-PSBuild -Output $OutDir output the build to the directory properly. --- build.psm1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/build.psm1 b/build.psm1 index 0ee4ca62da..a5b5ba385d 100644 --- a/build.psm1 +++ b/build.psm1 @@ -203,6 +203,8 @@ function Start-PSBuild { [switch]$StopDevPowerShell, [switch]$Restore, + # Accept a path to the output directory + # When specified, --output 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)