From 7a1197c2cc53d4fe0cc4494c39f81bac2f6d7fd7 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 14:30:30 -0700 Subject: [PATCH 01/13] remove existing configuration setting from existing csproj files --- ...soft.PowerShell.Commands.Diagnostics.csproj | 12 ------------ ...osoft.PowerShell.Commands.Management.csproj | 12 ------------ ...icrosoft.PowerShell.Commands.Utility.csproj | 12 ------------ .../Microsoft.PowerShell.ConsoleHost.csproj | 12 ------------ ...icrosoft.PowerShell.CoreCLR.Eventing.csproj | 16 ---------------- .../Microsoft.PowerShell.LocalAccounts.csproj | 16 ---------------- .../Microsoft.PowerShell.PSReadLine.csproj | 16 ---------------- .../Microsoft.PowerShell.Security.csproj | 18 +----------------- .../Microsoft.WSMan.Management.csproj | 12 ------------ .../Microsoft.WSMan.Runtime.csproj | 16 ---------------- .../System.Management.Automation.csproj | 12 ------------ src/TypeCatalogGen/TypeCatalogGen.csproj | 12 ------------ src/powershell-unix/powershell-unix.csproj | 18 +----------------- .../powershell-win-core.csproj | 16 ---------------- 14 files changed, 2 insertions(+), 198 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj index a0b008be9e5..a199fa7991c 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj @@ -27,16 +27,4 @@ - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index b8a6d8edee0..9589f3a801e 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -55,18 +55,6 @@ - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index ff63666025f..8a79920c556 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -64,18 +64,6 @@ - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj b/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj index cef829db680..4e2168c75cf 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj +++ b/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj @@ -24,16 +24,4 @@ - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index 32c1bbf75f7..fa8f0376cc9 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -6,22 +6,6 @@ Microsoft.PowerShell.CoreCLR.Eventing - - $(DefineConstants);CORECLR - - - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.csproj b/src/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.csproj index ebd69091ebe..7ee2b9dfbc5 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.csproj +++ b/src/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.csproj @@ -11,20 +11,4 @@ - - $(DefineConstants);CORECLR - - - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/Microsoft.PowerShell.PSReadLine/Microsoft.PowerShell.PSReadLine.csproj b/src/Microsoft.PowerShell.PSReadLine/Microsoft.PowerShell.PSReadLine.csproj index cd14d6c2faa..3f1c050577b 100644 --- a/src/Microsoft.PowerShell.PSReadLine/Microsoft.PowerShell.PSReadLine.csproj +++ b/src/Microsoft.PowerShell.PSReadLine/Microsoft.PowerShell.PSReadLine.csproj @@ -9,20 +9,4 @@ - - $(DefineConstants);CORECLR - - - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj b/src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj index cb9b17f03ba..c67d0b1ad76 100644 --- a/src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj +++ b/src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj @@ -10,27 +10,11 @@ - - $(DefineConstants);CORECLR - - - - - portable - - - - $(DefineConstants);UNIX - - - - full - - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 58ff26c0765..5a1d2de3c66 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -20,16 +20,4 @@ - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/Microsoft.WSMan.Runtime/Microsoft.WSMan.Runtime.csproj b/src/Microsoft.WSMan.Runtime/Microsoft.WSMan.Runtime.csproj index 0715bacb694..367ece5c078 100644 --- a/src/Microsoft.WSMan.Runtime/Microsoft.WSMan.Runtime.csproj +++ b/src/Microsoft.WSMan.Runtime/Microsoft.WSMan.Runtime.csproj @@ -5,20 +5,4 @@ Microsoft.WSMan.Runtime - - $(DefineConstants);CORECLR - - - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 692aa14f7d3..f6b91799015 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -128,16 +128,4 @@ - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/TypeCatalogGen/TypeCatalogGen.csproj b/src/TypeCatalogGen/TypeCatalogGen.csproj index 14ff5fe3840..d5aaa7462a9 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.csproj +++ b/src/TypeCatalogGen/TypeCatalogGen.csproj @@ -8,16 +8,4 @@ win7-x86;win7-x64;osx-x64;linux-x64 - - portable - - - - $(DefineConstants);UNIX - - - - full - - diff --git a/src/powershell-unix/powershell-unix.csproj b/src/powershell-unix/powershell-unix.csproj index 36e46f3fbfd..cb57cf457e9 100644 --- a/src/powershell-unix/powershell-unix.csproj +++ b/src/powershell-unix/powershell-unix.csproj @@ -34,20 +34,4 @@ - - $(DefineConstants);CORECLR - - - - portable - - - - $(DefineConstants);UNIX - - - - full - - - + diff --git a/src/powershell-win-core/powershell-win-core.csproj b/src/powershell-win-core/powershell-win-core.csproj index a8c64a425fd..3d2c5e0f2df 100644 --- a/src/powershell-win-core/powershell-win-core.csproj +++ b/src/powershell-win-core/powershell-win-core.csproj @@ -40,20 +40,4 @@ - - $(DefineConstants);CORECLR - - - - portable - - - - $(DefineConstants);UNIX - - - - full - - From d8e14df6a3e4c29231c371b43c7792653384f63a Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 14:31:15 -0700 Subject: [PATCH 02/13] In Travis-CI, test against release build. The same way we do on windows --- tools/travis.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 94b37d7fc07..2bf8fd80193 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -194,7 +194,7 @@ elseif($Stage -eq 'Build') $ProgressPreference = 'SilentlyContinue' try { ## We use CrossGen build to run tests only if it's the daily build. - Start-PSBuild -CrossGen -PSModuleRestore -CI -ReleaseTag $releaseTag + Start-PSBuild -CrossGen -PSModuleRestore -CI -ReleaseTag $releaseTag -Configuration 'Release' } finally{ $ProgressPreference = $originalProgressPreference @@ -285,7 +285,7 @@ elseif($Stage -eq 'Build') if ($IsLinux) { # Create and package Raspbian .tgz - Start-PSBuild -PSModuleRestore -Clean -Runtime linux-arm + Start-PSBuild -PSModuleRestore -Clean -Runtime linux-arm -Configuration 'Release' Start-PSPackage @packageParams -Type tar-arm -SkipReleaseChecks } } From c03d1dc4e9b25a86778a173ab7d5c24ba93c3c9c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 14:31:30 -0700 Subject: [PATCH 03/13] build release for mac --- tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 b/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 index f5b74843397..bd1fdc6e45d 100644 --- a/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 +++ b/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 @@ -64,7 +64,7 @@ try { } if ($Build.IsPresent) { - Start-PSBuild -Crossgen -PSModuleRestore @releaseTagParam + Start-PSBuild -Configuration 'Release' -Crossgen -PSModuleRestore @releaseTagParam Start-PSPackage @releaseTagParam switch ($ExtraPackage) { From e61d9ca6ebbd4ff9902400447b90457b7757df5e Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 14:31:49 -0700 Subject: [PATCH 04/13] build release for linux --- .../Images/GenericLinuxFiles/PowerShellPackage.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index c736338c4ba..f206747ac16 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -33,7 +33,7 @@ try { Import-Module "$location/tools/packaging" Start-PSBootstrap -Package -NoSudo - Start-PSBuild -Crossgen -PSModuleRestore @releaseTagParam + Start-PSBuild -Configuration Release -Crossgen -PSModuleRestore @releaseTagParam Start-PSPackage @releaseTagParam if ($AppImage) { Start-PSPackage -Type AppImage @releaseTagParam } @@ -42,7 +42,7 @@ try { if ($TarArm) { ## Build 'linux-arm' and create 'tar.gz' package for it. ## Note that 'linux-arm' can only be built on Ubuntu environment. - Start-PSBuild -Restore -Runtime linux-arm -PSModuleRestore @releaseTagParam + Start-PSBuild -Configuration Release -Restore -Runtime linux-arm -PSModuleRestore @releaseTagParam Start-PSPackage -Type tar-arm @releaseTagParam } } From 96b5e504d455b8d28bd31ac3a8ca57372dee85a6 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 14:29:17 -0700 Subject: [PATCH 05/13] Create two common configuration across all platforms, release and debug Plus CodeCoverage for windows --- PowerShell.Common.props | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 14331f30616..9e0a6dc6185 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -108,4 +108,31 @@ true + + $(DefineConstants);CORECLR + + + + $(DefineConstants);UNIX + + + + portable + + + + true + + + + full + + + + portable + + + + full + From 50b3fbdbcffd92ce26b13d117758adfcf8d94351 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 14:35:21 -0700 Subject: [PATCH 06/13] Replace the configuration Linux with debug (unless release was specified) in build.psm1 --- build.psm1 | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/build.psm1 b/build.psm1 index b6dba8d0b23..2e6e1c7c987 100644 --- a/build.psm1 +++ b/build.psm1 @@ -410,7 +410,7 @@ function Start-PSBuild { "win-arm64")] [string]$Runtime, - [ValidateSet('Linux', 'Debug', 'Release', 'CodeCoverage', '')] # We might need "Checked" as well + [ValidateSet('Debug', 'Release', 'CodeCoverage', '')] # We might need "Checked" as well [string]$Configuration, [switch]$CrossGen, @@ -704,7 +704,7 @@ function Compress-TestContent { function New-PSOptions { [CmdletBinding()] param( - [ValidateSet("Linux", "Debug", "Release", "CodeCoverage", "")] + [ValidateSet("Debug", "Release", "CodeCoverage", '')] [string]$Configuration, [ValidateSet("netcoreapp2.1")] @@ -736,28 +736,12 @@ function New-PSOptions { $ConfigWarningMsg = "The passed-in Configuration value '{0}' is not supported on '{1}'. Use '{2}' instead." if (-not $Configuration) { - $Configuration = if ($Environment.IsLinux -or $Environment.IsMacOS) { - "Linux" - } elseif ($Environment.IsWindows) { - "Debug" - } + $Configuration = 'Debug' } else { switch ($Configuration) { - "Linux" { - if ($Environment.IsWindows) { - $Configuration = "Debug" - Write-Warning ($ConfigWarningMsg -f $switch.Current, "Windows", $Configuration) - } - } "CodeCoverage" { if(-not $Environment.IsWindows) { - $Configuration = "Linux" - Write-Warning ($ConfigWarningMsg -f $switch.Current, $Environment.LinuxInfo.PRETTY_NAME, $Configuration) - } - } - Default { - if ($Environment.IsLinux -or $Environment.IsMacOS) { - $Configuration = "Linux" + $Configuration = "Debug" Write-Warning ($ConfigWarningMsg -f $switch.Current, $Environment.LinuxInfo.PRETTY_NAME, $Configuration) } } @@ -765,7 +749,7 @@ function New-PSOptions { } Write-Verbose "Using configuration '$Configuration'" - $PowerShellDir = if ($Configuration -eq 'Linux') { + $PowerShellDir = if ($Environment.IsLinux -or $Environment.IsMacOS) { "powershell-unix" } else { "powershell-win-core" From 6887465655c7e96c89cd4682b8d4775bf2ca1074 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 15:04:20 -0700 Subject: [PATCH 07/13] Add IsWindows property --- PowerShell.Common.props | 1 + 1 file changed, 1 insertion(+) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 9e0a6dc6185..dccd8845362 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -110,6 +110,7 @@ $(DefineConstants);CORECLR + true From 5bc4d817e0df53c30b34552c68be6651443c2866 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 15:09:29 -0700 Subject: [PATCH 08/13] fix logic error and add comments --- PowerShell.Common.props | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index dccd8845362..7d41b47271a 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -113,26 +113,32 @@ true + $(DefineConstants);UNIX + portable + true + full - + + portable + full From b91f72c5489db6ede42730224b584c79bac2d538 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 15:28:05 -0700 Subject: [PATCH 09/13] fix typo --- PowerShell.Common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 7d41b47271a..065ad10ba22 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -133,7 +133,7 @@ full - + portable From a95f4724e87ba4bd5ce7a05a7ee9d1fb4fb559e2 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 15:28:17 -0700 Subject: [PATCH 10/13] simplify logic --- build.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 2e6e1c7c987..d0a185619d1 100644 --- a/build.psm1 +++ b/build.psm1 @@ -749,7 +749,7 @@ function New-PSOptions { } Write-Verbose "Using configuration '$Configuration'" - $PowerShellDir = if ($Environment.IsLinux -or $Environment.IsMacOS) { + $PowerShellDir = if (!$Environment.IsWindows) { "powershell-unix" } else { "powershell-win-core" From 5a63ec7e5dbc2d98e67f2e3ae8f84843a5cd317b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 17:24:56 -0700 Subject: [PATCH 11/13] get the output path based on what we built --- tools/travis.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 2bf8fd80193..e11c63e8131 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -188,7 +188,6 @@ elseif($Stage -eq 'Build') $releaseTag = Get-ReleaseTag Write-Host -Foreground Green "Executing travis.ps1 `$isPR='$isPr' `$isFullBuild='$isFullBuild' - $commitMessage" - $output = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions)) $originalProgressPreference = $ProgressPreference $ProgressPreference = 'SilentlyContinue' @@ -200,6 +199,8 @@ elseif($Stage -eq 'Build') $ProgressPreference = $originalProgressPreference } + $output = Split-Path -Parent (Get-PSOutput -Options (Get-PSOptions)) + $testResultsNoSudo = "$pwd/TestResultsNoSudo.xml" $testResultsSudo = "$pwd/TestResultsSudo.xml" From 6a3b381f746bd4b4655f3fbad063dfe497748c7b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 17:26:29 -0700 Subject: [PATCH 12/13] when running xunit tests get the options from the last build --- build.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index d0a185619d1..45a17e81e22 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1444,7 +1444,7 @@ function Start-PSxUnit { if((Test-Path $requiredDependencies) -notcontains $false) { - $options = New-PSOptions + $options = Get-PSOptions -DefaultToNew $Destination = "bin/$($options.configuration)/$($options.framework)" New-Item $Destination -ItemType Directory -Force > $null Copy-Item -Path $requiredDependencies -Destination $Destination -Force From 81c795cd5a45003e1b4a7d0b0e923054eb50ff78 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 10 May 2018 19:41:20 -0700 Subject: [PATCH 13/13] Only optimize release for windows --- PowerShell.Common.props | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 065ad10ba22..4caacf688eb 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -130,11 +130,16 @@ + true full + + false portable