Skip to content

Commit

Permalink
.NET 9 (#8)
Browse files Browse the repository at this point in the history
Updated the min/ target framework to .NET 9
  • Loading branch information
IeuanWalker authored Nov 19, 2024
1 parent c62aaf2 commit 4af0619
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 163 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [published]

env:
NET_VERSION: 7.0.101
NET_VERSION: 9.*.*
PROJECT_PATH: 'Scr/IeuanWalker.Maui.StateButton.csproj'
NUGET_PATH: './**/IeuanWalker.Maui.StateButton.${{ github.event.release.tag_name }}.nupkg'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- cron: '0 0 1 */3 *' # Every 3 months

env:
NET_VERSION: 7.0.101
NET_VERSION: 9.*.*
PROJECT_PATH: 'Scr/IeuanWalker.Maui.StateButton.csproj'
NUGET_PATH: './**/IeuanWalker.Maui.StateButton.1.0.0.nupkg'

Expand Down
165 changes: 43 additions & 122 deletions Demo/App.csproj
Original file line number Diff line number Diff line change
@@ -1,124 +1,45 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios;</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>App</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<PropertyGroup>
<TargetFrameworks>net9.0-android;net9.0-ios;</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>App</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<!-- Display name -->
<ApplicationTitle>StateButton demo</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>IeuanWalker.Demo.StateButton</ApplicationId>
<ApplicationIdGuid>78B8245A-7B57-41B6-A3BC-DA159DC85DE2</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net6.0-ios'">
<ProvisioningType>automatic</ProvisioningType>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
<CodesignKey>iPhone Distribution: CARDIFF COUNTY COUNCIL (RHSME4M265)</CodesignKey>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net7.0-ios'">
<CodesignKey>Apple Development: Ieuan Walker (R4SVVV33HW)</CodesignKey>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Fonts\fa-solid-900.ttf" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="1.2.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Scr\IeuanWalker.Maui.StateButton.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="Pages\AccessibilityTestPage.xaml.cs">
<DependentUpon>AccessibilityTestPage.xaml</DependentUpon>
</Compile>
<Compile Update="Pages\EventCommandPage.xaml.cs">
<DependentUpon>EventCommandPage.xaml</DependentUpon>
</Compile>
</ItemGroup>


<ItemGroup>
<MauiXaml Update="Controls\Examples\BackButton.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Controls\Examples\CustomButton.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Controls\Examples\Examle1.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Controls\Examples\Example2.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Controls\Examples\Example3.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Controls\Examples\Example4.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Controls\Examples\Example5.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Controls\Examples\Example6.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Controls\Examples\Example7.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Controls\Examples\Example8.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Pages\AccessibilityTestPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Pages\ButtonNotInScrollViewPage.xaml">
<Generator></Generator>
</MauiXaml>
<MauiXaml Update="Pages\ExamplePage.xaml">
<Generator></Generator>
</MauiXaml>
<MauiXaml Update="Pages\EventCommandPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>

</Project>
<!-- Display name -->
<ApplicationTitle>StateButton demo</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>IeuanWalker.Demo.StateButton</ApplicationId>
<ApplicationIdGuid>78B8245A-7B57-41B6-A3BC-DA159DC85DE2</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\Fonts\fa-solid-900.ttf" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="1.2.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Scr\IeuanWalker.Maui.StateButton.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Demo/App.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<Application x:Class="App.App"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Expand Down
2 changes: 1 addition & 1 deletion Demo/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="App.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Expand Down
2 changes: 1 addition & 1 deletion Demo/Pages/AccessibilityTestPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="App.Pages.AccessibilityTestPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Expand Down
2 changes: 1 addition & 1 deletion Demo/Pages/ButtonNotInScrollViewPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="App.Pages.ButtonNotInScrollViewPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Expand Down
2 changes: 1 addition & 1 deletion Demo/Pages/ExamplePage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="App.Pages.ExamplePage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Expand Down
1 change: 1 addition & 0 deletions Demo/Platforms/Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Android.App;
using Android.Content.PM;
using Microsoft.Maui;

namespace App;

Expand Down
1 change: 1 addition & 0 deletions Demo/Platforms/iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Foundation;
using Microsoft.Maui;

namespace App;

Expand Down
2 changes: 1 addition & 1 deletion Demo/Resources/Styles/Colors.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Color x:Key="BackgroundColour">#FFFFFF</Color>
Expand Down
2 changes: 1 addition & 1 deletion Demo/Resources/Styles/Styles.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Style ApplyToDerivedTypes="True" TargetType="ContentPage">
Expand Down
56 changes: 25 additions & 31 deletions Scr/IeuanWalker.Maui.StateButton.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net7.0-android;net7.0-ios;</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<PropertyGroup>
<TargetFrameworks>net9.0;net9.0-android;net9.0-ios;</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
</PropertyGroup>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup>
<GitInfoReportImportance>high</GitInfoReportImportance>
<PackageId>IeuanWalker.Maui.StateButton</PackageId>
Expand All @@ -23,7 +20,8 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/IeuanWalker/Maui.StateButton</PackageProjectUrl>
<RepositoryUrl>https://github.com/IeuanWalker/Maui.StateButton</RepositoryUrl>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageReleaseNotes>
</PackageReleaseNotes>
<DefineConstants>$(DefineConstants);</DefineConstants>
<UseFullSemVerForNuGet>false</UseFullSemVerForNuGet>
<Title>State button for .NET MAUI</Title>
Expand All @@ -38,38 +36,34 @@
<PackageTags>maui, control, button, flexible, custom, accessible</PackageTags>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
<None Include="icon.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<MauiXaml Update="StateButton.xaml">
<Generator></Generator>
</MauiXaml>
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-ios')) != true">
<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<MauiXaml Update="StateButton.xaml">
<Generator>
</Generator>
</MauiXaml>
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net9.0-ios')) != true">
<Compile Remove="**\**\*.ios.cs" />
<None Include="**\**\*.ios.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('MonoAndroid')) != true AND $(TargetFramework.StartsWith('net7.0-android')) != true">
<ItemGroup Condition="$(TargetFramework.StartsWith('MonoAndroid')) != true AND $(TargetFramework.StartsWith('net9.0-android')) != true">
<Compile Remove="**\**\*.android.cs" />
<None Include="**\**\*.android.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup>
<ItemGroup Condition="!($(TargetFramework.StartsWith('net')) == true AND $(TargetFramework.EndsWith('.0')) == true AND $(TargetFramework.Contains('-')) != true)">
<Compile Remove="**\**\*.net.cs" />
<None Include="**\**\*.net.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion Scr/StateButton.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<Border x:Class="IeuanWalker.Maui.StateButton.StateButton"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Expand Down

0 comments on commit 4af0619

Please sign in to comment.