summaryrefslogtreecommitdiff
path: root/build/android/native/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'build/android/native/build.gradle')
-rw-r--r--build/android/native/build.gradle59
1 files changed, 59 insertions, 0 deletions
diff --git a/build/android/native/build.gradle b/build/android/native/build.gradle
new file mode 100644
index 000000000..f06e4e3f0
--- /dev/null
+++ b/build/android/native/build.gradle
@@ -0,0 +1,59 @@
+apply plugin: 'com.android.library'
+import org.ajoberstar.grgit.Grgit
+
+android {
+ compileSdkVersion 29
+ buildToolsVersion '29.0.3'
+ ndkVersion '21.0.6113669'
+ defaultConfig {
+ minSdkVersion 16
+ targetSdkVersion 29
+ externalNativeBuild {
+ ndkBuild {
+ arguments '-j8',
+ "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'
+ }
+ }
+ }
+ }
+}
+
+task cloneGitRepo() {
+ def destination = file('deps')
+ if(!destination.exists()) {
+ def grgit = Grgit.clone(
+ dir: destination,
+ uri: 'https://github.com/minetest/minetest_android_deps_binaries'
+ )
+ grgit.close()
+ }
+}
+
+preBuild.dependsOn cloneGitRepo