Skip to content

Commit 8e17b72

Browse files
Drop support for end-of-life PowerShell 7.0 (#1967)
Which more importantly means we can drop `netcoreapp3.1`.
1 parent 551cf8b commit 8e17b72

File tree

5 files changed

+9
-33
lines changed

5 files changed

+9
-33
lines changed

.vsts-ci/templates/ci-general.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ steps:
2525
version: 6.0.x
2626
performMultiLevelLookup: true
2727

28-
- task: UseDotNet@2
29-
displayName: Install .NET 3.1.x runtime
30-
inputs:
31-
packageType: runtime
32-
version: 3.1.x
33-
performMultiLevelLookup: true
34-
3528
- task: PowerShell@2
3629
displayName: Build
3730
inputs:

PowerShellEditorServices.build.ps1

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ $script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerSh
4848
$script:PsesCommonProps = [xml](Get-Content -Raw "$PSScriptRoot/PowerShellEditorServices.Common.props")
4949

5050
$script:NetRuntime = @{
51-
PS7 = 'netcoreapp3.1'
5251
PS72 = 'net6.0'
5352
PS73 = 'net7.0'
5453
Desktop = 'net462'
5554
Standard = 'netstandard2.0'
5655
}
5756

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

75-
# Anywhere other than on a Mac with an M1 processor, we additionally
76-
# need the .NET 3.1 runtime for our netcoreapp3.1 framework.
77-
if (-not $script:IsAppleM1 -and -not $script:IsArm64) {
78-
$runtimes = dotnet --list-runtimes
79-
Assert ($runtimes -match "Microsoft.NETCore.App 3.1") ".NET Runtime 3.1 required but not found!"
80-
}
81-
8274
Write-Host "Using dotnet v$(dotnet --version) at path $((Get-Command dotnet).Source)" -ForegroundColor Green
8375
}
8476

@@ -172,7 +164,8 @@ Task SetupHelpForTests {
172164

173165
Task Build FindDotNet, CreateBuildInfo, {
174166
Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script:NetRuntime.Standard }
175-
Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetRuntime.PS7 }
167+
Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetRuntime.PS72 }
168+
176169
if (-not $script:IsNix) {
177170
Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetRuntime.Desktop }
178171
}
@@ -183,7 +176,7 @@ Task Build FindDotNet, CreateBuildInfo, {
183176

184177
Task Test TestServer, TestE2E
185178

186-
Task TestServer TestServerWinPS, TestServerPS7, TestServerPS72, TestServerPS73
179+
Task TestServer TestServerWinPS, TestServerPS72, TestServerPS73
187180

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

199-
Task TestServerPS7 -If ($PSVersionTable.PSEdition -eq "Core" -and -not $script:IsAppleM1 -and -not $script:IsArm64) Build, SetupHelpForTests, {
200-
Set-Location .\test\PowerShellEditorServices.Test\
201-
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS7 }
202-
}
203-
204192
Task TestServerPS72 -If ($PSVersionTable.PSEdition -eq "Core") Build, SetupHelpForTests, {
205193
Set-Location .\test\PowerShellEditorServices.Test\
206194
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS72 }

src/PowerShellEditorServices.Hosting/PowerShellEditorServices.Hosting.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
33

44
<PropertyGroup>
5-
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
5+
<TargetFrameworks>net6.0;net462</TargetFrameworks>
66
<AssemblyName>Microsoft.PowerShell.EditorServices.Hosting</AssemblyName>
77
</PropertyGroup>
88

9-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
9+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
1010
<DefineConstants>$(DefineConstants);CoreCLR</DefineConstants>
1111
</PropertyGroup>
1212

test/PowerShellEditorServices.Test.E2E/PowerShellEditorServices.Test.E2E.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
33

44
<PropertyGroup>
5-
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
5+
<TargetFrameworks>net7.0</TargetFrameworks>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
33

44
<PropertyGroup>
5-
<TargetFrameworks>net7.0;net6.0;netcoreapp3.1;net462</TargetFrameworks>
5+
<TargetFrameworks>net7.0;net6.0;net462</TargetFrameworks>
66
<AssemblyName>Microsoft.PowerShell.EditorServices.Test</AssemblyName>
77
<TargetPlatform>x64</TargetPlatform>
88
</PropertyGroup>
@@ -17,16 +17,11 @@
1717
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.0" />
1818
</ItemGroup>
1919

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

25-
<!-- PowerShell LTS -->
26-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
27-
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.0.13" />
28-
</ItemGroup>
29-
3025
<!-- Windows PowerShell 5.1 -->
3126
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
3227
<PackageReference Include="Microsoft.PowerShell.5.ReferenceAssemblies" Version="1.1.0" />

0 commit comments

Comments
 (0)