Skip to content

Commit 6365e91

Browse files
committed
Bump SDK to 10 and improve SDK check
1 parent e124c13 commit 6365e91

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

.pipelines/PowerShellEditorServices-OneBranch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ extends:
8888
system: Custom
8989
customVersion: $(package.version)
9090
- task: UseDotNet@2
91-
displayName: Use .NET 8.x SDK
91+
displayName: Use .NET SDK in global.json
9292
inputs:
9393
packageType: sdk
9494
useGlobalJson: true

PowerShellEditorServices.build.ps1

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ if (Get-Command git -ErrorAction SilentlyContinue) {
5656
Task FindDotNet {
5757
Assert (Get-Command dotnet -ErrorAction SilentlyContinue) "dotnet not found, please install it: https://aka.ms/dotnet-cli"
5858

59-
# Strip out semantic version metadata so it can be cast to `Version`
60-
[Version]$existingVersion, $null = (dotnet --version) -split " " -split "-"
61-
Assert ($existingVersion -ge [Version]("8.0")) ".NET SDK 8.0 or higher is required, please update it: https://aka.ms/dotnet-cli"
62-
63-
Write-Build DarkGreen "Using dotnet v$(dotnet --version) at path $((Get-Command dotnet).Source)"
59+
[string[]]$dotnetInfo = dotnet --version 2>&1
60+
$missingDotnet = ($dotnetInfo -match '(Install the .+ \.NET SDK) or update')[0]
61+
if ($missingDotnet) {
62+
$missingDotnetMessage = $missingDotnet[0] -replace 'or update.+'
63+
}
64+
Assert (!$missingDotnet) ($missingDotnet -replace 'or update.+')
65+
Write-Build DarkGreen "Using dotnet v$($dotnetInfo) at path $((Get-Command dotnet).Source)"
6466
}
6567

6668
Task Clean FindDotNet, {

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.416",
3+
"version": "10.0.100",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
66
}

0 commit comments

Comments
 (0)