From 136eddb3bd6d50b96e302cb8ad691a9867377fd8 Mon Sep 17 00:00:00 2001 From: Travis Wyatt Date: Thu, 21 Mar 2024 09:57:59 -0700 Subject: [PATCH] Explicitly pull in AtomicFU dependency (#656) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In #649, I wrongfully assumed that the AtomicFU dependency workaround was no longer needed — it is still needed. --- build.gradle.kts | 2 +- core/build.gradle.kts | 8 ++++++-- gradle/libs.versions.toml | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 09eb7e0d8..6358819f5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ buildscript { mavenCentral() } dependencies { - classpath(libs.atomicfu) + classpath(libs.atomicfu.gradle) } } diff --git a/core/build.gradle.kts b/core/build.gradle.kts index a5bacad7a..662a65114 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -23,11 +23,10 @@ kotlin { sourceSets { commonMain.dependencies { - api(project(":exceptions")) api(libs.kotlinx.coroutines.core) api(libs.uuid) + api(project(":exceptions")) implementation(libs.tuulbox.collections) - } commonTest.dependencies { @@ -40,6 +39,11 @@ kotlin { api(libs.kotlinx.coroutines.android) implementation(libs.androidx.core) implementation(libs.androidx.startup) + + // Workaround for AtomicFU plugin not automatically adding JVM dependency for Android. + // https://github.com/Kotlin/kotlinx-atomicfu/issues/145 + implementation(libs.atomicfu) + implementation(libs.tuulbox.coroutines) } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 82e31de53..4ee1e2142 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,7 @@ [versions] android-compile = "34" android-min = "21" +atomicfu = "0.23.2" coroutines = "1.8.0" jvm-toolchain = "11" kotlin = "1.9.23" @@ -9,7 +10,8 @@ tuulbox = "7.2.0" [libraries] androidx-core = { module = "androidx.core:core-ktx", version = "1.12.0" } androidx-startup = { module = "androidx.startup:startup-runtime", version = "1.1.1" } -atomicfu = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version = "0.23.2" } +atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version.ref = "atomicfu" } +atomicfu-gradle = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" } khronicle = { module = "com.juul.khronicle:khronicle-core", version = "0.1.0" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }