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 project(":micro_utils.coroutines")
api libs.android.fragment api libs.android.fragment
} }
dependsOn jvmMain
} }
} }
} }

View File

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

View File

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

View File

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

View File

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