49 lines
1.1 KiB
Groovy
49 lines
1.1 KiB
Groovy
apply plugin: 'com.android.library'
|
|
|
|
android {
|
|
compileSdkVersion 29
|
|
buildToolsVersion "29.0.2"
|
|
|
|
defaultConfig {
|
|
minSdkVersion 23
|
|
targetSdkVersion 29
|
|
versionCode 1
|
|
versionName "1.0"
|
|
|
|
consumerProguardFiles 'consumer-rules.pro'
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
jniLibs.srcDirs = ["$buildDir/intermediates/native_output"]
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
|
|
}
|
|
|
|
|
|
afterEvaluate {
|
|
def compileArch = ["arm64-v8a", "x86_64"]
|
|
def options = new GolangBuildOptions(file("src/main/golang"), file("$buildDir/intermediates/native_output"), "23")
|
|
|
|
def ts = compileArch.stream().map { abi ->
|
|
tasks.register("golangBuildFor" + abi.replace("-", ""), GolangBuildTask.class) {
|
|
setOptions options, abi
|
|
}
|
|
}.toArray()
|
|
|
|
for ( task in tasks ) {
|
|
if ( task.name.contains("JniLib") )
|
|
task.dependsOn(ts)
|
|
}
|
|
} |