mirror of https://github.com/encounter/SDL.git
Allow Android Java shim to be built as an AAR
This commit is contained in:
parent
940933d892
commit
b401cfd915
|
@ -1,10 +1,19 @@
|
||||||
apply plugin: 'com.android.application'
|
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
|
||||||
|
def buildAsApplication = !buildAsLibrary
|
||||||
|
if (buildAsApplication) {
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
apply plugin: 'com.android.library'
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 16
|
compileSdkVersion 16
|
||||||
buildToolsVersion "26.0.1"
|
buildToolsVersion "26.0.1"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
if (buildAsApplication) {
|
||||||
applicationId "org.libsdl.app"
|
applicationId "org.libsdl.app"
|
||||||
|
}
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 16
|
targetSdkVersion 16
|
||||||
versionCode 1
|
versionCode 1
|
||||||
|
@ -22,6 +31,7 @@ android {
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
|
||||||
sourceSets.main {
|
sourceSets.main {
|
||||||
jniLibs.srcDir 'libs'
|
jniLibs.srcDir 'libs'
|
||||||
}
|
}
|
||||||
|
@ -30,9 +40,23 @@ android {
|
||||||
path 'jni/Android.mk'
|
path 'jni/Android.mk'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
lintOptions {
|
lintOptions {
|
||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (buildAsLibrary) {
|
||||||
|
libraryVariants.all { variant ->
|
||||||
|
variant.outputs.each { output ->
|
||||||
|
def outputFile = output.outputFile
|
||||||
|
if (outputFile != null && outputFile.name.endsWith(".aar")) {
|
||||||
|
def fileName = "org.libsdl.app.aar";
|
||||||
|
output.outputFile = new File(outputFile.parent, fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
Loading…
Reference in New Issue