66 lines
1.9 KiB
Groovy
66 lines
1.9 KiB
Groovy
apply plugin: 'com.android.library'
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'kotlin-android-extensions'
|
|
apply plugin: 'kotlinx-serialization'
|
|
|
|
android {
|
|
compileSdkVersion gCompileSdkVersion
|
|
buildToolsVersion gBuildToolsVersion
|
|
|
|
defaultConfig {
|
|
minSdkVersion gMinSdkVersion
|
|
targetSdkVersion gTargetSdkVersion
|
|
versionCode gVersionCode
|
|
versionName gVersionName
|
|
|
|
consumerProguardFiles 'consumer-rules.pro'
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
assets.srcDirs += ["$buildDir/intermediates/dynamic_assets"]
|
|
jniLibs.srcDirs += ["$buildDir/intermediates/go_output/native_library"]
|
|
java.srcDirs += ["$buildDir/intermediates/go_output/generate_java"]
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation "androidx.core:core-ktx:$gAndroidKtxVersion"
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$gKotlinVersion"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$gKotlinCoroutineVersion"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$gKotlinSerializationVersion"
|
|
}
|
|
|
|
afterEvaluate {
|
|
def ds = tasks.register("downloadMMDB", MMDBDowloadTask.class) {
|
|
onlyIf {
|
|
System.currentTimeMillis() - file("$buildDir/intermediates/dynamic_assets/Country.mmdb").lastModified() > 7 * 24 * 3600 * 1000L
|
|
}
|
|
|
|
output = "$buildDir/intermediates/dynamic_assets/Country.mmdb"
|
|
}
|
|
|
|
def gs = tasks.register("golangBind", GolangBindTask.class)
|
|
|
|
preBuild.dependsOn(ds, gs)
|
|
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
} |