From 73c724a2e58fc0a7abff9e27bb3b24ba2f55f38a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 27 Feb 2023 17:03:09 +0600 Subject: [PATCH] small cleanup in build scripts --- common/build.gradle | 1 + defaultAndroidSettings.gradle | 35 +++++------------------------------ ktor/client/build.gradle | 3 +++ ktor/common/build.gradle | 3 +++ repos/common/build.gradle | 2 -- 5 files changed, 12 insertions(+), 32 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 880abb6a3a2..ffe436a0cf5 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -18,6 +18,7 @@ kotlin { api project(":micro_utils.coroutines") api libs.android.fragment } + dependsOn jvmMain } } } diff --git a/defaultAndroidSettings.gradle b/defaultAndroidSettings.gradle index 6f0376b46af..14e6bdec2b8 100644 --- a/defaultAndroidSettings.gradle +++ b/defaultAndroidSettings.gradle @@ -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() +// } } diff --git a/ktor/client/build.gradle b/ktor/client/build.gradle index 19c17926dfe..748477c43ac 100644 --- a/ktor/client/build.gradle +++ b/ktor/client/build.gradle @@ -15,5 +15,8 @@ kotlin { api libs.ktor.client } } + androidMain { + dependsOn jvmMain + } } } diff --git a/ktor/common/build.gradle b/ktor/common/build.gradle index 6b1c636a8a9..e9b164d47d1 100644 --- a/ktor/common/build.gradle +++ b/ktor/common/build.gradle @@ -17,5 +17,8 @@ kotlin { api libs.ktor.io } } + androidMain { + dependsOn jvmMain + } } } diff --git a/repos/common/build.gradle b/repos/common/build.gradle index e2b157e2674..b5ae4333470 100644 --- a/repos/common/build.gradle +++ b/repos/common/build.gradle @@ -32,5 +32,3 @@ kotlin { } } } - -disableIncludingJvmCodeInAndroidPart()