2020-04-15 16:27:40 +02:00
|
|
|
apply plugin: 'com.android.library'
|
2020-05-24 12:55:48 +02:00
|
|
|
apply plugin: 'de.undercouch.download'
|
2020-04-15 16:27:40 +02:00
|
|
|
|
|
|
|
android {
|
2021-11-27 01:10:13 +01:00
|
|
|
compileSdkVersion 30
|
2021-01-20 23:31:59 +01:00
|
|
|
buildToolsVersion '30.0.3'
|
2021-10-31 23:32:25 +01:00
|
|
|
ndkVersion "$ndk_version"
|
2020-04-15 16:27:40 +02:00
|
|
|
defaultConfig {
|
|
|
|
minSdkVersion 16
|
2021-11-27 01:10:13 +01:00
|
|
|
targetSdkVersion 30
|
2020-04-15 16:27:40 +02:00
|
|
|
externalNativeBuild {
|
|
|
|
ndkBuild {
|
2020-05-24 12:55:48 +02:00
|
|
|
arguments '-j' + Runtime.getRuntime().availableProcessors(),
|
2020-04-15 16:27:40 +02:00
|
|
|
"versionMajor=${versionMajor}",
|
|
|
|
"versionMinor=${versionMinor}",
|
|
|
|
"versionPatch=${versionPatch}",
|
|
|
|
"versionExtra=${versionExtra}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
externalNativeBuild {
|
|
|
|
ndkBuild {
|
|
|
|
path file('jni/Android.mk')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// supported architectures
|
|
|
|
splits {
|
|
|
|
abi {
|
|
|
|
enable true
|
|
|
|
reset()
|
|
|
|
include 'armeabi-v7a', 'arm64-v8a'//, 'x86'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
externalNativeBuild {
|
|
|
|
ndkBuild {
|
|
|
|
arguments 'NDEBUG=1'
|
|
|
|
}
|
|
|
|
}
|
2021-10-15 18:14:48 +02:00
|
|
|
|
|
|
|
ndk {
|
|
|
|
debugSymbolLevel 'SYMBOL_TABLE'
|
|
|
|
}
|
2020-04-15 16:27:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-24 12:55:48 +02:00
|
|
|
// get precompiled deps
|
|
|
|
task downloadDeps(type: Download) {
|
2021-10-31 23:32:25 +01:00
|
|
|
src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps.zip'
|
2020-05-24 12:55:48 +02:00
|
|
|
dest new File(buildDir, 'deps.zip')
|
|
|
|
overwrite false
|
|
|
|
}
|
|
|
|
|
|
|
|
task getDeps(dependsOn: downloadDeps, type: Copy) {
|
2021-10-31 23:32:25 +01:00
|
|
|
def deps = new File(buildDir.parent, 'deps')
|
|
|
|
if (!deps.exists()) {
|
|
|
|
deps.mkdir()
|
2020-05-24 12:55:48 +02:00
|
|
|
from zipTree(downloadDeps.dest)
|
2021-10-31 23:32:25 +01:00
|
|
|
into deps
|
2020-04-15 16:27:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-24 12:55:48 +02:00
|
|
|
preBuild.dependsOn getDeps
|