2018-01-09 17:11:34 -07: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 16:23:43 -06:00
|
|
|
|
|
|
|
android {
|
2021-11-15 18:04:50 -07:00
|
|
|
compileSdkVersion 31
|
2017-10-23 16:23:43 -06:00
|
|
|
defaultConfig {
|
2018-01-09 17:11:34 -07:00
|
|
|
if (buildAsApplication) {
|
|
|
|
applicationId "org.libsdl.app"
|
|
|
|
}
|
2019-01-16 01:11:13 -07:00
|
|
|
minSdkVersion 16
|
2021-11-15 18:04:50 -07:00
|
|
|
targetSdkVersion 31
|
2017-10-23 16:23:43 -06:00
|
|
|
versionCode 1
|
|
|
|
versionName "1.0"
|
2017-10-24 00:23:47 -06:00
|
|
|
externalNativeBuild {
|
|
|
|
ndkBuild {
|
2019-01-16 01:11:13 -07:00
|
|
|
arguments "APP_PLATFORM=android-16"
|
2023-06-20 10:18:19 -06:00
|
|
|
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
|
|
|
abiFilters 'arm64-v8a'
|
|
|
|
}
|
|
|
|
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 00:23:47 -06:00
|
|
|
}
|
|
|
|
}
|
2017-10-23 16:23:43 -06:00
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
2022-03-15 21:34:27 -06:00
|
|
|
applicationVariants.all { variant ->
|
|
|
|
tasks["merge${variant.name.capitalize()}Assets"]
|
|
|
|
.dependsOn("externalNativeBuild${variant.name.capitalize()}")
|
|
|
|
}
|
2018-01-09 17:11:34 -07:00
|
|
|
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
|
|
|
|
sourceSets.main {
|
|
|
|
jniLibs.srcDir 'libs'
|
|
|
|
}
|
|
|
|
externalNativeBuild {
|
|
|
|
ndkBuild {
|
|
|
|
path 'jni/Android.mk'
|
|
|
|
}
|
2019-08-11 07:23:37 -06:00
|
|
|
// cmake {
|
|
|
|
// path 'jni/CMakeLists.txt'
|
|
|
|
// }
|
2017-10-24 00:23:47 -06:00
|
|
|
}
|
2018-01-09 17:11:34 -07:00
|
|
|
|
2017-10-23 16:23:43 -06:00
|
|
|
}
|
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
|
|
|
}
|
2018-01-09 17:11:34 -07: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 16:23:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2018-10-28 11:31:06 -06:00
|
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
2018-02-11 19:23:37 -07:00
|
|
|
}
|