1
0

78 lines
1.6 KiB
Groovy
Raw Permalink Normal View History

apply plugin: 'com.android.library'
2020-09-04 20:04:28 +02:00
apply plugin: 'de.undercouch.download'
android {
2023-10-26 21:25:16 +06:00
compileSdkVersion 34
buildToolsVersion '34.0.0'
2023-02-23 23:58:24 +02:00
ndkVersion '25.2.9519653'
defaultConfig {
minSdkVersion 21
2023-10-26 21:25:16 +06:00
targetSdkVersion 34
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()
//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-10-05 20:32:47 +03:00
def buildDirectory = layout.buildDirectory.get().asFile
tasks.register('downloadDeps', Download) {
2023-10-05 20:32:47 +03:00
def VERSION = "05102023"
src "https://github.com/MultiCraft/deps_android/releases/download/$VERSION/deps_android.zip"
dest new File(buildDirectory, 'deps.zip')
2020-09-04 20:04:28 +02:00
overwrite false
}
tasks.register('getDeps', Copy) {
dependsOn downloadDeps
2020-09-04 20:04:28 +02:00
def deps = file('deps')
2023-10-05 20:32:47 +03:00
def f = file("$buildDirectory/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),.)'
}