From 5bb48f00e600397104158ceef2453f8d71de9772 Mon Sep 17 00:00:00 2001 From: y9vad9 Date: Sun, 7 Jan 2024 01:36:24 +0100 Subject: [PATCH 1/3] refactor: `build-plugins/configurations` moved to `build-conventions` --- .../configurations => build-conventions}/build.gradle.kts | 0 .../main/kotlin/compose-multiplatform-convention.gradle.kts | 0 .../src/main/kotlin/jvm-library-convention.gradle.kts | 0 .../src/main/kotlin/koin-dependencies-convention.gradle.kts | 0 .../main/kotlin/multiplatform-library-convention.gradle.kts | 0 build-plugins/README.md | 6 ------ 6 files changed, 6 deletions(-) rename {build-plugins/configurations => build-conventions}/build.gradle.kts (100%) rename {build-plugins/configurations => build-conventions}/src/main/kotlin/compose-multiplatform-convention.gradle.kts (100%) rename {build-plugins/configurations => build-conventions}/src/main/kotlin/jvm-library-convention.gradle.kts (100%) rename {build-plugins/configurations => build-conventions}/src/main/kotlin/koin-dependencies-convention.gradle.kts (100%) rename {build-plugins/configurations => build-conventions}/src/main/kotlin/multiplatform-library-convention.gradle.kts (100%) delete mode 100644 build-plugins/README.md diff --git a/build-plugins/configurations/build.gradle.kts b/build-conventions/build.gradle.kts similarity index 100% rename from build-plugins/configurations/build.gradle.kts rename to build-conventions/build.gradle.kts diff --git a/build-plugins/configurations/src/main/kotlin/compose-multiplatform-convention.gradle.kts b/build-conventions/src/main/kotlin/compose-multiplatform-convention.gradle.kts similarity index 100% rename from build-plugins/configurations/src/main/kotlin/compose-multiplatform-convention.gradle.kts rename to build-conventions/src/main/kotlin/compose-multiplatform-convention.gradle.kts diff --git a/build-plugins/configurations/src/main/kotlin/jvm-library-convention.gradle.kts b/build-conventions/src/main/kotlin/jvm-library-convention.gradle.kts similarity index 100% rename from build-plugins/configurations/src/main/kotlin/jvm-library-convention.gradle.kts rename to build-conventions/src/main/kotlin/jvm-library-convention.gradle.kts diff --git a/build-plugins/configurations/src/main/kotlin/koin-dependencies-convention.gradle.kts b/build-conventions/src/main/kotlin/koin-dependencies-convention.gradle.kts similarity index 100% rename from build-plugins/configurations/src/main/kotlin/koin-dependencies-convention.gradle.kts rename to build-conventions/src/main/kotlin/koin-dependencies-convention.gradle.kts diff --git a/build-plugins/configurations/src/main/kotlin/multiplatform-library-convention.gradle.kts b/build-conventions/src/main/kotlin/multiplatform-library-convention.gradle.kts similarity index 100% rename from build-plugins/configurations/src/main/kotlin/multiplatform-library-convention.gradle.kts rename to build-conventions/src/main/kotlin/multiplatform-library-convention.gradle.kts diff --git a/build-plugins/README.md b/build-plugins/README.md deleted file mode 100644 index a7969a7..0000000 --- a/build-plugins/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Build plugins -This is a folder with the set of plugins to use in your modules. - -Plugins: -- **[publish-library](publish-library)** is the plugin-helper to reduce routine work when -publishing library to ssh. \ No newline at end of file From 0d1191b2b94900726d63e5da1df4c32bb9429281 Mon Sep 17 00:00:00 2001 From: y9vad9 Date: Sun, 7 Jan 2024 01:36:52 +0100 Subject: [PATCH 2/3] refactor: build configs refactored to default MP hierarchy --- .../settings.gradle.kts | 4 ++-- .../src/main/kotlin/unit-tests-convention.gradle.kts | 2 +- .../main/kotlin/unit-tests-with-mockk-convention.gradle.kts | 2 +- feature/authorization/dependencies/build.gradle.kts | 2 +- feature/system/dependencies/build.gradle.kts | 2 +- feature/timers/dependencies/build.gradle.kts | 2 +- feature/users/dependencies/build.gradle.kts | 2 +- foundation/mvi/koin-compose/build.gradle.kts | 2 +- foundation/time/build.gradle.kts | 6 ++---- foundation/viewmodel/build.gradle.kts | 4 ++-- settings.gradle.kts | 2 +- 11 files changed, 14 insertions(+), 16 deletions(-) rename {build-plugins/configurations => build-conventions}/settings.gradle.kts (63%) rename {build-plugins/configurations => build-conventions}/src/main/kotlin/unit-tests-convention.gradle.kts (94%) rename {build-plugins/configurations => build-conventions}/src/main/kotlin/unit-tests-with-mockk-convention.gradle.kts (96%) diff --git a/build-plugins/configurations/settings.gradle.kts b/build-conventions/settings.gradle.kts similarity index 63% rename from build-plugins/configurations/settings.gradle.kts rename to build-conventions/settings.gradle.kts index 5677df3..85847c3 100644 --- a/build-plugins/configurations/settings.gradle.kts +++ b/build-conventions/settings.gradle.kts @@ -6,9 +6,9 @@ dependencyResolutionManagement { versionCatalogs { create("libs") { - from(files("../../gradle/libs.versions.toml")) + from(files("../gradle/libs.versions.toml")) } } } -rootProject.name = "configurations" \ No newline at end of file +rootProject.name = "build-conventions" \ No newline at end of file diff --git a/build-plugins/configurations/src/main/kotlin/unit-tests-convention.gradle.kts b/build-conventions/src/main/kotlin/unit-tests-convention.gradle.kts similarity index 94% rename from build-plugins/configurations/src/main/kotlin/unit-tests-convention.gradle.kts rename to build-conventions/src/main/kotlin/unit-tests-convention.gradle.kts index 38fb1b2..e979b6b 100644 --- a/build-plugins/configurations/src/main/kotlin/unit-tests-convention.gradle.kts +++ b/build-conventions/src/main/kotlin/unit-tests-convention.gradle.kts @@ -7,7 +7,7 @@ val coroutinesVersion = "1.7.1" kotlin { sourceSets { - val jvmTest by getting { + jvmTest { dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion") implementation("org.jetbrains.kotlin:kotlin-test-junit5:$kotlinVersion") diff --git a/build-plugins/configurations/src/main/kotlin/unit-tests-with-mockk-convention.gradle.kts b/build-conventions/src/main/kotlin/unit-tests-with-mockk-convention.gradle.kts similarity index 96% rename from build-plugins/configurations/src/main/kotlin/unit-tests-with-mockk-convention.gradle.kts rename to build-conventions/src/main/kotlin/unit-tests-with-mockk-convention.gradle.kts index 387db8c..9b85bb1 100644 --- a/build-plugins/configurations/src/main/kotlin/unit-tests-with-mockk-convention.gradle.kts +++ b/build-conventions/src/main/kotlin/unit-tests-with-mockk-convention.gradle.kts @@ -18,7 +18,7 @@ val mockkVersion = "1.13.5" kotlin { sourceSets { - val jvmTest by getting { + jvmTest { dependencies { implementation("io.mockk:mockk:$mockkVersion") } diff --git a/feature/authorization/dependencies/build.gradle.kts b/feature/authorization/dependencies/build.gradle.kts index 5636503..503d246 100644 --- a/feature/authorization/dependencies/build.gradle.kts +++ b/feature/authorization/dependencies/build.gradle.kts @@ -9,7 +9,7 @@ kotlin { androidTarget() sourceSets { - val jvmMain by getting { + jvmMain { kotlin.srcDir("build/generated/ksp/jvm/jvmMain/kotlin") } } diff --git a/feature/system/dependencies/build.gradle.kts b/feature/system/dependencies/build.gradle.kts index 51009e0..0a39a3b 100644 --- a/feature/system/dependencies/build.gradle.kts +++ b/feature/system/dependencies/build.gradle.kts @@ -9,7 +9,7 @@ kotlin { androidTarget() sourceSets { - val jvmMain by getting { + jvmMain { kotlin.srcDir("build/generated/ksp/jvm/jvmMain/kotlin") } } diff --git a/feature/timers/dependencies/build.gradle.kts b/feature/timers/dependencies/build.gradle.kts index 5883036..a87eb32 100644 --- a/feature/timers/dependencies/build.gradle.kts +++ b/feature/timers/dependencies/build.gradle.kts @@ -9,7 +9,7 @@ kotlin { androidTarget() sourceSets { - val jvmMain by getting { + jvmMain { kotlin.srcDir("build/generated/ksp/jvm/jvmMain/kotlin") } } diff --git a/feature/users/dependencies/build.gradle.kts b/feature/users/dependencies/build.gradle.kts index 5f22b01..e8e8602 100644 --- a/feature/users/dependencies/build.gradle.kts +++ b/feature/users/dependencies/build.gradle.kts @@ -9,7 +9,7 @@ kotlin { androidTarget() sourceSets { - val jvmMain by getting { + jvmMain { kotlin.srcDir("build/generated/ksp/jvm/jvmMain/kotlin") } } diff --git a/foundation/mvi/koin-compose/build.gradle.kts b/foundation/mvi/koin-compose/build.gradle.kts index 602a530..934c2ab 100644 --- a/foundation/mvi/koin-compose/build.gradle.kts +++ b/foundation/mvi/koin-compose/build.gradle.kts @@ -7,7 +7,7 @@ kotlin { androidTarget() sourceSets { - val androidMain by getting { + androidMain { dependencies { implementation(libs.androidx.compose.viewmodel) implementation(libs.koin.androidx.compose) diff --git a/foundation/time/build.gradle.kts b/foundation/time/build.gradle.kts index e3ce573..18bd215 100644 --- a/foundation/time/build.gradle.kts +++ b/foundation/time/build.gradle.kts @@ -4,10 +4,8 @@ plugins { kotlin { sourceSets { - val jvmMain by getting - - val androidMain by getting { - dependsOn(jvmMain) + androidMain { + dependsOn(jvmMain.get()) } } } diff --git a/foundation/viewmodel/build.gradle.kts b/foundation/viewmodel/build.gradle.kts index 935dd87..c8f52f5 100644 --- a/foundation/viewmodel/build.gradle.kts +++ b/foundation/viewmodel/build.gradle.kts @@ -7,8 +7,8 @@ kotlin { androidTarget() sourceSets { - val jvmMain by getting - val androidMain by getting { + jvmMain + androidMain { dependencies { api(libs.androidx.lifecycle) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 334a16f..1764d51 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,7 +19,7 @@ dependencyResolutionManagement { rootProject.name = "timemates-app" -includeBuild("build-plugins/configurations") +includeBuild("build-conventions") include( ":localization", From fcb2afefc7ea7999f8df0eb5b755d7d627b1d849 Mon Sep 17 00:00:00 2001 From: y9vad9 Date: Sun, 7 Jan 2024 01:44:46 +0100 Subject: [PATCH 3/3] suppress warn --- gradle.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 997a09d..45c6bd1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,5 @@ android.useAndroidX=true # org.gradle.unsafe.configuration-cache=true org.gradle.caching=true kotlin.mpp.androidSourceSetLayoutVersion=2 -org.jetbrains.compose.experimental.jscanvas.enabled=true \ No newline at end of file +org.jetbrains.compose.experimental.jscanvas.enabled=true +kotlin.mpp.applyDefaultHierarchyTemplate=false \ No newline at end of file