mirror of
https://github.com/minetest/minetest.git
synced 2024-12-29 17:37:30 +01:00
4ab3c54f5b
Until we're able to detect touchscreen itself, let's have a detection based on a form factor of the device. Tablets and handhelds are usually equiped with touchscreens, so as a default enable touchscreen GUI there. - Windows and Linux supports autodetection. - Android is hardcoded as touch-based. - MacOS staying same as before without detection. Signed-off-by: David Heidelberg <david@ixit.cz>
73 lines
1.4 KiB
Groovy
73 lines
1.4 KiB
Groovy
apply plugin: 'com.android.library'
|
|
apply plugin: 'de.undercouch.download'
|
|
|
|
android {
|
|
compileSdkVersion 33
|
|
buildToolsVersion '33.0.2'
|
|
ndkVersion "$ndk_version"
|
|
defaultConfig {
|
|
minSdkVersion 21
|
|
targetSdkVersion 33
|
|
externalNativeBuild {
|
|
cmake {
|
|
arguments "-DANDROID_STL=c++_shared",
|
|
"-DENABLE_CURL=1", "-DENABLE_SOUND=1",
|
|
"-DENABLE_GETTEXT=1",
|
|
"-DBUILD_UNITTESTS=0", "-DENABLE_UPDATE_CHECKER=0"
|
|
}
|
|
}
|
|
}
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
path file("../../CMakeLists.txt")
|
|
}
|
|
}
|
|
|
|
// supported architectures
|
|
splits {
|
|
abi {
|
|
enable true
|
|
reset()
|
|
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
ndk {
|
|
debugSymbolLevel 'SYMBOL_TABLE'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// get precompiled deps
|
|
def depsDir = new File(buildDir.parent, 'deps')
|
|
if (new File(depsDir, 'armeabi-v7a').exists()) {
|
|
task getDeps {
|
|
doLast { logger.lifecycle('Using existing deps from {}', depsDir) }
|
|
}
|
|
} else {
|
|
task downloadDeps(type: Download) {
|
|
def depsZip = new File(buildDir, 'deps.zip')
|
|
|
|
src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps-lite.zip'
|
|
dest depsZip
|
|
overwrite false
|
|
|
|
task getDeps(dependsOn: downloadDeps, type: Copy) {
|
|
depsDir.mkdir()
|
|
from zipTree(depsZip)
|
|
into depsDir
|
|
doFirst { logger.lifecycle('Extracting to {}', depsDir) }
|
|
}
|
|
}
|
|
}
|
|
|
|
preBuild.dependsOn getDeps
|
|
|
|
clean {
|
|
delete new File(buildDir.parent, 'deps')
|
|
}
|