small cleanup in build scripts

This commit is contained in:
InsanusMokrassar 2023-02-27 17:03:09 +06:00
parent d8cf3c6726
commit 73c724a2e5
5 changed files with 12 additions and 32 deletions

View File

@ -18,6 +18,7 @@ kotlin {
api project(":micro_utils.coroutines")
api libs.android.fragment
}
dependsOn jvmMain
}
}
}

View File

@ -1,30 +1,5 @@
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 libs.versions.android.props.compileSdk.get().toInteger()
buildToolsVersion libs.versions.android.props.buildTools.get()
@ -59,9 +34,9 @@ android {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
sourceSets {
String sep = File.separator
main.java.srcDirs += "src${sep}main${sep}kotlin"
enableIncludingJvmCodeInAndroidPart()
}
// sourceSets {
// String sep = File.separator
// main.java.srcDirs += "src${sep}main${sep}kotlin"
//// enableIncludingJvmCodeInAndroidPart()
// }
}

View File

@ -15,5 +15,8 @@ kotlin {
api libs.ktor.client
}
}
androidMain {
dependsOn jvmMain
}
}
}

View File

@ -17,5 +17,8 @@ kotlin {
api libs.ktor.io
}
}
androidMain {
dependsOn jvmMain
}
}
}

View File

@ -32,5 +32,3 @@ kotlin {
}
}
}
disableIncludingJvmCodeInAndroidPart()