Skip to content

Drop support for end-of-life PowerShell 7.0 and 7.1 #1967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .vsts-ci/templates/ci-general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ steps:
version: 6.0.x
performMultiLevelLookup: true

- task: UseDotNet@2
displayName: Install .NET 3.1.x runtime
inputs:
packageType: runtime
version: 3.1.x
performMultiLevelLookup: true

- task: PowerShell@2
displayName: Build
inputs:
Expand Down
20 changes: 4 additions & 16 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,13 @@ $script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerSh
$script:PsesCommonProps = [xml](Get-Content -Raw "$PSScriptRoot/PowerShellEditorServices.Common.props")

$script:NetRuntime = @{
PS7 = 'netcoreapp3.1'
PS72 = 'net6.0'
PS73 = 'net7.0'
Desktop = 'net462'
Standard = 'netstandard2.0'
}

$script:HostCoreOutput = "$PSScriptRoot/src/PowerShellEditorServices.Hosting/bin/$Configuration/$($script:NetRuntime.PS7)/publish"
$script:HostCoreOutput = "$PSScriptRoot/src/PowerShellEditorServices.Hosting/bin/$Configuration/$($script:NetRuntime.PS72)/publish"
$script:HostDeskOutput = "$PSScriptRoot/src/PowerShellEditorServices.Hosting/bin/$Configuration/$($script:NetRuntime.Desktop)/publish"
$script:PsesOutput = "$PSScriptRoot/src/PowerShellEditorServices/bin/$Configuration/$($script:NetRuntime.Standard)/publish"
$script:VSCodeOutput = "$PSScriptRoot/src/PowerShellEditorServices.VSCode/bin/$Configuration/$($script:NetRuntime.Standard)/publish"
Expand All @@ -72,13 +71,6 @@ Task FindDotNet {
$existingVersion, $null = (dotnet --version) -split '-'
Assert ([Version]$existingVersion -ge [Version]("6.0")) ".NET SDK 6.0 or higher is required, please update it: https://aka.ms/dotnet-cli"

# Anywhere other than on a Mac with an M1 processor, we additionally
# need the .NET 3.1 runtime for our netcoreapp3.1 framework.
if (-not $script:IsAppleM1 -and -not $script:IsArm64) {
$runtimes = dotnet --list-runtimes
Assert ($runtimes -match "Microsoft.NETCore.App 3.1") ".NET Runtime 3.1 required but not found!"
}

Write-Host "Using dotnet v$(dotnet --version) at path $((Get-Command dotnet).Source)" -ForegroundColor Green
}

Expand Down Expand Up @@ -172,7 +164,8 @@ Task SetupHelpForTests {

Task Build FindDotNet, CreateBuildInfo, {
Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script:NetRuntime.Standard }
Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetRuntime.PS7 }
Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetRuntime.PS72 }

if (-not $script:IsNix) {
Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetRuntime.Desktop }
}
Expand All @@ -183,7 +176,7 @@ Task Build FindDotNet, CreateBuildInfo, {

Task Test TestServer, TestE2E

Task TestServer TestServerWinPS, TestServerPS7, TestServerPS72, TestServerPS73
Task TestServer TestServerWinPS, TestServerPS72, TestServerPS73

# NOTE: While these can run under `pwsh.exe` we only want them to run under
# `powershell.exe` so that the CI time isn't doubled.
Expand All @@ -196,11 +189,6 @@ Task TestServerWinPS -If ($PSVersionTable.PSEdition -eq "Desktop") Build, SetupH
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.Desktop }
}

Task TestServerPS7 -If ($PSVersionTable.PSEdition -eq "Core" -and -not $script:IsAppleM1 -and -not $script:IsArm64) Build, SetupHelpForTests, {
Set-Location .\test\PowerShellEditorServices.Test\
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS7 }
}

Task TestServerPS72 -If ($PSVersionTable.PSEdition -eq "Core") Build, SetupHelpForTests, {
Set-Location .\test\PowerShellEditorServices.Test\
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS72 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<AssemblyName>Microsoft.PowerShell.EditorServices.Hosting</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<DefineConstants>$(DefineConstants);CoreCLR</DefineConstants>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />

<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;netcoreapp3.1;net462</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;net462</TargetFrameworks>
<AssemblyName>Microsoft.PowerShell.EditorServices.Test</AssemblyName>
<TargetPlatform>x64</TargetPlatform>
</PropertyGroup>
Expand All @@ -17,16 +17,11 @@
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.0" />
</ItemGroup>

<!-- PowerShell LTS-Current -->
<!-- PowerShell LTS -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.7" />
</ItemGroup>

<!-- PowerShell LTS -->
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.0.13" />
</ItemGroup>

<!-- Windows PowerShell 5.1 -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<PackageReference Include="Microsoft.PowerShell.5.ReferenceAssemblies" Version="1.1.0" />
Expand Down