We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4035

Summary: Allow Android Java shim to be built as an AAR
Product: SDL Reporter: Cole Campbell <cole.campbell>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2    
Version: don't know   
Hardware: All   
OS: Android (All)   
Attachments: Patch file which adds additional gradle project properties.

Description Cole Campbell 2018-01-10 04:55:08 UTC
Created attachment 3128 [details]
Patch file which adds additional gradle project properties.

When using SDL2 with Xamarin on Android, we need to build the project differently than we would if we were compiling native code directly into an APK. The attached patch adds two project properties to gradle.build:

1. BUILD_AS_LIBRARY which, when present, ignores the jni/src folder entirely and outputs an AAR file containing the Java shim project. The AAR is required to create a Xamarin Bindings Library, which we can use to inherit from SDLActivity within a C# project.

2. EXCLUDE_NATIVE_LIBS which prevents the shared object files from being placed into the resulting APK or AAR file. In Xamarin we include these elsewhere in the .NET project structure, so putting them in the AAR is redundant.
Comment 1 Sam Lantinga 2018-02-07 23:08:41 UTC
Added, thanks!
https://hg.libsdl.org/SDL/rev/934d77867168