Skip to content

Commit 0125836

Browse files
Copilotpardeike
andauthored
Partially add .NET 10 support (#744)
* Initial plan * Add .NET 10 support to Harmony Co-authored-by: pardeike <[email protected]> * Update additional workflow files for .NET 10 SDK Co-authored-by: pardeike <[email protected]> * Fix CI by installing .NET 10 SDK in workflows Updated workflows to install both 9.0.x and 10.0.x SDKs using wildcard versions. This ensures .NET 10 SDK is installed when available in GitHub Actions runners. Changed global.json to require SDK 10.0.100 with latestPatch rollForward for forward compatibility. Co-authored-by: pardeike <[email protected]> * Revert global.json to SDK 9.0.100 for CI compatibility Changed global.json back to require SDK 9.0.100 with latestFeature rollForward. Note: net10.0 targets will fail to build until .NET 10 SDK is available in GitHub Actions. This is expected since .NET SDK was just released today. Co-authored-by: pardeike <[email protected]> * Set global.json to require .NET 10 SDK with latestPatch rollForward Updated global.json to explicitly require SDK 10.0.100 with latestPatch rollForward. This works because actions/setup-dotnet downloads and installs the SDK regardless of what's preinstalled on the runner. Confirmed .NET 10.0.100 SDK is available and builds net10.0 targets successfully. Co-authored-by: pardeike <[email protected]> * Simplify workflow SDK installation to only use .NET 10 Removed dual 9.0.x/10.0.x SDK installation in favor of only installing 10.0.x. The .NET 10 SDK can build all target frameworks including net9.0 and older using targeting packs. This follows the minimal change approach requested. Co-authored-by: pardeike <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: pardeike <[email protected]>
1 parent f62692b commit 0125836

File tree

9 files changed

+13
-11
lines changed

9 files changed

+13
-11
lines changed

.github/actions/test-setup-dotnet/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
- name: Setup .NET Sdk
1919
uses: actions/setup-dotnet@v4
2020
with:
21-
dotnet-version: '9.0.101'
21+
dotnet-version: '10.0.x'
2222

2323
- name: Get .NET Channels
2424
uses: ./.github/actions/get-dotnet-channel

.github/workflows/test-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- name: Setup .NET
5050
uses: actions/setup-dotnet@v4
5151
with:
52-
dotnet-version: '9.0.101'
52+
dotnet-version: '10.0.x'
5353

5454
- name: Build
5555
run: |

.github/workflows/test-unix-mono.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- name: Setup .NET SDK
7676
uses: actions/setup-dotnet@v4
7777
with:
78-
dotnet-version: '9.0.101'
78+
dotnet-version: '10.0.x'
7979
env:
8080
DOTNET_INSTALL_DIR: ${{ runner.temp }}/.dotnet
8181

.github/workflows/test-windows-framework.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup .NET Sdk
5858
uses: actions/setup-dotnet@v4
5959
with:
60-
dotnet-version: '9.0.101'
60+
dotnet-version: '10.0.x'
6161

6262
- name: Get Installed .NET Sdk Information
6363
run: dotnet --info

.github/workflows/test-windows-mono.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup .NET Sdk
5858
uses: actions/setup-dotnet@v4
5959
with:
60-
dotnet-version: '9.0.101'
60+
dotnet-version: '10.0.x'
6161

6262
- name: Get Installed .NET Sdk Information
6363
run: dotnet --info

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ env:
3838
# You are interested in changing these values
3939
BUILD_CONFIGURATIONS: "['Debug', 'Release']"
4040
BUILD_CONFIGURATIONS_WITH_REF: "['Debug', 'Release']"
41-
DOTNET_TARGET_FRAMEWORKS: "['netcoreapp3.0', 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0', 'net9.0']"
42-
DOTNET_TARGET_FRAMEWORKS_MACOS_ARM64: "['net6.0', 'net7.0', 'net8.0', 'net9.0']"
41+
DOTNET_TARGET_FRAMEWORKS: "['netcoreapp3.0', 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0', 'net9.0', 'net10.0']"
42+
DOTNET_TARGET_FRAMEWORKS_MACOS_ARM64: "['net6.0', 'net7.0', 'net8.0', 'net9.0', 'net10.0']"
4343
FRAMEWORK_TARGET_FRAMEWORKS: "['net35', 'net452', 'net472', 'net48']"
4444

4545
jobs:

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</PropertyGroup>
2323

2424
<PropertyGroup Label="Build Configuration">
25-
<TargetFrameworks>net35;net452;net472;net48;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
25+
<TargetFrameworks>net35;net452;net472;net48;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
2626
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2727
<LangVersion>preview</LangVersion>
2828
<CheckEolTargetFramework>false</CheckEolTargetFramework>
@@ -32,7 +32,7 @@
3232
<IncludeBuildOutput Condition="$(TargetFramework)=='netstandard2.0'">false</IncludeBuildOutput>
3333

3434
<IsNET5OrGreater>false</IsNET5OrGreater>
35-
<IsNET5OrGreater Condition="'$(TargetFramework)'=='net5.0' Or '$(TargetFramework)'=='net6.0' Or '$(TargetFramework)'=='net7.0' Or '$(TargetFramework)'=='net8.0' Or '$(TargetFramework)'=='net9.0'">true</IsNET5OrGreater>
35+
<IsNET5OrGreater Condition="'$(TargetFramework)'=='net5.0' Or '$(TargetFramework)'=='net6.0' Or '$(TargetFramework)'=='net7.0' Or '$(TargetFramework)'=='net8.0' Or '$(TargetFramework)'=='net9.0' Or '$(TargetFramework)'=='net10.0'">true</IsNET5OrGreater>
3636
</PropertyGroup>
3737

3838
<PropertyGroup Label="Package Configuration" Condition="$(IsLibHarmonyProject)">
@@ -79,6 +79,7 @@
7979
<PackageReference Condition="'$(TargetFramework)'=='net7.0'" Include="System.Text.Json" Version="8.0.5" />
8080
<PackageReference Condition="'$(TargetFramework)'=='net8.0'" Include="System.Text.Json" Version="8.0.5" />
8181
<PackageReference Condition="'$(TargetFramework)'=='net9.0'" Include="System.Text.Json" Version="9.0.1" />
82+
<PackageReference Condition="'$(TargetFramework)'=='net10.0'" Include="System.Text.Json" Version="10.0.0" />
8283
</ItemGroup>
8384

8485
<ItemGroup Condition="$(IsLibHarmonyProject)">

Lib.Harmony/Lib.Harmony.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<PackageReference Condition="$(TargetFramework) == 'net7.0'" Include="Microsoft.NetCore.App.Ref" Version="7.0.20" ExcludeAssets="all" PrivateAssets="all" GeneratePathProperty="true" />
3434
<PackageReference Condition="$(TargetFramework) == 'net8.0'" Include="Microsoft.NetCore.App.Ref" Version="8.0.12" ExcludeAssets="all" PrivateAssets="all" GeneratePathProperty="true" />
3535
<PackageReference Condition="$(TargetFramework) == 'net9.0'" Include="Microsoft.NetCore.App.Ref" Version="9.0.1" ExcludeAssets="all" PrivateAssets="all" GeneratePathProperty="true" />
36+
<PackageReference Condition="$(TargetFramework) == 'net10.0'" Include="Microsoft.NetCore.App.Ref" Version="10.0.0" ExcludeAssets="all" PrivateAssets="all" GeneratePathProperty="true" />
3637
</ItemGroup>
3738

3839
<!-- Replace Code with reference to Lib.Harmony.Ref for netstandard2.0 -->

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.101",
4-
"rollForward": "latestFeature"
3+
"version": "10.0.100",
4+
"rollForward": "latestPatch"
55
}
66
}

0 commit comments

Comments
 (0)