mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-27 04:28:46 +00:00
68 lines
1.9 KiB
Groovy
68 lines
1.9 KiB
Groovy
apply plugin: 'com.getkeepsafe.dexcount'
|
|
|
|
ext {
|
|
jvmKotlinFolderFile = {
|
|
String sep = File.separator
|
|
return new File("${project.projectDir}${sep}src${sep}jvmMain${sep}kotlin")
|
|
}
|
|
|
|
enableIncludingJvmCodeInAndroidPart = {
|
|
File jvmKotlinFolder = jvmKotlinFolderFile()
|
|
if (jvmKotlinFolder.exists()) {
|
|
android.sourceSets.main.java.srcDirs += jvmKotlinFolder.path
|
|
}
|
|
}
|
|
|
|
disableIncludingJvmCodeInAndroidPart = {
|
|
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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
android {
|
|
compileSdkVersion "$android_compileSdkVersion".toInteger()
|
|
buildToolsVersion "$android_buildToolsVersion"
|
|
|
|
defaultConfig {
|
|
minSdkVersion "$android_minSdkVersion".toInteger()
|
|
targetSdkVersion "$android_compileSdkVersion".toInteger()
|
|
versionCode "${android_code_version}".toInteger()
|
|
versionName "$version"
|
|
}
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
}
|
|
debug {
|
|
debuggable true
|
|
}
|
|
}
|
|
|
|
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()
|
|
}
|
|
|
|
sourceSets {
|
|
String sep = File.separator
|
|
main.java.srcDirs += "src${sep}main${sep}kotlin"
|
|
enableIncludingJvmCodeInAndroidPart()
|
|
}
|
|
}
|