From 72cf7f36f488b8f25357346fc4d48ef92894172d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Fri, 23 Feb 2024 12:14:54 +0100 Subject: [PATCH] Add Kotlin BOM as the Material library ships with an old version --- .../dependencies/releaseRuntimeClasspath.txt | 1 + build-plugin/build.gradle.kts | 4 ++++ .../kotlin/thunderbird.app.android.gradle.kts | 2 ++ .../main/kotlin/thunderbird.app.jvm.gradle.kts | 2 ++ .../thunderbird.library.android.gradle.kts | 2 ++ .../kotlin/thunderbird.library.jvm.gradle.kts | 2 ++ build.gradle.kts | 6 ------ gradle/libs.versions.toml | 18 +++++++++++------- 8 files changed, 24 insertions(+), 13 deletions(-) diff --git a/app-k9mail/dependencies/releaseRuntimeClasspath.txt b/app-k9mail/dependencies/releaseRuntimeClasspath.txt index d128d0228..7a8471346 100644 --- a/app-k9mail/dependencies/releaseRuntimeClasspath.txt +++ b/app-k9mail/dependencies/releaseRuntimeClasspath.txt @@ -167,6 +167,7 @@ org.apache.james:apache-mime4j-core:0.8.9 org.apache.james:apache-mime4j-dom:0.8.9 org.jetbrains.compose.runtime:runtime:1.5.11 org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.9.22 +org.jetbrains.kotlin:kotlin-bom:1.9.22 org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.22 org.jetbrains.kotlin:kotlin-stdlib-common:1.9.22 org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.22 diff --git a/build-plugin/build.gradle.kts b/build-plugin/build.gradle.kts index 10e0b0818..e558aad65 100644 --- a/build-plugin/build.gradle.kts +++ b/build-plugin/build.gradle.kts @@ -18,6 +18,10 @@ dependencies { implementation(libs.diff.utils) compileOnly(libs.android.tools.common) + + // This defines the used Kotlin version for all Plugin dependencies + // and ensures that transitive dependencies are aligned on one version. + implementation(platform(libs.kotlin.gradle.bom)) } fun plugin(provider: Provider) = with(provider.get()) { diff --git a/build-plugin/src/main/kotlin/thunderbird.app.android.gradle.kts b/build-plugin/src/main/kotlin/thunderbird.app.android.gradle.kts index c4719de49..7ef73bb00 100644 --- a/build-plugin/src/main/kotlin/thunderbird.app.android.gradle.kts +++ b/build-plugin/src/main/kotlin/thunderbird.app.android.gradle.kts @@ -37,6 +37,8 @@ android { dependencies { coreLibraryDesugaring(libs.android.desugar) + implementation(platform(libs.kotlin.bom)) + implementation(libs.bundles.shared.jvm.android.app) testImplementation(libs.bundles.shared.jvm.test) diff --git a/build-plugin/src/main/kotlin/thunderbird.app.jvm.gradle.kts b/build-plugin/src/main/kotlin/thunderbird.app.jvm.gradle.kts index b95f2d83c..9c7b99d55 100644 --- a/build-plugin/src/main/kotlin/thunderbird.app.jvm.gradle.kts +++ b/build-plugin/src/main/kotlin/thunderbird.app.jvm.gradle.kts @@ -12,6 +12,8 @@ java { configureKotlinJavaCompatibility() dependencies { + implementation(platform(libs.kotlin.bom)) + implementation(libs.bundles.shared.jvm.main) testImplementation(libs.bundles.shared.jvm.test) } diff --git a/build-plugin/src/main/kotlin/thunderbird.library.android.gradle.kts b/build-plugin/src/main/kotlin/thunderbird.library.android.gradle.kts index fedfca3e2..bc47ab690 100644 --- a/build-plugin/src/main/kotlin/thunderbird.library.android.gradle.kts +++ b/build-plugin/src/main/kotlin/thunderbird.library.android.gradle.kts @@ -27,6 +27,8 @@ android { } dependencies { + implementation(platform(libs.kotlin.bom)) + implementation(libs.bundles.shared.jvm.main) implementation(libs.bundles.shared.jvm.android) diff --git a/build-plugin/src/main/kotlin/thunderbird.library.jvm.gradle.kts b/build-plugin/src/main/kotlin/thunderbird.library.jvm.gradle.kts index 7a6af3f32..af7835c2f 100644 --- a/build-plugin/src/main/kotlin/thunderbird.library.jvm.gradle.kts +++ b/build-plugin/src/main/kotlin/thunderbird.library.jvm.gradle.kts @@ -21,6 +21,8 @@ tasks.withType { configureKotlinJavaCompatibility() dependencies { + implementation(platform(libs.kotlin.bom)) + implementation(libs.bundles.shared.jvm.main) testImplementation(libs.bundles.shared.jvm.test) } diff --git a/build.gradle.kts b/build.gradle.kts index 1f8144230..d3595f6db 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -45,12 +45,6 @@ allprojects { .using(module("androidx.transition:transition:${libs.versions.androidxTransition.get()}")) substitute(module("org.jetbrains:annotations")) .using(module("org.jetbrains:annotations:${libs.versions.jetbrainsAnnotations.get()}")) - substitute(module("org.jetbrains.kotlin:kotlin-stdlib")) - .using(module("org.jetbrains.kotlin:kotlin-stdlib:${libs.versions.kotlin.get()}")) - substitute(module("org.jetbrains.kotlin:kotlin-stdlib-jdk7")) - .using(module("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${libs.versions.kotlin.get()}")) - substitute(module("org.jetbrains.kotlin:kotlin-stdlib-jdk8")) - .using(module("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${libs.versions.kotlin.get()}")) substitute(module("org.jetbrains.kotlinx:kotlinx-coroutines-android")) .using( module( diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a91f62640..84792c2bc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -72,7 +72,9 @@ koinCore = "3.5.3" koinAndroid = "3.5.3" koinAndroidCompose = "3.5.3" koinTest = "3.5.3" -kotlin = "1.9.22" +kotlinBom = "1.9.22" +# Needs to match the version used by Gradle, just check with `./gradlew --version` +kotlinGradleBom = "1.9.20" kotlinKsp = "1.9.22-1.0.17" kotlinxCoroutines = "1.8.0" kotlinxDateTime = "0.5.0" @@ -105,9 +107,9 @@ android-test = { id = "com.android.test", version.ref = "androidGradlePlugin" } dependency-check = { id = "com.github.ben-manes.versions", version.ref = "dependencyCheckPlugin" } dependency-guard = { id = "com.dropbox.dependency-guard", version.ref = "dependencyGuardPlugin" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detektPlugin" } -kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinBom" } +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlinBom" } +kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlinBom" } ksp = { id = "com.google.devtools.ksp", version.ref = "kotlinKsp" } spotless = { id = "com.diffplug.spotless", version.ref = "spotlessPlugin" } @@ -194,9 +196,11 @@ koin-android = { module = "io.insert-koin:koin-android", version.ref = "koinAndr koin-androidx-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koinAndroidCompose" } koin-test = { module = "io.insert-koin:koin-test", version.ref = "koinTest" } koin-test-junit4 = { module = "io.insert-koin:koin-test-junit4", version.ref = "koinTest" } -kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } -kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } -kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } +kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlinBom" } +kotlin-gradle-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlinGradleBom" } +kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" } +kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib" } +kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test" } kotlinx-collections-immutable = "org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7" kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinxCoroutines" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" }