Skip to content

Commit

Permalink
Bump minimal TFM for mobile projects from .NET 6 to .NET 7… (#13012)
Browse files Browse the repository at this point in the history
* Bump minimal TFM for mobile projects from .NET 6 to .NET 7 because of MAUI support policy

* Fix api diff
  • Loading branch information
maxkatz6 authored Sep 25, 2023
1 parent 5113b70 commit 3de2a0e
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 55 deletions.
13 changes: 12 additions & 1 deletion nukebuild/ApiDiffValidation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ public static class ApiDiffValidation
{
private static readonly HttpClient s_httpClient = new();

private static readonly Dictionary<(string target, string asmName), (string target, string asmName)> s_assemblyRedirects = new()
{
[("net6.0-android31.0", "Avalonia.Android.dll")] = ("net7.0-android33.0", "Avalonia.Android.dll"),
[("net6.0-ios16.1", "Avalonia.iOS.dll")] = ("net7.0-ios16.1", "Avalonia.iOS.dll")
};

public static async Task ValidatePackage(
Tool apiCompatTool, string packagePath, string baselineVersion,
string suppressionFilesFolder, bool updateSuppressionFile)
Expand Down Expand Up @@ -58,8 +64,13 @@ public static async Task ValidatePackage(
await baselineDll.entry.Open().CopyToAsync(baselineDllFile);
}

if (!s_assemblyRedirects.TryGetValue((baselineDll.target, baselineDll.entry.Name), out var lookupPair))
{
lookupPair = (baselineDll.target, baselineDll.entry.Name);
}

var targetDll = targetDlls.FirstOrDefault(e =>
e.target == baselineDll.target && e.entry.Name == baselineDll.entry.Name);
e.target == lookupPair.target && e.entry.Name == lookupPair.asmName);
if (targetDll.entry is null)
{
throw new InvalidOperationException($"Some assemblies are missing in the new package {packageId}: {baselineDll.entry.Name} for {baselineDll.target}");
Expand Down
18 changes: 1 addition & 17 deletions samples/ControlCatalog.Android/ControlCatalog.Android.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-android</TargetFramework>
<TargetFramework>net7.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
Expand All @@ -10,28 +10,12 @@
<AndroidPackageFormat>apk</AndroidPackageFormat>
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\drawable-night-v31\avalonia_anim.xml" />
<None Remove="Resources\drawable-v31\avalonia_anim.xml" />
<None Remove="Resources\values-v31\styles.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="..\..\build\Assets\Icon.png">
<Link>Resources\drawable\Icon.png</Link>
</AndroidResource>
</ItemGroup>

<PropertyGroup Condition="'$(RunAOTCompilation)'=='' and '$(Configuration)'=='Release' and '$(TF_BUILD)'==''">
<RunAOTCompilation>True</RunAOTCompilation>
</PropertyGroup>

<!-- PropertyGroup Condition="'$(RunAOTCompilation)'=='True'">
<EnableLLVM>True</EnableLLVM>
<AndroidAotAdditionalArguments>no-write-symbols,nodebug</AndroidAotAdditionalArguments>
<AndroidAotMode>Hybrid</AndroidAotMode>
<AndroidGenerateJniMarshalMethods>True</AndroidGenerateJniMarshalMethods>
</PropertyGroup -->

<PropertyGroup Condition="'$(AndroidEnableProfiler)'=='True'">
<IsEmulator Condition="'$(IsEmulator)' == ''">True</IsEmulator>
<DebugSymbols>True</DebugSymbols>
Expand Down
9 changes: 1 addition & 8 deletions samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<ProvisioningType>manual</ProvisioningType>
<TargetFramework>net6.0-ios</TargetFramework>
<TargetFramework>net7.0-ios</TargetFramework>
<SupportedOSPlatformVersion>13.0</SupportedOSPlatformVersion>
<!-- temporal workaround for our GL interface backend -->
<UseInterpreter>True</UseInterpreter>
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
<!-- <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>-->
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\iOS\Avalonia.iOS\Avalonia.iOS.csproj" />
Expand Down
19 changes: 1 addition & 18 deletions samples/MobileSandbox.Android/MobileSandbox.Android.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-android</TargetFramework>
<TargetFramework>net7.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
Expand All @@ -10,29 +10,12 @@
<AndroidPackageFormat>apk</AndroidPackageFormat>
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\drawable-night-v31\avalonia_anim.xml" />
<None Remove="Resources\drawable-v31\avalonia_anim.xml" />
<None Remove="Resources\values-v31\styles.xml" />
<None Remove="Resources\values-night\colors.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="..\..\build\Assets\Icon.png">
<Link>Resources\drawable\Icon.png</Link>
</AndroidResource>
</ItemGroup>

<PropertyGroup Condition="'$(RunAOTCompilation)'=='' and '$(Configuration)'=='Release' and '$(TF_BUILD)'==''">
<RunAOTCompilation>True</RunAOTCompilation>
</PropertyGroup>

<!-- PropertyGroup Condition="'$(RunAOTCompilation)'=='True'">
<EnableLLVM>True</EnableLLVM>
<AndroidAotAdditionalArguments>no-write-symbols,nodebug</AndroidAotAdditionalArguments>
<AndroidAotMode>Hybrid</AndroidAotMode>
<AndroidGenerateJniMarshalMethods>True</AndroidGenerateJniMarshalMethods>
</PropertyGroup -->

<PropertyGroup Condition="'$(AndroidEnableProfiler)'=='True'">
<IsEmulator Condition="'$(IsEmulator)' == ''">True</IsEmulator>
<DebugSymbols>True</DebugSymbols>
Expand Down
4 changes: 0 additions & 4 deletions samples/MobileSandbox.iOS/MobileSandbox.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
<ProvisioningType>manual</ProvisioningType>
<TargetFramework>net6.0-ios</TargetFramework>
<SupportedOSPlatformVersion>13.0</SupportedOSPlatformVersion>
<!-- temporal workaround for our GL interface backend -->
<UseInterpreter>True</UseInterpreter>
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
<!-- <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>-->
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\iOS\Avalonia.iOS\Avalonia.iOS.csproj" />
Expand Down
6 changes: 1 addition & 5 deletions samples/SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
<SupportedOSPlatformVersion>10.0</SupportedOSPlatformVersion>
<ProvisioningType>manual</ProvisioningType>
<Nullable>enable</Nullable>
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>

<!-- These properties need to be set in order to run on a real iDevice -->
<!--<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>-->
<!--<CodesignKey></CodesignKey>-->
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\SafeAreaDemo\SafeAreaDemo.csproj" />
<ProjectReference Include="..\..\src\iOS\Avalonia.iOS\Avalonia.iOS.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/Android/Avalonia.Android/Avalonia.Android.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-android</TargetFramework>
<TargetFramework>net7.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver>
Expand Down
2 changes: 1 addition & 1 deletion src/iOS/Avalonia.iOS/Avalonia.iOS.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-ios</TargetFramework>
<TargetFramework>net7.0-ios</TargetFramework>
<SupportedOSPlatformVersion>13.0</SupportedOSPlatformVersion>
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver>
</PropertyGroup>
Expand Down

0 comments on commit 3de2a0e

Please sign in to comment.