summaryrefslogtreecommitdiff
path: root/build/android/native/build.gradle
blob: f06e4e3f05bcd1aa29372c1200f38bd363101b8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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