1
0

76 lines
1.5 KiB
Groovy
Raw Normal View History

apply plugin: 'com.android.library'
2020-09-04 20:04:28 +02:00
apply plugin: 'de.undercouch.download'
android {
2022-08-06 23:03:24 +02:00
compileSdkVersion 33
2023-02-23 23:58:24 +02:00
buildToolsVersion '33.0.2'
ndkVersion '25.2.9519653'
defaultConfig {
minSdkVersion 21
2022-08-06 23:03:24 +02:00
targetSdkVersion 33
externalNativeBuild {
ndkBuild {
2020-09-04 20:04:28 +02:00
arguments '-j' + Runtime.getRuntime().availableProcessors(),
"--output-sync=none",
"versionMajor=${versionMajor}",
"versionMinor=${versionMinor}",
"versionPatch=${versionPatch}",
"versionExtra=${versionExtra}",
"developmentBuild=${developmentBuild}"
}
}
}
externalNativeBuild {
ndkBuild {
path file('jni/Android.mk')
}
}
// supported architectures
splits {
abi {
enable true
reset()
2023-06-12 21:14:29 +03:00
//noinspection ChromeOsAbiSupport
include 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}
}
buildTypes {
release {
externalNativeBuild {
ndkBuild {
arguments 'NDEBUG=1'
}
}
}
}
namespace = "com.multicraft"
}
2020-09-04 20:04:28 +02:00
// get precompiled deps
2023-06-12 21:14:29 +03:00
tasks.register('downloadDeps', Download) {
2023-08-23 13:57:41 +03:00
def VERSION = "11082023"
src "https://github.com/MultiCraft/deps_android/releases/download/$VERSION/deps_android.zip"
2020-09-04 20:04:28 +02:00
dest new File(buildDir, 'deps.zip')
overwrite false
}
2023-06-12 21:14:29 +03:00
tasks.register('getDeps', Copy) {
dependsOn downloadDeps
2020-09-04 20:04:28 +02:00
def deps = file('deps')
def f = file("$buildDir/deps_android")
2020-09-04 20:04:28 +02:00
if (!f.exists()) {
from zipTree(downloadDeps.dest)
into deps
2020-09-04 20:04:28 +02:00
}
}
preBuild.dependsOn getDeps
2022-05-16 16:31:30 +03:00
android.defaultConfig.externalNativeBuild.ndkBuild {
arguments 'prebuilt=$(if $(strip $(wildcard $(prebuilt_path))),$(prebuilt_path),.)'
}