2020-04-15 16:27:40 +02:00
|
|
|
apply plugin: 'com.android.library'
|
2020-09-04 20:04:28 +02:00
|
|
|
apply plugin: 'de.undercouch.download'
|
2020-04-15 16:27:40 +02:00
|
|
|
|
|
|
|
android {
|
2022-08-06 23:03:24 +02:00
|
|
|
compileSdkVersion 33
|
2022-07-03 21:32:55 +03:00
|
|
|
buildToolsVersion '33.0.0'
|
2022-09-18 06:05:37 +06:00
|
|
|
ndkVersion '25.1.8937393'
|
2020-04-15 16:27:40 +02:00
|
|
|
defaultConfig {
|
2022-02-21 04:24:21 +06:00
|
|
|
minSdkVersion 21
|
2022-08-06 23:03:24 +02:00
|
|
|
targetSdkVersion 33
|
2020-04-15 16:27:40 +02:00
|
|
|
externalNativeBuild {
|
|
|
|
ndkBuild {
|
2020-09-04 20:04:28 +02:00
|
|
|
arguments '-j' + Runtime.getRuntime().availableProcessors(),
|
|
|
|
"--output-sync=none",
|
2020-04-15 16:27:40 +02:00
|
|
|
"versionMajor=${versionMajor}",
|
|
|
|
"versionMinor=${versionMinor}",
|
|
|
|
"versionPatch=${versionPatch}",
|
2022-08-02 19:48:01 +12:00
|
|
|
"versionExtra=${versionExtra}",
|
|
|
|
"developmentBuild=${developmentBuild}"
|
2020-04-15 16:27:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-04 20:04:28 +02:00
|
|
|
// get precompiled deps
|
|
|
|
task downloadDeps(type: Download) {
|
|
|
|
src 'https://github.com/MultiCraft/deps/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/deps-master")
|
|
|
|
|
|
|
|
if (!f.exists()) {
|
|
|
|
from zipTree(downloadDeps.dest)
|
|
|
|
into buildDir
|
|
|
|
}
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
file(f).renameTo(file(deps))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
preBuild.dependsOn getDeps
|
2022-05-16 16:31:30 +03:00
|
|
|
|
|
|
|
android.defaultConfig.externalNativeBuild.ndkBuild {
|
|
|
|
arguments 'prebuilt=$(if $(strip $(wildcard $(prebuilt_path))),$(prebuilt_path),.)'
|
|
|
|
}
|