From f5a95a6ef535b02579197b5ca75be166779d2dab Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 8 Apr 2016 15:57:48 -0700 Subject: [PATCH 1/4] Remove unsupported -Clean switch Will put back when it is functional. --- PowerShellGitHubDev.psm1 | 1 - 1 file changed, 1 deletion(-) diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 0f460a37c..a16c617f0 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -24,7 +24,6 @@ function Start-PSBuild { [CmdletBinding(DefaultParameterSetName='CoreCLR')] param( [switch]$Restore, - [switch]$Clean, # These runtimes must match those in project.json # We do not use ValidateScript since we want tab completion From 92a34cba5f4bb80f7420692fa3130802d779f3e0 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 8 Apr 2016 16:05:39 -0700 Subject: [PATCH 2/4] Add Publish switch to Start-PSBuild Note that it is mutually exclusive with `FullCLR` as libraries are not publishable; only applications can be published. --- PowerShellGitHubDev.psm1 | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index a16c617f0..4f8becfb2 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -25,6 +25,9 @@ function Start-PSBuild { param( [switch]$Restore, + [Parameter(ParameterSetName='CoreCLR')] + [switch]$Publish, + # These runtimes must match those in project.json # We do not use ValidateScript since we want tab completion [ValidateSet("ubuntu.14.04-x64", @@ -117,16 +120,27 @@ function Start-PSBuild { } $Arguments = @() + if ($Publish) { + $Arguments += "publish" + } else { + $Arguments += "build" + } $Arguments += "--framework", $Framework $Arguments += "--configuration", $Configuration $Arguments += "--runtime", $Runtime + # Build the Output path in script scope + $script:Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework) # FullCLR only builds a library, so there is no runtime component - if ($FullCLR) { - $script:Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Executable) - } else { - $script:Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Runtime, $Executable) + if (-Not $FullCLR) { + $script:Output = [IO.Path]::Combine($script:Output, $Runtime) } + # Publish injects the publish directory + if ($Publish) { + $script:Output = [IO.Path]::Combine($script:Output, "publish") + } + $script:Output = [IO.Path]::Combine($script:Output, $Executable) + Write-Verbose "script:Output is $script:Output" # handle Restore @@ -192,7 +206,7 @@ function Start-PSBuild { # 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 + dotnet $Arguments log "PowerShell output: $script:Output" } finally { Pop-Location From d7233fc4d076a84ff525c7cfd954abbef9433556 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 8 Apr 2016 16:06:17 -0700 Subject: [PATCH 3/4] Remove import of Platform module from AppVeyor --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1e6bf4450..76519da1e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -45,7 +45,7 @@ test_script: $env:FullOutput = "$pwd\src\Microsoft.PowerShell.ConsoleHost\bin\Debug\net451" Write-Host -Foreground Green 'Run FullCLR tests' $testResultsFileFullCLR = "$pwd\TestsResults.FullCLR.xml" - Start-DevPSGitHub -binDir $env:FullOutput -NoNewWindow -ArgumentList '-command', "Import-Module .\src\Modules\Pester; Import-Module .\bin\Modules\Microsoft.PowerShell.Platform; Invoke-Pester test/fullCLR -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR" + Start-DevPSGitHub -binDir $env:FullOutput -NoNewWindow -ArgumentList '-command', "Import-Module .\src\Modules\Pester; Invoke-Pester test/fullCLR -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR" (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFileFullCLR)) # # Fail the build, if tests failed From ac157568d6cb2ea3e363c35b9d357c1af56f7a99 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 8 Apr 2016 16:08:12 -0700 Subject: [PATCH 4/4] Publish on AppVeyor So that the artifacts for Core PowerShell have the .NET Core dependencies. --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 76519da1e..9b494ce18 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,7 +26,7 @@ build_script: $env:Path += ";$env:LocalAppData\Microsoft\dotnet\cli" dotnet --version Import-Module .\PowerShellGitHubDev.psm1 - Start-PSBuild + Start-PSBuild -Publish Start-PSBuild -FullCLR test_script: @@ -35,7 +35,7 @@ test_script: $ErrorActionPreference = 'Stop' # # CoreCLR - $env:CoreOutput = "$pwd\src\Microsoft.PowerShell.CoreConsoleHost\bin\Debug\netstandardapp1.5\win81-x64" + $env:CoreOutput = "$pwd\src\Microsoft.PowerShell.CoreConsoleHost\bin\Debug\netstandardapp1.5\win81-x64\publish" Write-Host -Foreground Green 'Run CoreCLR tests' $testResultsFile = "$pwd\TestsResults.xml" & ("$env:CoreOutput\powershell.exe") -c "Invoke-Pester test/powershell -OutputFormat NUnitXml -OutputFile $testResultsFile"