Skip to content

Commit 78895ac

Browse files
committed
add net9.0 targets
* and update minimum OS versions of iOS and Mac * we need to use $MauiVersion, in order to select the appropriate MAUI version for .NET 8 and .NET9, respectively * also we fix one incompatibility in the source code
1 parent b4f11fd commit 78895ac

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

Source/OxyPlot.Maui.Skia/OxyPlot.Maui.Skia.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net8.0-android34.0</TargetFrameworks>
5-
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('linux'))">$(TargetFrameworks);net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
6-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net8.0-android34.0;net9.0;net9.0-android</TargetFrameworks>
5+
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('linux'))">$(TargetFrameworks);net8.0-ios;net8.0-maccatalyst;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
6+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</TargetFrameworks>
77
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
88
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
99
<UseMaui>true</UseMaui>
1010
<SingleProject>true</SingleProject>
1111
<ImplicitUsings>enable</ImplicitUsings>
1212

13-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
14-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
13+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.2</SupportedOSPlatformVersion>
14+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
1515
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
1616
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
1717
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
@@ -30,19 +30,16 @@
3030
<RepositoryUrl>https://github.com/oxyplot/oxyplot-maui</RepositoryUrl>
3131
</PropertyGroup>
3232

33-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios|AnyCPU'">
33+
<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and $(Configuration)=='Debug'">
3434
<CreatePackage>false</CreatePackage>
3535
</PropertyGroup>
3636
<ItemGroup>
37+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
3738
<PackageReference Include="OxyPlot.Core" Version="2.2.0" />
3839
<PackageReference Include="SkiaSharp.HarfBuzz" Version="2.88.8" />
3940
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="2.88.8" />
4041
</ItemGroup>
4142

42-
<ItemGroup Condition=" $(TargetFramework.StartsWith('net8.0')) ">
43-
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" />
44-
</ItemGroup>
45-
4643
<ItemGroup>
4744
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
4845
<None Include="..\..\icon.png" Pack="true" PackagePath="\" />

Source/OxyPlot.Maui.Skia/Tracker/TrackerControl.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,11 @@ private void UpdatePositionAndBorder()
372372

373373
var canvasWidth = parent.Width;
374374
var canvasHeight = parent.Height;
375+
#if NET9_0_OR_GREATER
376+
var contentSize = content.Measure(canvasWidth, canvasHeight);
377+
#else
375378
var contentSize = content.Measure(canvasWidth, canvasHeight).Request;
379+
#endif
376380

377381
var contentWidth = contentSize.Width;
378382
var contentHeight = contentSize.Height;

Source/OxyplotMauiSample/OxyplotMauiSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
<ItemGroup>
6767
<PackageReference Include="OxyPlot.ExampleLibrary" Version="2.2.0" />
68-
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" />
68+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
6969
</ItemGroup>
7070

7171
<ItemGroup>

0 commit comments

Comments
 (0)