Skip to content

Commit 6cfdb6f

Browse files
Add .NET 10 Support (#399)
* Update to .NET 10 * Update CommunityToolkit.Maui.Markup.UnitTests.csproj * Update Directory.Build.props * Update dotnet-build.yml * Update dotnet-build.yml * Remove `RequiresUnreferencedCodeAttribute` * `dotnet format` * Remove AOT * Update CommunityToolkit.Maui.Markup.Sample.csproj * Update Directory.Build.props * Update to .NET 10 RC 2 * Remove `NextMauiPackageVersion` * Use `macos-26` * Use `env.Xcode_Version` * Revert `preview` * Use `ga` * Migrate to `slnx` * Revert `Microsoft.CodeAnalysis.CSharp` to latest stable release * Update MauiPackageVersion to 10.0.0 * Refactor TypedBindingExtensionsTests to use button * Update Directory.Build.props * Update NuGet Packages * update to `macos-26`
1 parent a2ba93f commit 6cfdb6f

23 files changed

+98
-196
lines changed

.github/workflows/benchmarks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- '*'
1414

1515
env:
16-
LATEST_NET_VERSION: '9.0.x'
16+
LATEST_NET_VERSION: '10.0.x'
1717
PathToCommunityToolkitBenchmarkCsproj: 'src/CommunityToolkit.Maui.Markup.Benchmarks/CommunityToolkit.Maui.Markup.Benchmarks.csproj'
1818

1919
concurrency:
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
os: [windows-latest, macos-15]
30+
os: [windows-latest, macos-26]
3131

3232
steps:
3333
- name: Checkout code

.github/workflows/dotnet-build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ env:
1818
# When we create a tag, we set the NuGet version to the tag number, the below values are only for PR builds.
1919
CurrentSemanticVersionBase: '99.0.0' # Only used for PR builds
2020
NugetPackageVersion: '99.0.0-preview${{ github.run_number }}' # Only used for PR builds
21-
NET_VERSION: '9.0.x'
21+
NET_VERSION: '10.0.x'
2222
RunPoliCheck: false
23-
PathToLibrarySolution: 'src/CommunityToolkit.Maui.Markup.sln'
24-
PathToSamplesSolution: 'samples/CommunityToolkit.Maui.Markup.Sample.sln'
23+
PathToLibrarySolution: 'src/CommunityToolkit.Maui.Markup.slnx'
24+
PathToSamplesSolution: 'samples/CommunityToolkit.Maui.Markup.Sample.slnx'
2525
PathToCommunityToolkitCsproj: 'src/CommunityToolkit.Maui.Markup/CommunityToolkit.Maui.Markup.csproj'
2626
PathToCommunityToolkitSampleCsproj: 'samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj'
2727
PathToCommunityToolkitUnitTestCsproj: 'src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj'
2828
PathToCommunityToolkitSourceGeneratorsCsproj: 'src/CommunityToolkit.Maui.Markup.SourceGenerators/CommunityToolkit.Maui.Markup.SourceGenerators.csproj'
29-
Xcode_Version: '16.3'
29+
Xcode_Version: '26.0.1'
3030
ShouldCheckDependencies: true
3131

3232
concurrency:
@@ -40,7 +40,7 @@ jobs:
4040
strategy:
4141
fail-fast: false
4242
matrix:
43-
os: [windows-latest, macos-15]
43+
os: [windows-latest, macos-26]
4444
steps:
4545
- name: Checkout code
4646
uses: actions/checkout@v5
@@ -49,7 +49,7 @@ jobs:
4949
if: runner.os == 'macOS'
5050
uses: maxim-lobanov/setup-xcode@v1
5151
with:
52-
xcode-version: latest-stable
52+
xcode-version: ${{ env.Xcode_Version }}
5353

5454
- name: Install Latest .NET SDK, v${{ env.NET_VERSION }}
5555
uses: actions/setup-dotnet@v5
@@ -85,7 +85,7 @@ jobs:
8585
strategy:
8686
fail-fast: false
8787
matrix:
88-
os: [windows-latest, macos-15]
88+
os: [windows-latest, macos-26]
8989
steps:
9090
- name: Checkout code
9191
uses: actions/checkout@v5

Directory.Build.props

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Nullable>enable</Nullable>
55
<NoWarn>NETSDK1023</NoWarn>
6-
<NetVersion>net9.0</NetVersion>
6+
<NetVersion>net10.0</NetVersion>
77
<LangVersion>preview</LangVersion>
88
<ImplicitUsings>enable</ImplicitUsings>
99
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
@@ -20,8 +20,7 @@
2020
<NuGetAuditMode>all</NuGetAuditMode>
2121

2222
<!-- MAUI Specific -->
23-
<MauiPackageVersion>9.0.120</MauiPackageVersion>
24-
<NextMauiPackageVersion>10.0.0</NextMauiPackageVersion>
23+
<MauiPackageVersion>10.0.0</MauiPackageVersion>
2524
<MauiCommunityToolkitPackageVersion>12.3.0</MauiCommunityToolkitPackageVersion>
2625
<MauiStrictXamlCompilation>true</MauiStrictXamlCompilation>
2726
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
@@ -91,7 +90,7 @@
9190
IL2090,IL2091,IL2092,IL2093,IL2094,IL2095,IL2096,IL2097,IL2098,IL2099,
9291
IL2100,IL2101,IL2102,IL2103,IL2104,IL2105,IL2106,IL2107,IL2108,IL2109,
9392
IL2110,IL2111,IL2112,IL2113,IL2114,IL2115,IL2116,IL2117,IL2118,IL2119,
94-
IL2120,IL2121,IL2122,
93+
IL2120,IL2121,IL2122,IL2123,
9594
IL3050,IL3051,IL3052,IL3053,IL3054,IL3055,IL3056,
9695
RS1038
9796
</WarningsAsErrors>

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": "9.0.203",
3+
"version": "10.0.100",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
66
}

samples/CommunityToolkit.Maui.Markup.Sample.sln

Lines changed: 0 additions & 63 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Solution>
2+
<Folder Name="/Samples/">
3+
<Project Path="CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj">
4+
<Deploy />
5+
</Project>
6+
</Folder>
7+
<Folder Name="/Solution Items/">
8+
<File Path="../.editorconfig" />
9+
<File Path="../Directory.Build.props" />
10+
<File Path="../global.json" />
11+
</Folder>
12+
<Project Path="../src/CommunityToolkit.Maui.Markup.Benchmarks/CommunityToolkit.Maui.Markup.Benchmarks.csproj" />
13+
<Project Path="../src/CommunityToolkit.Maui.Markup.SourceGenerators/CommunityToolkit.Maui.Markup.SourceGenerators.csproj" />
14+
<Project Path="../src/CommunityToolkit.Maui.Markup.UnitTests/CommunityToolkit.Maui.Markup.UnitTests.csproj" />
15+
<Project Path="../src/CommunityToolkit.Maui.Markup/CommunityToolkit.Maui.Markup.csproj" />
16+
</Solution>

samples/CommunityToolkit.Maui.Markup.Sample/AppShell.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace CommunityToolkit.Maui.Markup.Sample;
44

5-
[RequiresUnreferencedCode("SettingsViewModel Calls CommunityToolkit.Maui.Behaviors.NumericValidationBehavior.NumericValidationBehavior()")]
65
partial class AppShell : Shell
76
{
87
static readonly ReadOnlyDictionary<Type, string> pageRouteMappingDictionary = new Dictionary<Type, string>(

samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.Maui.Markup.Sample.csproj

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@
3535
<NoWarn>CsWinRT1028</NoWarn>
3636
</PropertyGroup>
3737

38-
<PropertyGroup Condition="'$(Configuration)' == 'Release' &#xD;&#xA; AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'tizen'&#xD;&#xA; AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'android'&#xD;&#xA; AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">
39-
<!-- Ahead-of-time compilation is not yet supported net8.0-tizen -->
40-
<!-- Cross-OS native compilation is not supported net8.0-android -->
41-
<!-- Windows causing build errors in azurepipelines.yml -->
42-
<PublishAot>true</PublishAot>
38+
<PropertyGroup Condition="'$(Configuration)' == 'Release'
39+
AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">
40+
<!-- Windows error NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. -->
41+
42+
<PublishAot>false</PublishAot>
43+
<PublishTrimmed>true</PublishTrimmed>
44+
<TrimMode>partial</TrimMode>
4345
</PropertyGroup>
4446

4547
<ItemGroup>
@@ -59,7 +61,7 @@
5961
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiPackageVersion)" />
6062
<PackageReference Include="CommunityToolkit.Maui" Version="$(MauiCommunityToolkitPackageVersion)" />
6163
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
62-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.10.0" />
64+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0" />
6365
<PackageReference Include="Refit.HttpClientFactory" Version="8.0.0" />
6466
</ItemGroup>
6567

@@ -75,4 +77,8 @@
7577
</PropertyGroup>
7678
</Target>
7779

80+
<ItemGroup>
81+
<TrimmerRootAssembly Include="CommunityToolkit.Maui" RootMode="All"/>
82+
</ItemGroup>
83+
7884
</Project>

samples/CommunityToolkit.Maui.Markup.Sample/HotReloadHandler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Diagnostics.CodeAnalysis;
33
namespace CommunityToolkit.Maui.Markup.Sample;
44

5-
[RequiresUnreferencedCode("AppShell.GetRoute Requires Unreferenced Code")]
65
class HotReloadHandler : ICommunityToolkitHotReloadHandler
76
{
87
public async void OnHotReload(IReadOnlyList<Type> types)

samples/CommunityToolkit.Maui.Markup.Sample/MauiProgram.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
using System.Diagnostics.CodeAnalysis;
2-
using Microsoft.Extensions.Http.Resilience;
1+
using Microsoft.Extensions.Http.Resilience;
32
using Polly;
43
using Refit;
54
namespace CommunityToolkit.Maui.Markup.Sample;
65

7-
[RequiresUnreferencedCode("SettingsViewModel Calls CommunityToolkit.Maui.Behaviors.NumericValidationBehavior.NumericValidationBehavior()")]
86
public class MauiProgram
97
{
108
public static MauiApp CreateMauiApp()

0 commit comments

Comments
 (0)