Skip to content

Commit dc7fdf2

Browse files
authored
Migrate to .NET 10 (Mac/Linux) and adopt CPM (#2313)
* Update from .NET 8 to .NET 10 for our Mac and Linux platforms. * Migrate to using [Central Package Management (CPM)](https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management) to aid in future updates to dependencies.
2 parents c6e4b33 + bea97da commit dc7fdf2

30 files changed

Lines changed: 134 additions & 88 deletions

File tree

.azure-pipelines/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ extends:
136136
$version = (Get-Content .\VERSION) -replace '\.\d+$', ''
137137
Write-Host "##vso[task.setvariable variable=version;isReadOnly=true]$version"
138138
- task: UseDotNet@2
139-
displayName: 'Use .NET 8 SDK'
139+
displayName: 'Use .NET 10 SDK'
140140
inputs:
141141
packageType: sdk
142-
version: '8.x'
142+
version: '10.x'
143143
- task: PowerShell@2
144144
displayName: 'Build payload'
145145
inputs:
@@ -296,10 +296,10 @@ extends:
296296
script: |
297297
echo "##vso[task.setvariable variable=version;isReadOnly=true]$(cat ./VERSION | sed -E 's/.[0-9]+$//')"
298298
- task: UseDotNet@2
299-
displayName: 'Use .NET 8 SDK'
299+
displayName: 'Use .NET 10 SDK'
300300
inputs:
301301
packageType: sdk
302-
version: '8.x'
302+
version: '10.x'
303303
- task: Bash@3
304304
displayName: 'Build payload'
305305
inputs:
@@ -565,10 +565,10 @@ extends:
565565
script: |
566566
echo "##vso[task.setvariable variable=version;isReadOnly=true]$(cat ./VERSION | sed -E 's/.[0-9]+$//')"
567567
- task: UseDotNet@2
568-
displayName: 'Use .NET 8 SDK'
568+
displayName: 'Use .NET 10 SDK'
569569
inputs:
570570
packageType: sdk
571-
version: '8.x'
571+
version: '10.x'
572572
- task: Bash@3
573573
displayName: 'Build payload'
574574
inputs:
@@ -664,10 +664,10 @@ extends:
664664
$version = (Get-Content .\VERSION) -replace '\.\d+$', ''
665665
Write-Host "##vso[task.setvariable variable=version;isReadOnly=true]$version"
666666
- task: UseDotNet@2
667-
displayName: 'Use .NET 8 SDK'
667+
displayName: 'Use .NET 10 SDK'
668668
inputs:
669669
packageType: sdk
670-
version: '8.x'
670+
version: '10.x'
671671
- task: NuGetToolInstaller@1
672672
displayName: 'Install NuGet CLI'
673673
inputs:

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup .NET
2828
uses: actions/setup-dotnet@v5.1.0
2929
with:
30-
dotnet-version: 8.0.x
30+
dotnet-version: 10.0.x
3131

3232
# Initializes the CodeQL tools for scanning.
3333
- name: Initialize CodeQL

.github/workflows/continuous-integration.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,16 @@ jobs:
3030
- name: Setup .NET
3131
uses: actions/setup-dotnet@v5.1.0
3232
with:
33-
dotnet-version: 8.0.x
33+
dotnet-version: 10.0.x
34+
35+
# The x86 test host requires an x86 .NET runtime, which isn't pre-installed
36+
# on the runner, nor can the actions/setup-dotnet action install it.
37+
# Install it manually so tests can run.
38+
- name: Setup .NET (x86)
39+
if: matrix.runtime == 'win-x86'
40+
run: |
41+
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile dotnet-install.ps1
42+
./dotnet-install.ps1 -Channel 10.0 -Architecture x86 -InstallDir 'C:\Program Files (x86)\dotnet'
3443
3544
- name: Install dependencies
3645
run: dotnet restore
@@ -78,7 +87,7 @@ jobs:
7887
- name: Setup .NET
7988
uses: actions/setup-dotnet@v5.1.0
8089
with:
81-
dotnet-version: 8.0.x
90+
dotnet-version: 10.0.x
8291

8392
- name: Install dependencies
8493
run: dotnet restore
@@ -122,7 +131,7 @@ jobs:
122131
- name: Setup .NET
123132
uses: actions/setup-dotnet@v5.1.0
124133
with:
125-
dotnet-version: 8.0.x
134+
dotnet-version: 10.0.x
126135

127136
- name: Install dependencies
128137
run: dotnet restore

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"request": "launch",
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net8.0/git-credential-manager.dll",
13+
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net10.0/git-credential-manager.dll",
1414
"args": ["get"],
1515
"cwd": "${workspaceFolder}/out/shared/Git-Credential-Manager",
1616
"console": "integratedTerminal",
@@ -22,7 +22,7 @@
2222
"request": "launch",
2323
"preLaunchTask": "build",
2424
// If you have changed target frameworks, make sure to update the program path.
25-
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net8.0/git-credential-manager.dll",
25+
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net10.0/git-credential-manager.dll",
2626
"args": ["store"],
2727
"cwd": "${workspaceFolder}/out/shared/Git-Credential-Manager",
2828
"console": "integratedTerminal",

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"type": "shell",
5757
"group": "test",
5858
"args": [
59-
"~/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll",
59+
"~/.nuget/packages/reportgenerator/*/*/net10.0/ReportGenerator.dll",
6060
"-reports:${workspaceFolder}/**/TestResults/**/coverage.cobertura.xml",
6161
"-targetdir:${workspaceFolder}/out/code-coverage"
6262
],
@@ -71,7 +71,7 @@
7171
"type": "shell",
7272
"group": "test",
7373
"args": [
74-
"${env:USERROFILE}/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll",
74+
"${env:USERROFILE}/.nuget/packages/reportgenerator/*/*/net10.0/ReportGenerator.dll",
7575
"-reports:${workspaceFolder}/**/TestResults/**/coverage.cobertura.xml",
7676
"-targetdir:${workspaceFolder}/out/code-coverage"
7777
],

Directory.Build.props

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup Condition = "'$(TargetFramework)' == 'net472'">
30-
<PackageReference Include="System.Text.Json">
31-
<Version>8.0.5</Version>
32-
</PackageReference>
30+
<PackageReference Include="System.Text.Json" />
3331
</ItemGroup>
3432

3533
</Project>

Directory.Packages.props

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<!-- Avalonia -->
9+
<PackageVersion Include="Avalonia" Version="11.1.3" />
10+
<PackageVersion Include="Avalonia.Desktop" Version="11.1.3" />
11+
<PackageVersion Include="Avalonia.Diagnostics" Version="11.1.3" />
12+
<PackageVersion Include="Avalonia.Skia" Version="11.1.3" />
13+
<PackageVersion Include="Avalonia.Themes.Fluent" Version="11.1.3" />
14+
<PackageVersion Include="Avalonia.Win32" Version="11.1.3" />
15+
16+
<!-- Microsoft Identity -->
17+
<PackageVersion Include="Microsoft.Identity.Client" Version="4.65.0" />
18+
<PackageVersion Include="Microsoft.Identity.Client.Broker" Version="4.65.0" />
19+
<PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.65.0" />
20+
21+
<!-- MSBuild -->
22+
<PackageVersion Include="Microsoft.Build.Framework" Version="16.0.461" />
23+
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="16.0.461" />
24+
25+
<!-- Other -->
26+
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
27+
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
28+
<PackageVersion Include="Tools.InnoSetup" Version="6.3.1" GeneratePathProperty="true" />
29+
30+
<!-- Testing -->
31+
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
32+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
33+
<PackageVersion Include="Moq" Version="4.20.72" />
34+
<PackageVersion Include="ReportGenerator" Version="5.3.10" />
35+
<PackageVersion Include="xunit" Version="2.9.2" />
36+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
37+
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
38+
</ItemGroup>
39+
40+
</Project>

build/GCM.MSBuild.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<IncludeBuildOutput>false</IncludeBuildOutput>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Build.Framework" Version="16.0.461" PrivateAssets="all" />
10-
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.0.461" PrivateAssets="all" />
9+
<PackageReference Include="Microsoft.Build.Framework" PrivateAssets="all" />
10+
<PackageReference Include="Microsoft.Build.Utilities.Core" PrivateAssets="all" />
1111
</ItemGroup>
1212

1313
</Project>

docs/development.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ HTML reports can be generated using ReportGenerator, this should be installed
215215
during the build process, from the command line:
216216

217217
```shell
218-
dotnet ~/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
218+
dotnet ~/.nuget/packages/reportgenerator/*/*/net10.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
219219
```
220220

221221
or
222222

223223
```shell
224-
dotnet {$env:USERPROFILE}/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
224+
dotnet {$env:USERPROFILE}/.nuget/packages/reportgenerator/*/*/net10.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
225225
```
226226

227227
Or via VSCode Terminal/Run Task:

src/linux/Packaging.Linux/Packaging.Linux.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
44

55
<PropertyGroup>
6-
<TargetFramework>net8.0</TargetFramework>
6+
<TargetFramework>net10.0</TargetFramework>
77
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
88
</PropertyGroup>
99

0 commit comments

Comments
 (0)