From 2b46e0d5eb8a8bffb1e2ba8d32b5e50e54cb664d Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 1 Apr 2016 17:51:38 -0700 Subject: [PATCH] Add $script:Output to store location of executable --- PowerShellGitHubDev.psm1 | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 35cc98c508..cad22df760 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -114,12 +114,27 @@ function Start-PSBuild { # define key build variables if ($FullCLR) { $Top = "$PSScriptRoot\src\Microsoft.PowerShell.ConsoleHost" - $framework = 'net451' + $Framework = 'net451' } else { $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 if ($Restore -Or -Not (Test-Path "$Top/project.lock.json")) { 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 { # Relative paths do not work well if cwd is not changed to project + log "Run `dotnet build $Arguments` from $pwd" Push-Location $Top dotnet build $Arguments } finally { Pop-Location } + +} + +function Get-PSOutput { + $script:Output } function Start-PSPackage {