summaryrefslogtreecommitdiff
path: root/build/android/native
diff options
context:
space:
mode:
authorMaksim <MoNTE48@mail.ua>2020-05-24 12:55:48 +0200
committerrubenwardy <rw@rubenwardy.com>2020-10-13 20:28:31 +0100
commit05436fb551bb22b0a9c1d9f176a6891aa82d9cb2 (patch)
tree1e7ff294a7673f5272d231aa46e0a7e1f0a74fdb /build/android/native
parent2341a4aff1242e978d6fad3772d4d4fb015c040d (diff)
downloadminetest-05436fb551bb22b0a9c1d9f176a6891aa82d9cb2.tar.gz
minetest-05436fb551bb22b0a9c1d9f176a6891aa82d9cb2.tar.bz2
minetest-05436fb551bb22b0a9c1d9f176a6891aa82d9cb2.zip
Android: get deps as a zip archive and sqlite3 from official source
Diffstat (limited to 'build/android/native')
-rw-r--r--build/android/native/build.gradle63
1 files changed, 51 insertions, 12 deletions
diff --git a/build/android/native/build.gradle b/build/android/native/build.gradle
index cbd50db6a..b072766b0 100644
--- a/build/android/native/build.gradle
+++ b/build/android/native/build.gradle
@@ -1,16 +1,16 @@
apply plugin: 'com.android.library'
-import org.ajoberstar.grgit.Grgit
+apply plugin: 'de.undercouch.download'
android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
- ndkVersion '21.1.6352462'
+ ndkVersion '21.2.6472646'
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
externalNativeBuild {
ndkBuild {
- arguments '-j8',
+ arguments '-j' + Runtime.getRuntime().availableProcessors(),
"versionMajor=${versionMajor}",
"versionMinor=${versionMinor}",
"versionPatch=${versionPatch}",
@@ -45,15 +45,54 @@ android {
}
}
-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()
+// get precompiled deps
+def folder = 'minetest_android_deps_binaries'
+
+task downloadDeps(type: Download) {
+ src 'https://github.com/minetest/' + folder + '/archive/master.zip'
+ dest new File(buildDir, 'deps.zip')
+ overwrite false
+}
+
+task getDeps(dependsOn: downloadDeps, type: Copy) {
+ def deps = file('deps')
+ def f = file("$buildDir/" + folder + "-master")
+
+ if (!deps.exists() && !f.exists()) {
+ from zipTree(downloadDeps.dest)
+ into buildDir
+ }
+
+ doLast {
+ if (!deps.exists()) {
+ file(f).renameTo(file(deps))
+ }
+ }
+}
+
+// get sqlite
+def sqlite_ver = '3320200'
+task downloadSqlite(dependsOn: getDeps, type: Download) {
+ src 'https://www.sqlite.org/2020/sqlite-amalgamation-' + sqlite_ver + '.zip'
+ dest new File(buildDir, 'sqlite.zip')
+ overwrite false
+}
+
+task getSqlite(dependsOn: downloadSqlite, type: Copy) {
+ def sqlite = file('deps/Android/sqlite')
+ def f = file("$buildDir/sqlite-amalgamation-" + sqlite_ver)
+
+ if (!sqlite.exists() && !f.exists()) {
+ from zipTree(downloadSqlite.dest)
+ into buildDir
+ }
+
+ doLast {
+ if (!sqlite.exists()) {
+ file(f).renameTo(file(sqlite))
+ }
}
}
-preBuild.dependsOn cloneGitRepo
+preBuild.dependsOn getDeps
+preBuild.dependsOn getSqlite