From 411afb380419f1551cc81358fd24143e25b905c0 Mon Sep 17 00:00:00 2001 From: minisbett <39670899+minisbett@users.noreply.github.com> Date: Thu, 5 Feb 2026 14:44:03 +0100 Subject: [PATCH 1/3] Include *all* resources in ILLink substitutions --- osu.Native/ILLink.Substitutions.xml | 294 ++++++++++++++++++++++++---- 1 file changed, 256 insertions(+), 38 deletions(-) diff --git a/osu.Native/ILLink.Substitutions.xml b/osu.Native/ILLink.Substitutions.xml index 4c86634..00c257e 100644 --- a/osu.Native/ILLink.Substitutions.xml +++ b/osu.Native/ILLink.Substitutions.xml @@ -1,40 +1,258 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 4273c95572d04f4b2bdbe5199046a2b57995285a Mon Sep 17 00:00:00 2001 From: minisbett <39670899+minisbett@users.noreply.github.com> Date: Thu, 5 Feb 2026 14:44:37 +0100 Subject: [PATCH 2/3] Add (commented out) further binary size optimizations --- osu.Native/osu.Native.csproj | 67 +++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/osu.Native/osu.Native.csproj b/osu.Native/osu.Native.csproj index 25cbad6..db2a2c3 100644 --- a/osu.Native/osu.Native.csproj +++ b/osu.Native/osu.Native.csproj @@ -1,42 +1,45 @@  - - net10.0 - enable - true - enable + + net10.0 + enable + true + enable - - true - Size - false + + true + Size + false + - - true - true + + true + true - true - + true + - - - - + + + - - - + + + - - - - - - - - - all - - + + + + + + + + + all + + From 692c00173c4034826c2a0539f3162c2dea7275e5 Mon Sep 17 00:00:00 2001 From: minisbett <39670899+minisbett@users.noreply.github.com> Date: Thu, 5 Feb 2026 14:45:02 +0100 Subject: [PATCH 3/3] some minor formatting changes --- Test/Program.cs | 6 +- Test/Test.csproj | 21 ++++--- ...tor.cs => DynamicDependenciesGenerator.cs} | 2 +- .../osu.Native.Analyzers.csproj | 20 +++---- osu.Native.Tests/osu.Native.Tests.csproj | 57 +++++++++---------- osu.Native/ILLink.Substitutions.xml | 1 - osu.Native/osu.Native.csproj | 6 ++ 7 files changed, 59 insertions(+), 54 deletions(-) rename osu.Native.Analyzers/{DynamicDependencyGenerator.cs => DynamicDependenciesGenerator.cs} (98%) diff --git a/Test/Program.cs b/Test/Program.cs index 8bc428f..aa69b0a 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -7,7 +7,9 @@ unsafe { - Native.Beatmap_CreateFromFile(@"C:\Users\mini\Desktop\test.osu", out NativeBeatmap nativeBeatmap); + int error = Native.Beatmap_CreateFromFile(@"C:\Users\mini\Desktop\test.osu", out NativeBeatmap nativeBeatmap); + Console.WriteLine($"Error code: {error}"); + Console.WriteLine($"Error message: {Native.ErrorHandler_GetLastMessage()}"); Console.WriteLine($"ID: {nativeBeatmap.Handle}"); Console.WriteLine($"Ruleset ID: {nativeBeatmap.RulesetId}"); Console.WriteLine($"AR: {nativeBeatmap.ApproachRate}"); @@ -21,7 +23,7 @@ nativeBeatmap.Handle = 2; int size; - int error = Native.Beatmap_GetTitle(nativeBeatmap.Handle, null, &size); + error = Native.Beatmap_GetTitle(nativeBeatmap.Handle, null, &size); Console.WriteLine($"Error code: {error}"); Console.WriteLine($"Error message: {Native.ErrorHandler_GetLastMessage()}"); diff --git a/Test/Test.csproj b/Test/Test.csproj index e7a25aa..91527e5 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -1,15 +1,14 @@  - - Exe - net9.0 - enable - enable - true - - - - - + + Exe + net9.0 + enable + enable + true + + + + diff --git a/osu.Native.Analyzers/DynamicDependencyGenerator.cs b/osu.Native.Analyzers/DynamicDependenciesGenerator.cs similarity index 98% rename from osu.Native.Analyzers/DynamicDependencyGenerator.cs rename to osu.Native.Analyzers/DynamicDependenciesGenerator.cs index 6c247a6..cb0079b 100644 --- a/osu.Native.Analyzers/DynamicDependencyGenerator.cs +++ b/osu.Native.Analyzers/DynamicDependenciesGenerator.cs @@ -8,7 +8,7 @@ namespace osu.Native.Analyzers; [Generator] -public class DynamicDependencyGenerator : IIncrementalGenerator +public class DynamicDependenciesGenerator : IIncrementalGenerator { public void Initialize(IncrementalGeneratorInitializationContext context) { diff --git a/osu.Native.Analyzers/osu.Native.Analyzers.csproj b/osu.Native.Analyzers/osu.Native.Analyzers.csproj index 9f75257..74672c0 100644 --- a/osu.Native.Analyzers/osu.Native.Analyzers.csproj +++ b/osu.Native.Analyzers/osu.Native.Analyzers.csproj @@ -1,14 +1,14 @@  - - netstandard2.0 - latest - Analyzer - true - + + netstandard2.0 + latest + Analyzer + true + - - - - + + + + diff --git a/osu.Native.Tests/osu.Native.Tests.csproj b/osu.Native.Tests/osu.Native.Tests.csproj index 65fb357..aa9670a 100644 --- a/osu.Native.Tests/osu.Native.Tests.csproj +++ b/osu.Native.Tests/osu.Native.Tests.csproj @@ -1,37 +1,36 @@  - - net10.0 - enable - true - enable - + + net10.0 + enable + true + enable + - - - + + + - - - - - - - + + + + + + + - - - + + + - - - Always - osu.Native-aot.dll - - - - - - + + + Always + osu.Native-aot.dll + + + + + diff --git a/osu.Native/ILLink.Substitutions.xml b/osu.Native/ILLink.Substitutions.xml index 00c257e..711aa67 100644 --- a/osu.Native/ILLink.Substitutions.xml +++ b/osu.Native/ILLink.Substitutions.xml @@ -1,5 +1,4 @@  - diff --git a/osu.Native/osu.Native.csproj b/osu.Native/osu.Native.csproj index db2a2c3..04d5653 100644 --- a/osu.Native/osu.Native.csproj +++ b/osu.Native/osu.Native.csproj @@ -14,6 +14,12 @@ true true--> + true + full + false + true + + true true