diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 14331f30616..4caacf688eb 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -108,4 +108,43 @@ true + + $(DefineConstants);CORECLR + true + + + + + $(DefineConstants);UNIX + + + + + portable + + + + + true + + + + + true + full + + + + + + false + portable + + + + + full + diff --git a/build.psm1 b/build.psm1 index b6dba8d0b23..45a17e81e22 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.IsWindows) { "powershell-unix" } else { "powershell-win-core" @@ -1460,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 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 - - 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 } } 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) { diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 94b37d7fc07..e11c63e8131 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -188,18 +188,19 @@ 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' 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 } + $output = Split-Path -Parent (Get-PSOutput -Options (Get-PSOptions)) + $testResultsNoSudo = "$pwd/TestResultsNoSudo.xml" $testResultsSudo = "$pwd/TestResultsSudo.xml" @@ -285,7 +286,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 } }