From f32cb8ee7d2efb8f13698769cf836851bd01f90d Mon Sep 17 00:00:00 2001 From: Ilya Date: Mon, 27 Apr 2020 22:44:43 +0500 Subject: [PATCH 1/2] Use new TFM net5.0. Step 2 --- PowerShell.Common.props | 2 +- test/tools/OpenCover/OpenCover.psm1 | 4 ++-- tools/packaging/packaging.psm1 | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index ddf96a5b71e..177eef87842 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -95,7 +95,7 @@ Microsoft Corporation (c) Microsoft Corporation. All rights reserved. - netcoreapp5.0 + net5.0 8.0 true diff --git a/test/tools/OpenCover/OpenCover.psm1 b/test/tools/OpenCover/OpenCover.psm1 index 4d82418fd63..748e0d1b853 100644 --- a/test/tools/OpenCover/OpenCover.psm1 +++ b/test/tools/OpenCover/OpenCover.psm1 @@ -615,7 +615,7 @@ function Install-OpenCover .Description Invoke-OpenCover runs tests under OpenCover by executing tests on PowerShell located at $PowerShellExeDirectory. .EXAMPLE - Invoke-OpenCover -TestPath $PWD/test/powershell -PowerShellExeDirectory $PWD/src/powershell-win-core/bin/CodeCoverage/netcoreapp5.0/win7-x64 + Invoke-OpenCover -TestPath $PWD/test/powershell -PowerShellExeDirectory $PWD/src/powershell-win-core/bin/CodeCoverage/net5.0/win7-x64 #> function Invoke-OpenCover { @@ -624,7 +624,7 @@ function Invoke-OpenCover [parameter()]$OutputLog = "$HOME/Documents/OpenCover.xml", [parameter()]$TestPath = "${script:psRepoPath}/test/powershell", [parameter()]$OpenCoverPath = "$HOME/OpenCover", - [parameter()]$PowerShellExeDirectory = "${script:psRepoPath}/src/powershell-win-core/bin/CodeCoverage/netcoreapp5.0/win7-x64/publish", + [parameter()]$PowerShellExeDirectory = "${script:psRepoPath}/src/powershell-win-core/bin/CodeCoverage/net5.0/win7-x64/publish", [parameter()]$PesterLogElevated = "$HOME/Documents/TestResultsElevated.xml", [parameter()]$PesterLogUnelevated = "$HOME/Documents/TestResultsUnelevated.xml", [parameter()]$PesterLogFormat = "NUnitXml", diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 052980e607a..db3c99e6877 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1719,7 +1719,7 @@ function CreateNugetPlatformFolder [string] $PlatformBinPath ) - $destPath = New-Item -ItemType Directory -Path (Join-Path $PackageRuntimesFolder "$Platform/lib/netcoreapp5.0") + $destPath = New-Item -ItemType Directory -Path (Join-Path $PackageRuntimesFolder "$Platform/lib/net5.0") $fullPath = Join-Path $PlatformBinPath $file if (-not(Test-Path $fullPath)) { @@ -1819,7 +1819,7 @@ function New-ILNugetPackage $packageRuntimesFolder = New-Item (Join-Path $filePackageFolder.FullName 'runtimes') -ItemType Directory #region ref - $refFolder = New-Item (Join-Path $filePackageFolder.FullName 'ref/netcoreapp5.0') -ItemType Directory -Force + $refFolder = New-Item (Join-Path $filePackageFolder.FullName 'ref/net5.0') -ItemType Directory -Force CopyReferenceAssemblies -assemblyName $fileBaseName -refBinPath $refBinPath -refNugetPath $refFolder -assemblyFileList $fileList #endregion ref @@ -1863,8 +1863,8 @@ function New-ILNugetPackage "Microsoft.PowerShell.Utility" ) - $winModuleFolder = New-Item (Join-Path $contentFolder "runtimes\win\lib\netcoreapp5.0\Modules") -ItemType Directory -Force - $unixModuleFolder = New-Item (Join-Path $contentFolder "runtimes\unix\lib\netcoreapp5.0\Modules") -ItemType Directory -Force + $winModuleFolder = New-Item (Join-Path $contentFolder "runtimes\win\lib\net5.0\Modules") -ItemType Directory -Force + $unixModuleFolder = New-Item (Join-Path $contentFolder "runtimes\unix\lib\net5.0\Modules") -ItemType Directory -Force foreach ($module in $winBuiltInModules) { $source = Join-Path $WinFxdBinPath "Modules\$module" @@ -1991,7 +1991,7 @@ function New-ILNugetPackage } <# - Copy the generated reference assemblies to the 'ref/netcoreapp5.0' folder properly. + Copy the generated reference assemblies to the 'ref/net5.0' folder properly. This is a helper function used by 'New-ILNugetPackage' #> function CopyReferenceAssemblies @@ -2234,7 +2234,7 @@ function New-ReferenceAssembly Write-Log "Running: dotnet $arguments" Start-NativeExecution -sb {dotnet $arguments} - $refBinPath = Join-Path $projectFolder "bin/Release/netcoreapp5.0/$assemblyName.dll" + $refBinPath = Join-Path $projectFolder "bin/Release/net5.0/$assemblyName.dll" if ($null -eq $refBinPath) { throw "Reference assembly was not built." } @@ -2886,7 +2886,7 @@ function New-MSIPatch # This example shows how to produce a Debug-x64 installer for development purposes. cd $RootPathOfPowerShellRepo Import-Module .\build.psm1; Import-Module .\tools\packaging\packaging.psm1 - New-MSIPackage -Verbose -ProductCode (New-Guid) -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' + New-MSIPackage -Verbose -ProductCode (New-Guid) -ProductSourcePath '.\src\powershell-win-core\bin\Debug\net5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' #> function New-MSIPackage { @@ -3088,7 +3088,7 @@ function New-MSIPackage # This example shows how to produce a Debug-x64 installer for development purposes. cd $RootPathOfPowerShellRepo Import-Module .\build.psm1; Import-Module .\tools\packaging\packaging.psm1 - New-MSIXPackage -Verbose -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' + New-MSIXPackage -Verbose -ProductSourcePath '.\src\powershell-win-core\bin\Debug\net5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' #> function New-MSIXPackage { @@ -3678,7 +3678,7 @@ function New-GlobalToolNupkg } $packageInfo | ForEach-Object { - $ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/netcoreapp5.0/any") -ItemType Directory + $ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/net5.0/any") -ItemType Directory $packageType = $_.Type From 9550251dd17cfca3f8aa1966203d164148ae3cce Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 27 Apr 2020 12:09:27 -0700 Subject: [PATCH 2/2] Use variable for netcore runtime folder name --- tools/packaging/packaging.psm1 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index db3c99e6877..776814a8e11 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -8,6 +8,7 @@ $packagingStrings = Import-PowerShellDataFile "$PSScriptRoot\packaging.strings.p Import-Module "$PSScriptRoot\..\Xml" -ErrorAction Stop -Force $DebianDistributions = @("ubuntu.16.04", "ubuntu.18.04", "debian.9", "debian.10", "debian.11") $RedhatDistributions = @("rhel.7","centos.8") +$script:netCoreRuntime = 'net5.0' function Start-PSPackage { [CmdletBinding(DefaultParameterSetName='Version',SupportsShouldProcess=$true)] @@ -131,14 +132,14 @@ function Start-PSPackage { -not $Script:Options -or ## Start-PSBuild hasn't been executed yet -not $PSModuleRestoreCorrect -or ## Last build didn't specify '-PSModuleRestore' correctly $Script:Options.Configuration -ne $Configuration -or ## Last build was with configuration other than 'Release' - $Script:Options.Framework -ne "net5.0" ## Last build wasn't for CoreCLR + $Script:Options.Framework -ne $script:netCoreRuntime ## Last build wasn't for CoreCLR } else { -not $Script:Options -or ## Start-PSBuild hasn't been executed yet -not $crossGenCorrect -or ## Last build didn't specify '-CrossGen' correctly -not $PSModuleRestoreCorrect -or ## Last build didn't specify '-PSModuleRestore' correctly $Script:Options.Runtime -ne $Runtime -or ## Last build wasn't for the required RID $Script:Options.Configuration -ne $Configuration -or ## Last build was with configuration other than 'Release' - $Script:Options.Framework -ne "net5.0" ## Last build wasn't for CoreCLR + $Script:Options.Framework -ne $script:netCoreRuntime ## Last build wasn't for CoreCLR } # Make sure the most recent build satisfies the package requirement @@ -1719,7 +1720,7 @@ function CreateNugetPlatformFolder [string] $PlatformBinPath ) - $destPath = New-Item -ItemType Directory -Path (Join-Path $PackageRuntimesFolder "$Platform/lib/net5.0") + $destPath = New-Item -ItemType Directory -Path (Join-Path $PackageRuntimesFolder "$Platform/lib/$script:netCoreRuntime") $fullPath = Join-Path $PlatformBinPath $file if (-not(Test-Path $fullPath)) { @@ -1819,7 +1820,7 @@ function New-ILNugetPackage $packageRuntimesFolder = New-Item (Join-Path $filePackageFolder.FullName 'runtimes') -ItemType Directory #region ref - $refFolder = New-Item (Join-Path $filePackageFolder.FullName 'ref/net5.0') -ItemType Directory -Force + $refFolder = New-Item (Join-Path $filePackageFolder.FullName 'ref/$script:netCoreRuntime') -ItemType Directory -Force CopyReferenceAssemblies -assemblyName $fileBaseName -refBinPath $refBinPath -refNugetPath $refFolder -assemblyFileList $fileList #endregion ref @@ -1863,8 +1864,8 @@ function New-ILNugetPackage "Microsoft.PowerShell.Utility" ) - $winModuleFolder = New-Item (Join-Path $contentFolder "runtimes\win\lib\net5.0\Modules") -ItemType Directory -Force - $unixModuleFolder = New-Item (Join-Path $contentFolder "runtimes\unix\lib\net5.0\Modules") -ItemType Directory -Force + $winModuleFolder = New-Item (Join-Path $contentFolder "runtimes\win\lib\$script:netCoreRuntime\Modules") -ItemType Directory -Force + $unixModuleFolder = New-Item (Join-Path $contentFolder "runtimes\unix\lib\$script:netCoreRuntime\Modules") -ItemType Directory -Force foreach ($module in $winBuiltInModules) { $source = Join-Path $WinFxdBinPath "Modules\$module" @@ -2234,7 +2235,7 @@ function New-ReferenceAssembly Write-Log "Running: dotnet $arguments" Start-NativeExecution -sb {dotnet $arguments} - $refBinPath = Join-Path $projectFolder "bin/Release/net5.0/$assemblyName.dll" + $refBinPath = Join-Path $projectFolder "bin/Release/$script:netCoreRuntime/$assemblyName.dll" if ($null -eq $refBinPath) { throw "Reference assembly was not built." } @@ -3678,7 +3679,7 @@ function New-GlobalToolNupkg } $packageInfo | ForEach-Object { - $ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/net5.0/any") -ItemType Directory + $ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/$script:netCoreRuntime/any") -ItemType Directory $packageType = $_.Type