mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 11:33:44 +01:00
fb3085a2c5
Build Tools, NDK, and Gradle are also updated. Repositories is changed from jcenter() to mavenCentral().
70 lines
1.3 KiB
Groovy
70 lines
1.3 KiB
Groovy
apply plugin: 'com.android.library'
|
|
apply plugin: 'de.undercouch.download'
|
|
|
|
android {
|
|
compileSdkVersion 32
|
|
buildToolsVersion '32.0.0'
|
|
ndkVersion "$ndk_version"
|
|
defaultConfig {
|
|
minSdkVersion 16
|
|
targetSdkVersion 32
|
|
externalNativeBuild {
|
|
ndkBuild {
|
|
arguments '-j' + Runtime.getRuntime().availableProcessors(),
|
|
"versionMajor=${versionMajor}",
|
|
"versionMinor=${versionMinor}",
|
|
"versionPatch=${versionPatch}",
|
|
"versionExtra=${versionExtra}",
|
|
"developmentBuild=${developmentBuild}"
|
|
}
|
|
}
|
|
}
|
|
|
|
externalNativeBuild {
|
|
ndkBuild {
|
|
path file('jni/Android.mk')
|
|
}
|
|
}
|
|
|
|
// supported architectures
|
|
splits {
|
|
abi {
|
|
enable true
|
|
reset()
|
|
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
externalNativeBuild {
|
|
ndkBuild {
|
|
arguments 'NDEBUG=1'
|
|
}
|
|
}
|
|
|
|
ndk {
|
|
debugSymbolLevel 'SYMBOL_TABLE'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// get precompiled deps
|
|
task downloadDeps(type: Download) {
|
|
src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps.zip'
|
|
dest new File(buildDir, 'deps.zip')
|
|
overwrite false
|
|
}
|
|
|
|
task getDeps(dependsOn: downloadDeps, type: Copy) {
|
|
def deps = new File(buildDir.parent, 'deps')
|
|
if (!deps.exists()) {
|
|
deps.mkdir()
|
|
from zipTree(downloadDeps.dest)
|
|
into deps
|
|
}
|
|
}
|
|
|
|
preBuild.dependsOn getDeps
|