From 8cf95c218c6070c2a47b9b2b833a49e03b04656f Mon Sep 17 00:00:00 2001 From: Dylan Perks Date: Sat, 28 Dec 2024 12:26:14 +0000 Subject: [PATCH] Include org.libsdl.app bindings with the aar, working package now --- Directory.Build.props | 1 + Directory.Build.targets | 59 ++++++++++++++++++- Silk.NET.sln | 7 +++ eng/native/nuget/NativeNuGetPackage.targets | 23 ++++++++ sources/SDL/Native/Silk.NET.SDL.Native.csproj | 19 ++++++ sources/SDL/Native/android/transform.xml | 16 +++++ sources/SDL/Native/build-android.sh | 1 + 7 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 eng/native/nuget/NativeNuGetPackage.targets create mode 100644 sources/SDL/Native/Silk.NET.SDL.Native.csproj create mode 100644 sources/SDL/Native/android/transform.xml diff --git a/Directory.Build.props b/Directory.Build.props index 6f11f88872..fcb83dee3d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -64,5 +64,6 @@ true SilkShippingControl;$(VersionDependsOn) SilkShippingControl;$(PackageVersionDependsOn) + SilkNativePackaging;$(TargetsForTfmSpecificContentInPackage) diff --git a/Directory.Build.targets b/Directory.Build.targets index 17da9d8da6..1f596d0fde 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -149,8 +149,8 @@ - false - NU5128 + false + NU5128;$(NoWarn) @@ -191,6 +191,22 @@ $(SilkVersion) $(SilkVersion)-$(VersionSuffix) + + + $(MSBuildProjectDirectory)/version.txt + $([System.IO.File]::ReadAllText("$(SilkVersionTxtPath)")) + + + + + + + + + + + + true @@ -200,4 +216,43 @@ full + + + + + + + + + + + + + + + + + + diff --git a/Silk.NET.sln b/Silk.NET.sln index 45994a9bfc..139e7f1fac 100644 --- a/Silk.NET.sln +++ b/Silk.NET.sln @@ -95,6 +95,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET", "sources\Core\Si EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Win32", "Win32", "{6E739132-EEAB-43A5-83C7-EB58C50D03A1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.SDL.Native", "sources\SDL\Native\Silk.NET.SDL.Native.csproj", "{F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -153,6 +155,10 @@ Global {6FA628B8-9696-4847-89F9-E58F470AF4FB}.Debug|Any CPU.Build.0 = Debug|Any CPU {6FA628B8-9696-4847-89F9-E58F470AF4FB}.Release|Any CPU.ActiveCfg = Release|Any CPU {6FA628B8-9696-4847-89F9-E58F470AF4FB}.Release|Any CPU.Build.0 = Release|Any CPU + {F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -182,6 +188,7 @@ Global {3CADD95A-179F-4ECF-A49D-4B753832C63C} = {475AEF7B-0154-4989-AF82-97E3A95A96AF} {6FA628B8-9696-4847-89F9-E58F470AF4FB} = {5CD096DB-6C44-48F1-9093-AD4C84B6B7EC} {6E739132-EEAB-43A5-83C7-EB58C50D03A1} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6} + {F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6} = {EC4D7B06-D277-4411-BD7B-71A6D37683F0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {78D2CF6A-60A1-43E3-837B-00B73C9DA384} diff --git a/eng/native/nuget/NativeNuGetPackage.targets b/eng/native/nuget/NativeNuGetPackage.targets new file mode 100644 index 0000000000..48b69cefe5 --- /dev/null +++ b/eng/native/nuget/NativeNuGetPackage.targets @@ -0,0 +1,23 @@ + + + + <_TO_BE_REPLACED_PROPERTY_PREFIX_IsMtouch Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' or $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst' or $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tvos'">true + + + + Static + True + True + False + TO_BE_REPLACED_MTOUCH_NATIVE_REFERENCE_LINKER_FLAGS + + + Static + True + True + False + TO_BE_REPLACED_MTOUCH_NATIVE_REFERENCE_LINKER_FLAGS + + + diff --git a/sources/SDL/Native/Silk.NET.SDL.Native.csproj b/sources/SDL/Native/Silk.NET.SDL.Native.csproj new file mode 100644 index 0000000000..fe8ba07669 --- /dev/null +++ b/sources/SDL/Native/Silk.NET.SDL.Native.csproj @@ -0,0 +1,19 @@ + + + + net8.0;net8.0-android + $(TargetFrameworks);net8.0-ios + enable + enable + Native binaries for SDL3. + true + true + -framework AudioToolbox -framework AVFoundation -framework CoreAudio -framework CoreBluetooth -framework CoreFoundation -framework CoreGraphics -framework CoreHaptics -framework CoreMotion -framework CoreVideo -framework GameController -framework IOKit -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit -framework Foundation + false + false + 1591 + false + true + + + diff --git a/sources/SDL/Native/android/transform.xml b/sources/SDL/Native/android/transform.xml new file mode 100644 index 0000000000..ca675b659c --- /dev/null +++ b/sources/SDL/Native/android/transform.xml @@ -0,0 +1,16 @@ + + + + + + + + true + true + true + diff --git a/sources/SDL/Native/build-android.sh b/sources/SDL/Native/build-android.sh index ededa65723..7b2714e6c8 100755 --- a/sources/SDL/Native/build-android.sh +++ b/sources/SDL/Native/build-android.sh @@ -21,3 +21,4 @@ cp ../../../eng/submodules/sdl/install-android/x86-install/lib/libSDL3.so runtim cp ../../../eng/submodules/sdl/install-android/x86_64-install/lib/libSDL3.so runtimes/android-x64/native jars=( ../../../eng/submodules/sdl/install-android/armeabi-v7a-install/share/java/SDL3/SDL3-*.jar ) cp "${jars[1]}" android/SDL3.jar +cp "$(dirname "${jars[1]}")/proguard.txt" android/proguard.txt