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