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 - Allow Android Java shim to be built as an AAR
Summary: Allow Android Java shim to be built as an AAR
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: don't know
Hardware: All Android (All)
: P2 enhancement
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-10 04:55 UTC by Cole Campbell
Modified: 2018-02-07 23:08 UTC (History)
0 users

See Also:


Attachments
Patch file which adds additional gradle project properties. (2.26 KB, text/plain)
2018-01-10 04:55 UTC, Cole Campbell
Details

Note You need to log in before you can comment on or make changes to this bug.
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