2018-01-10 00:11:34 +00:00
|
|
|
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
|
|
|
|
def buildAsApplication = !buildAsLibrary
|
|
|
|
if (buildAsApplication) {
|
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
apply plugin: 'com.android.library'
|
|
|
|
}
|
2017-10-23 22:23:43 +00:00
|
|
|
|
|
|
|
android {
|
2018-08-22 03:46:25 +00:00
|
|
|
compileSdkVersion 26
|
2017-10-23 22:23:43 +00:00
|
|
|
defaultConfig {
|
2018-01-10 00:11:34 +00:00
|
|
|
if (buildAsApplication) {
|
|
|
|
applicationId "org.libsdl.app"
|
|
|
|
}
|
2017-10-24 06:23:47 +00:00
|
|
|
minSdkVersion 14
|
2018-08-22 03:46:25 +00:00
|
|
|
targetSdkVersion 26
|
2017-10-23 22:23:43 +00:00
|
|
|
versionCode 1
|
|
|
|
versionName "1.0"
|
2017-10-24 06:23:47 +00:00
|
|
|
externalNativeBuild {
|
|
|
|
ndkBuild {
|
|
|
|
arguments "APP_PLATFORM=android-14"
|
2018-10-28 17:31:06 +00:00
|
|
|
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
2017-10-24 06:23:47 +00:00
|
|
|
}
|
|
|
|
}
|
2017-10-23 22:23:43 +00:00
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
2018-01-10 00:11:34 +00:00
|
|
|
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
|
|
|
|
sourceSets.main {
|
|
|
|
jniLibs.srcDir 'libs'
|
|
|
|
}
|
|
|
|
externalNativeBuild {
|
|
|
|
ndkBuild {
|
|
|
|
path 'jni/Android.mk'
|
|
|
|
}
|
2017-10-24 06:23:47 +00:00
|
|
|
}
|
2018-01-10 00:11:34 +00:00
|
|
|
|
2017-10-23 22:23:43 +00:00
|
|
|
}
|
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
|
|
|
}
|
2018-01-10 00:11:34 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-10-23 22:23:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2018-10-28 17:31:06 +00:00
|
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
2018-02-12 02:23:37 +00:00
|
|
|
}
|