|
5 | 5 | <AndroidPackageFormat>apk</AndroidPackageFormat> |
6 | 6 | <MandroidI18n>CJK;Mideast;Rare;West;Other;</MandroidI18n> |
7 | 7 | <AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidMessageHandler</AndroidHttpClientHandlerType> |
8 | | - <!-- NullabilityInfoContextSupport is disabled by default for Android --> |
9 | 8 | <NullabilityInfoContextSupport>true</NullabilityInfoContextSupport> |
10 | 9 | <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk> |
| 10 | + |
| 11 | + <!-- Suppress XA1006 warning (TargetFrameworkVersion vs targetSdkVersion) --> |
| 12 | + <NoWarn>$(NoWarn);XA1006</NoWarn> |
| 13 | + <MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);XA1006</MSBuildWarningsAsMessages> |
| 14 | + |
11 | 15 | <!-- Suppress XA0141 page-size warnings during build. The actual .so files are patched |
12 | 16 | to 16 KB alignment by build/PatchElfPageSize.targets, but the SDK check runs before |
13 | 17 | the patch in some build orderings. This suppression is harmless since we do fix them. --> |
14 | 18 | <AndroidPageSize16KBCompatibilityCheck>false</AndroidPageSize16KBCompatibilityCheck> |
15 | 19 | </PropertyGroup> |
16 | 20 |
|
17 | | - <!-- Patch NuGet-provided .so files that ship with 4 KB ELF alignment to 16 KB. |
18 | | - See build/PatchElfPageSize.targets for details. |
19 | | - TODO: Remove once ppy.Veldrid.SPIRV ships 16 KB-aligned native libraries. --> |
20 | 21 | <Import Project="$(MSBuildThisFileDirectory)build\PatchElfPageSize.targets" /> |
21 | 22 |
|
22 | | - <!-- Release-only optimisations: AOT for low-latency gameplay, trimming for smaller APK. |
23 | | - Suppress trim analysis warnings because the project uses reflection extensively |
24 | | - (Newtonsoft.Json, Realm, AutoMapper, RuntimeBinder). --> |
25 | 23 | <PropertyGroup Condition="'$(Configuration)' == 'Release'"> |
26 | 24 | <RunAOTCompilation>true</RunAOTCompilation> |
27 | 25 | <AndroidEnableProfiledAot>true</AndroidEnableProfiledAot> |
|
32 | 30 | </PropertyGroup> |
33 | 31 |
|
34 | 32 | <ItemGroup Condition="'$(Configuration)' == 'Release'"> |
35 | | - <!-- Force Microsoft.CSharp into the trimmer input graph (.NET 10+). --> |
36 | | - <!-- A bare TrimmerRootAssembly is ignored if the assembly is not in the --> |
37 | | - <!-- linker's input set; adding this reference ensures it is included. --> |
38 | 33 | <PackageReference Include="Microsoft.CSharp" Version="4.7.0" NoWarn="NU1510" /> |
39 | 34 | <TrimmerRootAssembly Include="Microsoft.CSharp" RootMode="all" /> |
40 | 35 | </ItemGroup> |
41 | 36 |
|
42 | 37 | <ItemGroup> |
43 | | - <!-- IMPORTANT: ppy.osu.Framework.Android v2026.318.0 only ships net8.0-android34.0 assets. |
44 | | - NuGet silently falls back to those assets when the app targets net10.0-android (API 36). |
45 | | - This is safe because .NET guarantees backward compatibility for loading net8.0 assemblies |
46 | | - in a net10.0 runtime, and Android API changes between 34→36 are additive. |
47 | | - TODO: Remove this comment once ppy.osu.Framework.Android ships net10.0-android assets. --> |
48 | 38 | <PackageReference Include="ppy.osu.Framework.Android" Version="2026.318.0" /> |
49 | 39 | </ItemGroup> |
50 | 40 |
|
51 | 41 | <PropertyGroup> |
52 | | - <!-- Fody does not handle Android build well, and warns when unchanged. |
53 | | - Since Realm objects are not declared directly in Android projects, simply disable Fody. --> |
54 | 42 | <DisableFody>true</DisableFody> |
55 | 43 | </PropertyGroup> |
56 | 44 |
|
57 | | - <!-- Fix for .NET 10 Android AOT misclassifying non-managed assets in runtime pack. |
58 | | - This is critical for Android 16 (API 36) which has stricter manifest/parsing rules. --> |
59 | 45 | <Target Name="FixRuntimePackAssetTypes" AfterTargets="ResolveRuntimePackAssets;ComputeFilesToPublish"> |
60 | 46 | <ItemGroup> |
61 | 47 | <RuntimePackAsset Update="@(RuntimePackAsset)" Condition="'%(Extension)' != '.dll'"> |
|
0 commit comments