@@ -8,6 +8,7 @@ $packagingStrings = Import-PowerShellDataFile "$PSScriptRoot\packaging.strings.p
88Import-Module " $PSScriptRoot \..\Xml" - ErrorAction Stop - Force
99$DebianDistributions = @ (" ubuntu.16.04" , " ubuntu.18.04" , " debian.9" , " debian.10" , " debian.11" )
1010$RedhatDistributions = @ (" rhel.7" , " centos.8" )
11+ $script :netCoreRuntime = ' net5.0'
1112
1213function Start-PSPackage {
1314 [CmdletBinding (DefaultParameterSetName = ' Version' , SupportsShouldProcess = $true )]
@@ -131,14 +132,14 @@ function Start-PSPackage {
131132 -not $Script :Options -or # # Start-PSBuild hasn't been executed yet
132133 -not $PSModuleRestoreCorrect -or # # Last build didn't specify '-PSModuleRestore' correctly
133134 $Script :Options.Configuration -ne $Configuration -or # # Last build was with configuration other than 'Release'
134- $Script :Options.Framework -ne " net5.0 " # # Last build wasn't for CoreCLR
135+ $Script :Options.Framework -ne $ script :netCoreRuntime # # Last build wasn't for CoreCLR
135136 } else {
136137 -not $Script :Options -or # # Start-PSBuild hasn't been executed yet
137138 -not $crossGenCorrect -or # # Last build didn't specify '-CrossGen' correctly
138139 -not $PSModuleRestoreCorrect -or # # Last build didn't specify '-PSModuleRestore' correctly
139140 $Script :Options.Runtime -ne $Runtime -or # # Last build wasn't for the required RID
140141 $Script :Options.Configuration -ne $Configuration -or # # Last build was with configuration other than 'Release'
141- $Script :Options.Framework -ne " net5.0 " # # Last build wasn't for CoreCLR
142+ $Script :Options.Framework -ne $ script :netCoreRuntime # # Last build wasn't for CoreCLR
142143 }
143144
144145 # Make sure the most recent build satisfies the package requirement
@@ -1719,7 +1720,7 @@ function CreateNugetPlatformFolder
17191720 [string ] $PlatformBinPath
17201721 )
17211722
1722- $destPath = New-Item - ItemType Directory - Path (Join-Path $PackageRuntimesFolder " $Platform /lib/netcoreapp5.0 " )
1723+ $destPath = New-Item - ItemType Directory - Path (Join-Path $PackageRuntimesFolder " $Platform /lib/$ script :netCoreRuntime " )
17231724 $fullPath = Join-Path $PlatformBinPath $file
17241725
17251726 if (-not (Test-Path $fullPath )) {
@@ -1819,7 +1820,7 @@ function New-ILNugetPackage
18191820 $packageRuntimesFolder = New-Item (Join-Path $filePackageFolder.FullName ' runtimes' ) - ItemType Directory
18201821
18211822 # region ref
1822- $refFolder = New-Item (Join-Path $filePackageFolder.FullName ' ref/netcoreapp5.0 ' ) - ItemType Directory - Force
1823+ $refFolder = New-Item (Join-Path $filePackageFolder.FullName ' ref/$script:netCoreRuntime ' ) - ItemType Directory - Force
18231824 CopyReferenceAssemblies - assemblyName $fileBaseName - refBinPath $refBinPath - refNugetPath $refFolder - assemblyFileList $fileList
18241825 # endregion ref
18251826
@@ -1863,8 +1864,8 @@ function New-ILNugetPackage
18631864 " Microsoft.PowerShell.Utility"
18641865 )
18651866
1866- $winModuleFolder = New-Item (Join-Path $contentFolder " runtimes\win\lib\netcoreapp5.0 \Modules" ) - ItemType Directory - Force
1867- $unixModuleFolder = New-Item (Join-Path $contentFolder " runtimes\unix\lib\netcoreapp5.0 \Modules" ) - ItemType Directory - Force
1867+ $winModuleFolder = New-Item (Join-Path $contentFolder " runtimes\win\lib\$ script :netCoreRuntime \Modules" ) - ItemType Directory - Force
1868+ $unixModuleFolder = New-Item (Join-Path $contentFolder " runtimes\unix\lib\$ script :netCoreRuntime \Modules" ) - ItemType Directory - Force
18681869
18691870 foreach ($module in $winBuiltInModules ) {
18701871 $source = Join-Path $WinFxdBinPath " Modules\$module "
@@ -1991,7 +1992,7 @@ function New-ILNugetPackage
19911992}
19921993
19931994<#
1994- Copy the generated reference assemblies to the 'ref/netcoreapp5 .0' folder properly.
1995+ Copy the generated reference assemblies to the 'ref/net5 .0' folder properly.
19951996 This is a helper function used by 'New-ILNugetPackage'
19961997#>
19971998function CopyReferenceAssemblies
@@ -2234,7 +2235,7 @@ function New-ReferenceAssembly
22342235 Write-Log " Running: dotnet $arguments "
22352236 Start-NativeExecution - sb {dotnet $arguments }
22362237
2237- $refBinPath = Join-Path $projectFolder " bin/Release/netcoreapp5.0 /$assemblyName .dll"
2238+ $refBinPath = Join-Path $projectFolder " bin/Release/$ script :netCoreRuntime /$assemblyName .dll"
22382239 if ($null -eq $refBinPath ) {
22392240 throw " Reference assembly was not built."
22402241 }
@@ -2886,7 +2887,7 @@ function New-MSIPatch
28862887 # This example shows how to produce a Debug-x64 installer for development purposes.
28872888 cd $RootPathOfPowerShellRepo
28882889 Import-Module .\build.psm1; Import-Module .\tools\packaging\packaging.psm1
2889- New-MSIPackage -Verbose -ProductCode (New-Guid) -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp5 .0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3'
2890+ New-MSIPackage -Verbose -ProductCode (New-Guid) -ProductSourcePath '.\src\powershell-win-core\bin\Debug\net5 .0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3'
28902891#>
28912892function New-MSIPackage
28922893{
@@ -3088,7 +3089,7 @@ function New-MSIPackage
30883089 # This example shows how to produce a Debug-x64 installer for development purposes.
30893090 cd $RootPathOfPowerShellRepo
30903091 Import-Module .\build.psm1; Import-Module .\tools\packaging\packaging.psm1
3091- New-MSIXPackage -Verbose -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp5 .0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3'
3092+ New-MSIXPackage -Verbose -ProductSourcePath '.\src\powershell-win-core\bin\Debug\net5 .0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3'
30923093#>
30933094function New-MSIXPackage
30943095{
@@ -3678,7 +3679,7 @@ function New-GlobalToolNupkg
36783679 }
36793680
36803681 $packageInfo | ForEach-Object {
3681- $ridFolder = New-Item - Path (Join-Path $_.RootFolder " tools/netcoreapp5.0 /any" ) - ItemType Directory
3682+ $ridFolder = New-Item - Path (Join-Path $_.RootFolder " tools/$ script :netCoreRuntime /any" ) - ItemType Directory
36823683
36833684 $packageType = $_.Type
36843685
0 commit comments