From 91f5d00beb486bab45d3d1bec191f8b2350008f1 Mon Sep 17 00:00:00 2001 From: michaelbel Date: Mon, 15 Jul 2024 14:12:16 +0300 Subject: [PATCH] JVM toolchain --- build.gradle.kts | 4 --- core/analytics/build.gradle.kts | 16 +++++----- core/common/build.gradle.kts | 16 +++++----- core/interactor/build.gradle.kts | 16 +++++----- core/navigation/build.gradle.kts | 16 +++++----- core/network/build.gradle.kts | 15 +++++----- core/notifications/build.gradle.kts | 16 +++++----- core/persistence/build.gradle.kts | 16 +++++----- core/platform-services/foss/build.gradle.kts | 16 +++++----- core/platform-services/gms/build.gradle.kts | 16 +++++----- core/platform-services/hms/build.gradle.kts | 16 +++++----- .../inject-android/build.gradle.kts | 16 +++++----- .../interactor/build.gradle.kts | 16 +++++----- core/repository/build.gradle.kts | 16 +++++----- core/ui/build.gradle.kts | 29 +++++++------------ core/widget/build.gradle.kts | 16 +++++----- core/work/build.gradle.kts | 16 +++++----- feature/account-impl/build.gradle.kts | 21 ++++++-------- feature/account/build.gradle.kts | 16 +++++----- feature/auth-impl/build.gradle.kts | 29 +++++++------------ feature/auth/build.gradle.kts | 16 +++++----- feature/debug-impl/build.gradle.kts | 16 +++++----- feature/debug/build.gradle.kts | 16 +++++----- feature/details-impl/build.gradle.kts | 29 +++++++------------ feature/details/build.gradle.kts | 16 +++++----- feature/feed-impl/build.gradle.kts | 29 +++++++------------ feature/feed/build.gradle.kts | 16 +++++----- feature/gallery-impl/build.gradle.kts | 29 +++++++------------ feature/gallery/build.gradle.kts | 16 +++++----- feature/main-impl/build.gradle.kts | 21 ++++++-------- feature/search-impl/build.gradle.kts | 29 +++++++------------ feature/search/build.gradle.kts | 16 +++++----- feature/settings-impl/build.gradle.kts | 21 ++++++-------- feature/settings/build.gradle.kts | 16 +++++----- 34 files changed, 302 insertions(+), 322 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 93674c7ba..e3151d649 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,8 +31,4 @@ subprojects { if (name != "desktopApp") { apply(plugin = "io.gitlab.arturbosch.detekt") } -} - -extra.apply { - set("jvmTarget", "11") } \ No newline at end of file diff --git a/core/analytics/build.gradle.kts b/core/analytics/build.gradle.kts index 05b6c3dde..f42df3abd 100644 --- a/core/analytics/build.gradle.kts +++ b/core/analytics/build.gradle.kts @@ -1,16 +1,14 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -22,6 +20,10 @@ kotlin { implementation(libs.bundles.koin.android) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/common/build.gradle.kts b/core/common/build.gradle.kts index e2a822c83..933d5a0aa 100644 --- a/core/common/build.gradle.kts +++ b/core/common/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -41,6 +39,10 @@ kotlin { api(libs.bundles.jetbrains.androidx.lifecycle.viewmodel.compose.common) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/interactor/build.gradle.kts b/core/interactor/build.gradle.kts index 3a461b794..f5ba7fd4b 100644 --- a/core/interactor/build.gradle.kts +++ b/core/interactor/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -25,6 +23,10 @@ kotlin { implementation(libs.bundles.room.paging.common) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/navigation/build.gradle.kts b/core/navigation/build.gradle.kts index 60e578e05..605868a04 100644 --- a/core/navigation/build.gradle.kts +++ b/core/navigation/build.gradle.kts @@ -1,16 +1,14 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -26,6 +24,10 @@ kotlin { api(libs.bundles.jetbrains.androidx.lifecycle.viewmodel.compose.common) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts index b78966818..ca66936ae 100644 --- a/core/network/build.gradle.kts +++ b/core/network/build.gradle.kts @@ -1,5 +1,8 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties import com.codingfeline.buildkonfig.compiler.FieldSpec.Type.STRING +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi plugins { alias(libs.plugins.kotlin.multiplatform) @@ -15,13 +18,7 @@ private val tmdbApiKey: String by lazy { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -37,6 +34,10 @@ kotlin { implementation(libs.bundles.koin.android) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/notifications/build.gradle.kts b/core/notifications/build.gradle.kts index 493712d28..bf0cc557c 100644 --- a/core/notifications/build.gradle.kts +++ b/core/notifications/build.gradle.kts @@ -1,16 +1,14 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -19,6 +17,10 @@ kotlin { implementation(project(":core:ui")) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/persistence/build.gradle.kts b/core/persistence/build.gradle.kts index 60ef959ba..e47065413 100644 --- a/core/persistence/build.gradle.kts +++ b/core/persistence/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -32,6 +30,10 @@ kotlin { implementation(libs.bundles.datastore.desktop) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/platform-services/foss/build.gradle.kts b/core/platform-services/foss/build.gradle.kts index 35864d23d..2ce12f0ae 100644 --- a/core/platform-services/foss/build.gradle.kts +++ b/core/platform-services/foss/build.gradle.kts @@ -1,16 +1,14 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -20,6 +18,10 @@ kotlin { implementation(libs.bundles.koin.common) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/platform-services/gms/build.gradle.kts b/core/platform-services/gms/build.gradle.kts index 4bd1bd5f8..97823e57a 100644 --- a/core/platform-services/gms/build.gradle.kts +++ b/core/platform-services/gms/build.gradle.kts @@ -1,16 +1,14 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -26,6 +24,10 @@ kotlin { implementation(libs.bundles.koin.android) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/platform-services/hms/build.gradle.kts b/core/platform-services/hms/build.gradle.kts index 6bf5dfbad..4e0f59dd3 100644 --- a/core/platform-services/hms/build.gradle.kts +++ b/core/platform-services/hms/build.gradle.kts @@ -1,16 +1,14 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -20,6 +18,10 @@ kotlin { implementation(libs.bundles.koin.common) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/platform-services/inject-android/build.gradle.kts b/core/platform-services/inject-android/build.gradle.kts index b4b16ccd9..6f745a8c9 100644 --- a/core/platform-services/inject-android/build.gradle.kts +++ b/core/platform-services/inject-android/build.gradle.kts @@ -1,16 +1,14 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -22,6 +20,10 @@ kotlin { implementation(libs.bundles.koin.android) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/platform-services/interactor/build.gradle.kts b/core/platform-services/interactor/build.gradle.kts index 6936e0cc3..d59fc8c08 100644 --- a/core/platform-services/interactor/build.gradle.kts +++ b/core/platform-services/interactor/build.gradle.kts @@ -1,16 +1,14 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -18,6 +16,10 @@ kotlin { implementation(libs.bundles.kotlinx.coroutines.common) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/repository/build.gradle.kts b/core/repository/build.gradle.kts index 1728e29f3..97a9f111c 100644 --- a/core/repository/build.gradle.kts +++ b/core/repository/build.gradle.kts @@ -1,16 +1,14 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -20,6 +18,10 @@ kotlin { implementation(libs.bundles.room.paging.common) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index d6c482545..2fabfb57f 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,20 +10,8 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } - jvm("desktop") { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } + androidTarget() + jvm("desktop") sourceSets { commonMain.dependencies { @@ -50,6 +42,10 @@ kotlin { implementation(libs.bundles.kamel.desktop) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { @@ -62,11 +58,6 @@ android { compileSdk = libs.versions.compile.sdk.get().toInt() } - compileOptions { - sourceCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - targetCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - } - lint { quiet = true abortOnError = false diff --git a/core/widget/build.gradle.kts b/core/widget/build.gradle.kts index 858fcc3c0..2611e6797 100644 --- a/core/widget/build.gradle.kts +++ b/core/widget/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -28,6 +26,10 @@ kotlin { implementation(libs.bundles.glance.android) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/core/work/build.gradle.kts b/core/work/build.gradle.kts index 6b2cf6fc6..fad6d256c 100644 --- a/core/work/build.gradle.kts +++ b/core/work/build.gradle.kts @@ -1,16 +1,14 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -23,6 +21,10 @@ kotlin { implementation(libs.bundles.work.android) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/feature/account-impl/build.gradle.kts b/feature/account-impl/build.gradle.kts index 49cf6d034..0403ce62f 100644 --- a/feature/account-impl/build.gradle.kts +++ b/feature/account-impl/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -35,6 +33,10 @@ kotlin { implementation(libs.koin.compose) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { @@ -49,11 +51,6 @@ android { compose = true } - compileOptions { - sourceCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - targetCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - } - lint { quiet = true abortOnError = false diff --git a/feature/account/build.gradle.kts b/feature/account/build.gradle.kts index dbead3336..7304f7f2b 100644 --- a/feature/account/build.gradle.kts +++ b/feature/account/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -24,6 +22,10 @@ kotlin { implementation(compose.material3) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/feature/auth-impl/build.gradle.kts b/feature/auth-impl/build.gradle.kts index 4235464e2..16396d7a8 100644 --- a/feature/auth-impl/build.gradle.kts +++ b/feature/auth-impl/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,20 +10,8 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } - jvm("desktop") { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } + androidTarget() + jvm("desktop") sourceSets { commonMain.dependencies { @@ -40,6 +32,10 @@ kotlin { implementation(libs.koin.compose) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { @@ -54,11 +50,6 @@ android { compose = true } - compileOptions { - sourceCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - targetCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - } - lint { quiet = true abortOnError = false diff --git a/feature/auth/build.gradle.kts b/feature/auth/build.gradle.kts index 6c41bc3b4..48300b14b 100644 --- a/feature/auth/build.gradle.kts +++ b/feature/auth/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -25,6 +23,10 @@ kotlin { implementation(compose.material3) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/feature/debug-impl/build.gradle.kts b/feature/debug-impl/build.gradle.kts index 4e70b348a..c0773b505 100644 --- a/feature/debug-impl/build.gradle.kts +++ b/feature/debug-impl/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() sourceSets { commonMain.dependencies { @@ -23,6 +21,10 @@ kotlin { implementation(project(":core:navigation")) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/feature/debug/build.gradle.kts b/feature/debug/build.gradle.kts index 8a0279545..59f87bf48 100644 --- a/feature/debug/build.gradle.kts +++ b/feature/debug/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,19 +10,17 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() sourceSets { commonMain.dependencies { api(project(":feature:debug-impl")) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/feature/details-impl/build.gradle.kts b/feature/details-impl/build.gradle.kts index 35ed03094..f2cdf8978 100644 --- a/feature/details-impl/build.gradle.kts +++ b/feature/details-impl/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,20 +10,8 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } - jvm("desktop") { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } + androidTarget() + jvm("desktop") sourceSets { commonMain.dependencies { @@ -40,6 +32,10 @@ kotlin { implementation(libs.koin.compose) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { @@ -55,11 +51,6 @@ android { compose = true } - compileOptions { - sourceCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - targetCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - } - lint { quiet = true abortOnError = false diff --git a/feature/details/build.gradle.kts b/feature/details/build.gradle.kts index bac7e7e88..0cca03170 100644 --- a/feature/details/build.gradle.kts +++ b/feature/details/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -25,6 +23,10 @@ kotlin { implementation(compose.material3) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/feature/feed-impl/build.gradle.kts b/feature/feed-impl/build.gradle.kts index 5365ecf10..cf3e2b23b 100644 --- a/feature/feed-impl/build.gradle.kts +++ b/feature/feed-impl/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,20 +10,8 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } - jvm("desktop") { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } + androidTarget() + jvm("desktop") sourceSets { commonMain.dependencies { @@ -47,6 +39,10 @@ kotlin { implementation(libs.koin.compose) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { @@ -62,11 +58,6 @@ android { compose = true } - compileOptions { - sourceCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - targetCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - } - lint { quiet = true abortOnError = false diff --git a/feature/feed/build.gradle.kts b/feature/feed/build.gradle.kts index 00f802630..c4434d4c6 100644 --- a/feature/feed/build.gradle.kts +++ b/feature/feed/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -25,6 +23,10 @@ kotlin { implementation(compose.material3) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/feature/gallery-impl/build.gradle.kts b/feature/gallery-impl/build.gradle.kts index b5613b1bc..c34ac802e 100644 --- a/feature/gallery-impl/build.gradle.kts +++ b/feature/gallery-impl/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,20 +10,8 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } - jvm("desktop") { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } + androidTarget() + jvm("desktop") sourceSets { commonMain.dependencies { @@ -39,6 +31,10 @@ kotlin { implementation(libs.koin.compose) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { @@ -54,11 +50,6 @@ android { compose = true } - compileOptions { - sourceCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - targetCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - } - lint { quiet = true abortOnError = false diff --git a/feature/gallery/build.gradle.kts b/feature/gallery/build.gradle.kts index 0ed7b5d1a..4b858b93d 100644 --- a/feature/gallery/build.gradle.kts +++ b/feature/gallery/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -25,6 +23,10 @@ kotlin { implementation(compose.material3) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/feature/main-impl/build.gradle.kts b/feature/main-impl/build.gradle.kts index d7a8ab33f..f472a06f9 100644 --- a/feature/main-impl/build.gradle.kts +++ b/feature/main-impl/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -34,6 +32,10 @@ kotlin { implementation(libs.koin.compose) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { @@ -63,11 +65,6 @@ android { compose = true } - compileOptions { - sourceCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - targetCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - } - lint { quiet = true abortOnError = false diff --git a/feature/search-impl/build.gradle.kts b/feature/search-impl/build.gradle.kts index 5f81ece86..c4dcfb38a 100644 --- a/feature/search-impl/build.gradle.kts +++ b/feature/search-impl/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,20 +10,8 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } - jvm("desktop") { - compilations.all { - kotlinOptions { - jvmTarget = rootProject.extra.get("jvmTarget") as String - } - } - } + androidTarget() + jvm("desktop") sourceSets { commonMain.dependencies { @@ -42,6 +34,10 @@ kotlin { implementation(libs.koin.compose) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { @@ -57,11 +53,6 @@ android { compose = true } - compileOptions { - sourceCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - targetCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String) - } - lint { quiet = true abortOnError = false diff --git a/feature/search/build.gradle.kts b/feature/search/build.gradle.kts index 538927b7f..fd5cc2470 100644 --- a/feature/search/build.gradle.kts +++ b/feature/search/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -25,6 +23,10 @@ kotlin { implementation(compose.material3) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { diff --git a/feature/settings-impl/build.gradle.kts b/feature/settings-impl/build.gradle.kts index 0762d25f5..bd9de9e1c 100644 --- a/feature/settings-impl/build.gradle.kts +++ b/feature/settings-impl/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = "11" - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -36,6 +34,10 @@ kotlin { implementation(libs.koin.compose) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android { @@ -52,11 +54,6 @@ android { compose = true } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - lint { quiet = true abortOnError = false diff --git a/feature/settings/build.gradle.kts b/feature/settings/build.gradle.kts index 1522f2330..cafc8b1ea 100644 --- a/feature/settings/build.gradle.kts +++ b/feature/settings/build.gradle.kts @@ -1,3 +1,7 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.compose) @@ -6,13 +10,7 @@ plugins { } kotlin { - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - } - } + androidTarget() jvm("desktop") sourceSets { @@ -25,6 +23,10 @@ kotlin { implementation(compose.material3) } } + + compilerOptions { + jvmToolchain(libs.versions.jdk.get().toInt()) + } } android {