From 6d412f5196ee85cfa16092f6c7291f4f6c6832f7 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 15 Aug 2017 11:58:07 -0700 Subject: [PATCH 1/6] Create one package for windows Changes to packaging.psm1 to create a single package to work on all versions of Windows. The runtime used is win7-x86/x64. The package that is created has a name suffix win-x64 or win-x86 to signify it works on any version on Windows. --- docs/maintainers/releasing.md | 17 ++++++----------- tools/packaging/packaging.psm1 | 23 +++++++---------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/docs/maintainers/releasing.md b/docs/maintainers/releasing.md index 280e8d7b376..e5e76e68729 100644 --- a/docs/maintainers/releasing.md +++ b/docs/maintainers/releasing.md @@ -160,20 +160,15 @@ On Windows, the `-Runtime` parameter should be specified for `Start-PSBuild` to # Install dependencies Start-PSBootstrap -Package -# Build for v6.0.0-beta.1 release targeting Windows 10 and Server 2016 -Start-PSBuild -Clean -CrossGen -PSModuleRestore -Runtime win10-x64 -Configuration Release -ReleaseTag v6.0.0-beta.1 +# Build for v6.0.0-beta.1 release targeting Windows universal package, set ```-Runtime``` to ```win7-x64``` +Start-PSBuild -Clean -CrossGen -PSModuleRestore -Runtime win7-x64 -Configuration Release -ReleaseTag v6.0.0-beta.1 ``` -If the package is targeting a downlevel Windows (not Windows 10 or Server 2016), -the `-WindowsDownLevel` parameter should be specified for `Start-PSPackage`. -Otherwise, the `-WindowsDownLevel` parameter should be left out. - ```powershell -# Create packages for v6.0.0-beta.1 release targeting Windows 10 and Server 2016. -# When creating packages for downlevel Windows, such as Windows 8.1 or Server 2012R2, -# the parameter '-WindowsDownLevel' must be specified. -Start-PSPackage -Type msi -ReleaseTag v6.0.0-beta.1 <# -WindowsDownLevel win81-x64 #> -Start-PSPackage -Type zip -ReleaseTag v6.0.0-beta.1 <# -WindowsDownLevel win81-x64 #> +# Create packages for v6.0.0-beta.1 release targeting Windows universal package. +# 'win7-x64' / 'win7-x86' will be used as the runtime. +Start-PSPackage -Type msi -ReleaseTag v6.0.0-beta.1 +Start-PSPackage -Type zip -ReleaseTag v6.0.0-beta.1 ``` ## NuGet Packages diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 7a7e193bca2..3e3dc92f477 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -22,11 +22,6 @@ function Start-PSPackage { [ValidateSet("deb", "osxpkg", "rpm", "msi", "zip", "AppImage", "nupkg")] [string[]]$Type, - # Generate windows downlevel package - [ValidateSet("win81-x64", "win7-x86", "win7-x64")] - [ValidateScript({$Environment.IsWindows})] - [string]$WindowsDownLevel, - [Switch] $Force, [Switch] $IncludeSymbols, @@ -35,11 +30,13 @@ function Start-PSPackage { ) # Runtime and Configuration settings required by the package - ($Runtime, $Configuration) = if ($WindowsDownLevel) { - $WindowsDownLevel, "Release" - } else { - New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + ($Runtime, $Configuration) = New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + + # We convert the runtime to win7-x64 or win7-x86 to build the universal windows package. + if($Environment.IsWindows) { + $Runtime = $Runtime -replace "win\d+", "win7" } + log "Packaging RID: '$Runtime'; Packaging Configuration: '$Configuration'" $Script:Options = Get-PSOptions @@ -121,13 +118,7 @@ function Start-PSPackage { # Build the name suffix for win-plat packages if ($Environment.IsWindows) { - # Add the server name to the $RunTime. $runtime produced by dotnet is same for client or server - switch ($Runtime) { - 'win81-x64' {$NameSuffix = 'win81-win2012r2-x64'} - 'win10-x64' {$NameSuffix = 'win10-win2016-x64'} - 'win7-x64' {$NameSuffix = 'win7-win2008r2-x64'} - Default {$NameSuffix = $Runtime} - } + $NameSuffix = $Runtime -replace 'win\d+', 'win' } # Add the symbols to the suffix From 0e690d31d45acca6fe40236bac15d1f2bab04b39 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 15 Aug 2017 17:28:53 -0700 Subject: [PATCH 2/6] Fix spellings --- .spelling | 1 + 1 file changed, 1 insertion(+) diff --git a/.spelling b/.spelling index 8fbd0529464..13831f182fd 100644 --- a/.spelling +++ b/.spelling @@ -353,6 +353,7 @@ Ronn Toolset v6 WiX +Runtimewin7-x64 - docs/testing-guidelines/PowerShellCoreTestStatus.md Add-LocalGroupMember add-on From 0b5be2b3e8ff2fd654082601abb09a0dbebc73c1 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 16 Aug 2017 00:01:35 -0700 Subject: [PATCH 3/6] Fix typo in releasing.md and remove it from .spellings file --- .spelling | 1 - docs/maintainers/releasing.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.spelling b/.spelling index 13831f182fd..8fbd0529464 100644 --- a/.spelling +++ b/.spelling @@ -353,7 +353,6 @@ Ronn Toolset v6 WiX -Runtimewin7-x64 - docs/testing-guidelines/PowerShellCoreTestStatus.md Add-LocalGroupMember add-on diff --git a/docs/maintainers/releasing.md b/docs/maintainers/releasing.md index e5e76e68729..42db295c3ed 100644 --- a/docs/maintainers/releasing.md +++ b/docs/maintainers/releasing.md @@ -160,7 +160,7 @@ On Windows, the `-Runtime` parameter should be specified for `Start-PSBuild` to # Install dependencies Start-PSBootstrap -Package -# Build for v6.0.0-beta.1 release targeting Windows universal package, set ```-Runtime``` to ```win7-x64``` +# Build for v6.0.0-beta.1 release targeting Windows universal package, set -Runtime to win7-x64 Start-PSBuild -Clean -CrossGen -PSModuleRestore -Runtime win7-x64 -Configuration Release -ReleaseTag v6.0.0-beta.1 ``` From fce18d940cf2d0b063e0831c5d10eec3c9c64abb Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 16 Aug 2017 00:09:50 -0700 Subject: [PATCH 4/6] Addressed CR feedback --- tools/packaging/packaging.psm1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 3e3dc92f477..a1dd7129496 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -35,6 +35,9 @@ function Start-PSPackage { # We convert the runtime to win7-x64 or win7-x86 to build the universal windows package. if($Environment.IsWindows) { $Runtime = $Runtime -replace "win\d+", "win7" + + # Build the name suffix for win-plat packages + $NameSuffix = $Runtime -replace 'win\d+', 'win' } log "Packaging RID: '$Runtime'; Packaging Configuration: '$Configuration'" @@ -116,11 +119,6 @@ function Start-PSPackage { } log "Packaging Type: $Type" - # Build the name suffix for win-plat packages - if ($Environment.IsWindows) { - $NameSuffix = $Runtime -replace 'win\d+', 'win' - } - # Add the symbols to the suffix # if symbols are specified to be included if($IncludeSymbols.IsPresent -and $NameSuffix) { From fae14a74f180012cbc15e449bf4222112c659d7d Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 16 Aug 2017 14:25:36 -0700 Subject: [PATCH 5/6] Re-add -WindowsRuntime parameter --- tools/packaging/packaging.psm1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index a1dd7129496..01942008d64 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -22,6 +22,11 @@ function Start-PSPackage { [ValidateSet("deb", "osxpkg", "rpm", "msi", "zip", "AppImage", "nupkg")] [string[]]$Type, + # Generate windows downlevel package + [ValidateSet("win7-x86", "win7-x64")] + [ValidateScript({$Environment.IsWindows})] + [string]$WindowsRuntime, + [Switch] $Force, [Switch] $IncludeSymbols, @@ -30,7 +35,11 @@ function Start-PSPackage { ) # Runtime and Configuration settings required by the package - ($Runtime, $Configuration) = New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + ($Runtime, $Configuration) = if ($WindowsRuntime) { + $WindowsRuntime, "Release" + } else { + New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + } # We convert the runtime to win7-x64 or win7-x86 to build the universal windows package. if($Environment.IsWindows) { From a838db622ac20fed518048d5289e03ade94cb1dd Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 16 Aug 2017 14:34:52 -0700 Subject: [PATCH 6/6] Fixed releasing.md --- docs/maintainers/releasing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/maintainers/releasing.md b/docs/maintainers/releasing.md index 42db295c3ed..5502d3dcb6d 100644 --- a/docs/maintainers/releasing.md +++ b/docs/maintainers/releasing.md @@ -165,10 +165,10 @@ Start-PSBuild -Clean -CrossGen -PSModuleRestore -Runtime win7-x64 -Configuration ``` ```powershell -# Create packages for v6.0.0-beta.1 release targeting Windows universal package. -# 'win7-x64' / 'win7-x86' will be used as the runtime. -Start-PSPackage -Type msi -ReleaseTag v6.0.0-beta.1 -Start-PSPackage -Type zip -ReleaseTag v6.0.0-beta.1 +# Create packages for v6.0.0-beta.1 release targeting Windows universal package. +# 'win7-x64' / 'win7-x86' should be used for -WindowsRuntime. +Start-PSPackage -Type msi -ReleaseTag v6.0.0-beta.1 -WindowsRuntime 'win7-x64' +Start-PSPackage -Type zip -ReleaseTag v6.0.0-beta.1 -WindowsRuntime 'win7-x64' ``` ## NuGet Packages