MicroUtils/defaultAndroidSettings.gradle

68 lines
2.0 KiB
Groovy
Raw Permalink Normal View History

2020-12-02 10:21:31 +00:00
apply plugin: 'com.getkeepsafe.dexcount'
2021-04-20 19:52:17 +00:00
ext {
2021-04-20 20:02:25 +00:00
jvmKotlinFolderFile = {
2021-04-20 19:52:17 +00:00
String sep = File.separator
2021-04-20 20:02:25 +00:00
return new File("${project.projectDir}${sep}src${sep}jvmMain${sep}kotlin")
}
enableIncludingJvmCodeInAndroidPart = {
File jvmKotlinFolder = jvmKotlinFolderFile()
2021-04-20 19:52:17 +00:00
if (jvmKotlinFolder.exists()) {
android.sourceSets.main.java.srcDirs += jvmKotlinFolder.path
}
}
disableIncludingJvmCodeInAndroidPart = {
2021-04-20 20:02:25 +00:00
File jvmKotlinFolder = jvmKotlinFolderFile()
String[] oldDirs = android.sourceSets.main.java.srcDirs
android.sourceSets.main.java.srcDirs = []
for (oldDir in oldDirs) {
if (oldDir != jvmKotlinFolder.path) {
android.sourceSets.main.java.srcDirs += oldDir
}
}
2021-04-20 19:52:17 +00:00
}
}
2020-11-10 09:43:15 +00:00
android {
2022-03-10 11:04:05 +00:00
compileSdkVersion libs.versions.android.props.compileSdk.get().toInteger()
buildToolsVersion libs.versions.android.props.buildTools.get()
2020-11-10 09:43:15 +00:00
defaultConfig {
2022-03-10 11:04:05 +00:00
minSdkVersion libs.versions.android.props.minSdk.get().toInteger()
targetSdkVersion libs.versions.android.props.compileSdk.get().toInteger()
2020-11-10 09:43:15 +00:00
versionCode "${android_code_version}".toInteger()
versionName "$version"
}
buildTypes {
release {
minifyEnabled false
}
2020-11-11 10:06:44 +00:00
debug {
debuggable true
}
2020-11-10 09:43:15 +00:00
}
packagingOptions {
exclude 'META-INF/kotlinx-serialization-runtime.kotlin_module'
exclude 'META-INF/kotlinx-serialization-cbor.kotlin_module'
exclude 'META-INF/kotlinx-serialization-properties.kotlin_module'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
2020-11-11 10:06:44 +00:00
sourceSets {
2021-04-20 13:17:59 +00:00
String sep = File.separator
main.java.srcDirs += "src${sep}main${sep}kotlin"
2021-04-20 19:52:17 +00:00
enableIncludingJvmCodeInAndroidPart()
2020-11-11 10:06:44 +00:00
}
2020-11-10 09:43:15 +00:00
}