This commit is contained in:
InsanusMokrassar 2021-04-21 02:02:25 +06:00
parent 2f9aa585f1
commit 30292306bb

View File

@ -1,18 +1,27 @@
apply plugin: 'com.getkeepsafe.dexcount' apply plugin: 'com.getkeepsafe.dexcount'
ext { ext {
enableIncludingJvmCodeInAndroidPart = { jvmKotlinFolderFile = {
String sep = File.separator String sep = File.separator
File jvmKotlinFolder = new File("${project.projectDir}${sep}src${sep}jvmMain${sep}kotlin") return new File("${project.projectDir}${sep}src${sep}jvmMain${sep}kotlin")
}
enableIncludingJvmCodeInAndroidPart = {
File jvmKotlinFolder = jvmKotlinFolderFile()
if (jvmKotlinFolder.exists()) { if (jvmKotlinFolder.exists()) {
android.sourceSets.main.java.srcDirs += jvmKotlinFolder.path android.sourceSets.main.java.srcDirs += jvmKotlinFolder.path
} }
} }
disableIncludingJvmCodeInAndroidPart = { disableIncludingJvmCodeInAndroidPart = {
String sep = File.separator File jvmKotlinFolder = jvmKotlinFolderFile()
File jvmKotlinFolder = new File("${project.projectDir}${sep}src${sep}jvmMain${sep}kotlin") String[] oldDirs = android.sourceSets.main.java.srcDirs
android.sourceSets.main.java.srcDirs -= jvmKotlinFolder.path android.sourceSets.main.java.srcDirs = []
for (oldDir in oldDirs) {
if (oldDir != jvmKotlinFolder.path) {
android.sourceSets.main.java.srcDirs += oldDir
}
}
} }
} }