Skip to content

Commit

Permalink
feat: Updated to net9. Fixed issue with flexible updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Dec 5, 2024
1 parent a81bff4 commit 8e0dac7
Show file tree
Hide file tree
Showing 20 changed files with 134 additions and 281 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Install workloads
run: dotnet workload install maui
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Install workloads
run: dotnet workload install maui

Expand Down
16 changes: 0 additions & 16 deletions Maui.Android.InAppUpdates.sln
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\pr.yml = .github\workflows\pr.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "helpers", "helpers", "{E9A82491-47A5-4EFC-9AAA-D7E5382A22DB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrimmingHelper", "src\helpers\TrimmingHelper\TrimmingHelper.csproj", "{F464A23B-B245-4687-BFB3-0DB3FEEAC38B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrimmingHelperApp", "src\helpers\TrimmingHelperApp\TrimmingHelperApp.csproj", "{2073350E-1781-4C08-A24E-CD57F2466B03}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -48,14 +42,6 @@ Global
{542C62E2-8E4A-4FA0-8052-6DCF4A9C7B1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{542C62E2-8E4A-4FA0-8052-6DCF4A9C7B1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{542C62E2-8E4A-4FA0-8052-6DCF4A9C7B1A}.Release|Any CPU.Build.0 = Release|Any CPU
{F464A23B-B245-4687-BFB3-0DB3FEEAC38B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F464A23B-B245-4687-BFB3-0DB3FEEAC38B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F464A23B-B245-4687-BFB3-0DB3FEEAC38B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F464A23B-B245-4687-BFB3-0DB3FEEAC38B}.Release|Any CPU.Build.0 = Release|Any CPU
{2073350E-1781-4C08-A24E-CD57F2466B03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2073350E-1781-4C08-A24E-CD57F2466B03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2073350E-1781-4C08-A24E-CD57F2466B03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2073350E-1781-4C08-A24E-CD57F2466B03}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -64,8 +50,6 @@ Global
{8E7AE677-AD62-4FFE-ACBF-0F1A947ACDDB} = {928D4422-05CE-4AC2-89B0-31060889AE6A}
{542C62E2-8E4A-4FA0-8052-6DCF4A9C7B1A} = {4746EB5B-E37C-40F0-8CA6-7D03185F5370}
{8DEF204E-ED5E-45A8-B021-47F6588890F4} = {94FE90BF-FA05-46C6-A207-6E454A236659}
{F464A23B-B245-4687-BFB3-0DB3FEEAC38B} = {E9A82491-47A5-4EFC-9AAA-D7E5382A22DB}
{2073350E-1781-4C08-A24E-CD57F2466B03} = {E9A82491-47A5-4EFC-9AAA-D7E5382A22DB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1493AEE4-9211-46E9-BFE6-8F629EAC5693}
Expand Down
5 changes: 4 additions & 1 deletion sample/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ public partial class App : Application
public App()
{
InitializeComponent();
}

MainPage = new AppShell();
protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new AppShell());
}
}
6 changes: 3 additions & 3 deletions sample/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public MainPage()
private void SetUpdateAvailableWithPriorityOf5()
{
#if ANDROID
FakeAppUpdateManager.SetUpdatePriority(updatePriority: 5);
FakeAppUpdateManager.SetUpdateAvailable(availableVersionCode: _availableVersionCode++);
FakeAppUpdateManager.SetUpdatePriority(updatePriority: 5);
AddOnSuccessListener();
#endif
}
Expand All @@ -31,8 +31,8 @@ private void SetUpdateAvailableWithPriorityOf5()
private void SetUpdateAvailableWithPriorityOf3()
{
#if ANDROID
FakeAppUpdateManager.SetUpdatePriority(updatePriority: 3);
FakeAppUpdateManager.SetUpdateAvailable(availableVersionCode: _availableVersionCode++);
FakeAppUpdateManager.SetUpdatePriority(updatePriority: 3);
AddOnSuccessListener();
#endif
}
Expand Down Expand Up @@ -108,7 +108,7 @@ private async Task Downloading()

private static void AddOnSuccessListener()
{
FakeAppUpdateManager.GetAppUpdateInfo().AddOnSuccessListener(Internal.Handler.AppUpdateSuccessListener!);
FakeAppUpdateManager.GetAppUpdateInfo()?.AddOnSuccessListener(Internal.Handler.AppUpdateSuccessListener!);
}
#endif
}
Expand Down
20 changes: 12 additions & 8 deletions sample/Maui.Android.InAppUpdates.SampleApp.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

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

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

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>

<IsAotCompatible>true</IsAotCompatible>

<PublishAot Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">true</PublishAot>
<PublishAot Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">true</PublishAot>
</PropertyGroup>

<ItemGroup>
Expand All @@ -57,10 +62,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 8 additions & 1 deletion sample/Resources/Styles/Styles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,14 @@

<Style TargetType="Shell" ApplyToDerivedTypes="True">
<Setter Property="Shell.BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource OffBlack}}" />
<Setter Property="Shell.ForegroundColor" Value="{OnPlatform WinUI={StaticResource Primary}, Default={StaticResource White}}" />
<Setter Property="Shell.ForegroundColor">
<Setter.Value>
<OnPlatform x:TypeArguments="Color">
<On Platform="WinUI" Value="{StaticResource Primary}" />
<On Platform="Default" Value="{StaticResource White}" />
</OnPlatform>
</Setter.Value>
</Setter>
<Setter Property="Shell.TitleColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource SecondaryDarkText}}" />
<Setter Property="Shell.DisabledColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" />
<Setter Property="Shell.UnselectedColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray200}}" />
Expand Down
1 change: 0 additions & 1 deletion src/helpers/TrimmingHelper/Program.cs

This file was deleted.

29 changes: 0 additions & 29 deletions src/helpers/TrimmingHelper/TrimmingHelper.csproj

This file was deleted.

22 changes: 0 additions & 22 deletions src/helpers/TrimmingHelperApp/MauiProgram.cs

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions src/helpers/TrimmingHelperApp/Platforms/Android/MainActivity.cs

This file was deleted.

15 changes: 0 additions & 15 deletions src/helpers/TrimmingHelperApp/Platforms/Android/MainApplication.cs

This file was deleted.

This file was deleted.

66 changes: 0 additions & 66 deletions src/helpers/TrimmingHelperApp/TrimmingHelperApp.csproj

This file was deleted.

4 changes: 2 additions & 2 deletions src/libs/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<PropertyGroup Label="Nuget">
<Version>1.1.0</Version>
<Version>1.2.0</Version>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Authors>Oscore</Authors>
Expand All @@ -26,7 +26,7 @@
</ItemGroup>

<ItemGroup Label="Source Link">
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1">
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Loading

0 comments on commit 8e0dac7

Please sign in to comment.