Skip to content

Commit 8e0dac7

Browse files
committed
feat: Updated to net9. Fixed issue with flexible updates.
1 parent a81bff4 commit 8e0dac7

File tree

20 files changed

+134
-281
lines changed

20 files changed

+134
-281
lines changed

.github/workflows/dotnet.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v4
17+
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: '9.0.x'
1722

1823
- name: Install workloads
1924
run: dotnet workload install maui

.github/workflows/pr.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@v4
1717

18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: '9.0.x'
22+
1823
- name: Install workloads
1924
run: dotnet workload install maui
2025

Maui.Android.InAppUpdates.sln

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
2828
.github\workflows\pr.yml = .github\workflows\pr.yml
2929
EndProjectSection
3030
EndProject
31-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "helpers", "helpers", "{E9A82491-47A5-4EFC-9AAA-D7E5382A22DB}"
32-
EndProject
33-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrimmingHelper", "src\helpers\TrimmingHelper\TrimmingHelper.csproj", "{F464A23B-B245-4687-BFB3-0DB3FEEAC38B}"
34-
EndProject
35-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrimmingHelperApp", "src\helpers\TrimmingHelperApp\TrimmingHelperApp.csproj", "{2073350E-1781-4C08-A24E-CD57F2466B03}"
36-
EndProject
3731
Global
3832
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3933
Debug|Any CPU = Debug|Any CPU
@@ -48,14 +42,6 @@ Global
4842
{542C62E2-8E4A-4FA0-8052-6DCF4A9C7B1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
4943
{542C62E2-8E4A-4FA0-8052-6DCF4A9C7B1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
5044
{542C62E2-8E4A-4FA0-8052-6DCF4A9C7B1A}.Release|Any CPU.Build.0 = Release|Any CPU
51-
{F464A23B-B245-4687-BFB3-0DB3FEEAC38B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52-
{F464A23B-B245-4687-BFB3-0DB3FEEAC38B}.Debug|Any CPU.Build.0 = Debug|Any CPU
53-
{F464A23B-B245-4687-BFB3-0DB3FEEAC38B}.Release|Any CPU.ActiveCfg = Release|Any CPU
54-
{F464A23B-B245-4687-BFB3-0DB3FEEAC38B}.Release|Any CPU.Build.0 = Release|Any CPU
55-
{2073350E-1781-4C08-A24E-CD57F2466B03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
56-
{2073350E-1781-4C08-A24E-CD57F2466B03}.Debug|Any CPU.Build.0 = Debug|Any CPU
57-
{2073350E-1781-4C08-A24E-CD57F2466B03}.Release|Any CPU.ActiveCfg = Release|Any CPU
58-
{2073350E-1781-4C08-A24E-CD57F2466B03}.Release|Any CPU.Build.0 = Release|Any CPU
5945
EndGlobalSection
6046
GlobalSection(SolutionProperties) = preSolution
6147
HideSolutionNode = FALSE
@@ -64,8 +50,6 @@ Global
6450
{8E7AE677-AD62-4FFE-ACBF-0F1A947ACDDB} = {928D4422-05CE-4AC2-89B0-31060889AE6A}
6551
{542C62E2-8E4A-4FA0-8052-6DCF4A9C7B1A} = {4746EB5B-E37C-40F0-8CA6-7D03185F5370}
6652
{8DEF204E-ED5E-45A8-B021-47F6588890F4} = {94FE90BF-FA05-46C6-A207-6E454A236659}
67-
{F464A23B-B245-4687-BFB3-0DB3FEEAC38B} = {E9A82491-47A5-4EFC-9AAA-D7E5382A22DB}
68-
{2073350E-1781-4C08-A24E-CD57F2466B03} = {E9A82491-47A5-4EFC-9AAA-D7E5382A22DB}
6953
EndGlobalSection
7054
GlobalSection(ExtensibilityGlobals) = postSolution
7155
SolutionGuid = {1493AEE4-9211-46E9-BFE6-8F629EAC5693}

sample/App.xaml.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ public partial class App : Application
55
public App()
66
{
77
InitializeComponent();
8+
}
89

9-
MainPage = new AppShell();
10+
protected override Window CreateWindow(IActivationState? activationState)
11+
{
12+
return new Window(new AppShell());
1013
}
1114
}

sample/MainPage.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public MainPage()
2121
private void SetUpdateAvailableWithPriorityOf5()
2222
{
2323
#if ANDROID
24-
FakeAppUpdateManager.SetUpdatePriority(updatePriority: 5);
2524
FakeAppUpdateManager.SetUpdateAvailable(availableVersionCode: _availableVersionCode++);
25+
FakeAppUpdateManager.SetUpdatePriority(updatePriority: 5);
2626
AddOnSuccessListener();
2727
#endif
2828
}
@@ -31,8 +31,8 @@ private void SetUpdateAvailableWithPriorityOf5()
3131
private void SetUpdateAvailableWithPriorityOf3()
3232
{
3333
#if ANDROID
34-
FakeAppUpdateManager.SetUpdatePriority(updatePriority: 3);
3534
FakeAppUpdateManager.SetUpdateAvailable(availableVersionCode: _availableVersionCode++);
35+
FakeAppUpdateManager.SetUpdatePriority(updatePriority: 3);
3636
AddOnSuccessListener();
3737
#endif
3838
}
@@ -108,7 +108,7 @@ private async Task Downloading()
108108

109109
private static void AddOnSuccessListener()
110110
{
111-
FakeAppUpdateManager.GetAppUpdateInfo().AddOnSuccessListener(Internal.Handler.AppUpdateSuccessListener!);
111+
FakeAppUpdateManager.GetAppUpdateInfo()?.AddOnSuccessListener(Internal.Handler.AppUpdateSuccessListener!);
112112
}
113113
#endif
114114
}

sample/Maui.Android.InAppUpdates.SampleApp.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
66
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
7-
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
88

99
<!-- Note for MacCatalyst:
1010
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
@@ -30,12 +30,17 @@
3030
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
3131
<ApplicationVersion>1</ApplicationVersion>
3232

33-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
34-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
33+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.2</SupportedOSPlatformVersion>
34+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
3535
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
3636
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
3737
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
3838
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
39+
40+
<IsAotCompatible>true</IsAotCompatible>
41+
42+
<PublishAot Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">true</PublishAot>
43+
<PublishAot Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">true</PublishAot>
3944
</PropertyGroup>
4045

4146
<ItemGroup>
@@ -57,10 +62,9 @@
5762
</ItemGroup>
5863

5964
<ItemGroup>
60-
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
6165
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
62-
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
63-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
66+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
67+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
6468
</ItemGroup>
6569

6670
<ItemGroup>

sample/Resources/Styles/Styles.xaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,14 @@
399399

400400
<Style TargetType="Shell" ApplyToDerivedTypes="True">
401401
<Setter Property="Shell.BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource OffBlack}}" />
402-
<Setter Property="Shell.ForegroundColor" Value="{OnPlatform WinUI={StaticResource Primary}, Default={StaticResource White}}" />
402+
<Setter Property="Shell.ForegroundColor">
403+
<Setter.Value>
404+
<OnPlatform x:TypeArguments="Color">
405+
<On Platform="WinUI" Value="{StaticResource Primary}" />
406+
<On Platform="Default" Value="{StaticResource White}" />
407+
</OnPlatform>
408+
</Setter.Value>
409+
</Setter>
403410
<Setter Property="Shell.TitleColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource SecondaryDarkText}}" />
404411
<Setter Property="Shell.DisabledColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" />
405412
<Setter Property="Shell.UnselectedColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray200}}" />

src/helpers/TrimmingHelper/Program.cs

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/helpers/TrimmingHelper/TrimmingHelper.csproj

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/helpers/TrimmingHelperApp/MauiProgram.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)