From 0727033272758ac372d3033cd2d334357a6ec0c4 Mon Sep 17 00:00:00 2001 From: skydoves Date: Tue, 24 Sep 2024 21:39:37 +0900 Subject: [PATCH] Reconfigure coil3 dependencies and support targets --- .../landscapist/ComposeMultiplatform.kt | 1 - coil3/build.gradle.kts | 22 ++++++++++++++----- gradle/libs.versions.toml | 5 +++++ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/build-logic/convention/src/main/kotlin/com/skydoves/landscapist/ComposeMultiplatform.kt b/build-logic/convention/src/main/kotlin/com/skydoves/landscapist/ComposeMultiplatform.kt index 153469dc..04d5ff09 100644 --- a/build-logic/convention/src/main/kotlin/com/skydoves/landscapist/ComposeMultiplatform.kt +++ b/build-logic/convention/src/main/kotlin/com/skydoves/landscapist/ComposeMultiplatform.kt @@ -38,7 +38,6 @@ internal fun Project.configureComposeMultiplatform( androidTarget { publishLibraryVariants("release") } jvm("desktop") - @OptIn(ExperimentalWasmDsl::class) wasmJs { browser { testTask { diff --git a/coil3/build.gradle.kts b/coil3/build.gradle.kts index a0e1d3db..8fad19e5 100644 --- a/coil3/build.gradle.kts +++ b/coil3/build.gradle.kts @@ -48,7 +48,7 @@ kotlin { api(project(":landscapist")) api(libs.coil3) api(libs.coil3.network.ktor3) - api(libs.ktor.core) + api(libs.kotlinx.serialization.json) implementation(compose.ui) implementation(compose.runtime) @@ -58,21 +58,31 @@ kotlin { } } - val androidMain by getting { + androidMain { dependencies { - implementation(libs.androidx.core.ktx) + api(libs.coil3.network.okhttp) + api(libs.coil.gif) + api(libs.coil.video) + api(libs.androidx.core.ktx) } } - val jvmMain by getting { + appleMain { + dependencies { + api(libs.coil3.network.ktor3) + api(libs.ktor.engine.darwin) + } + } + + jvmMain { dependencies { api(libs.ktor.okhttp) } } - val iosMain by getting { + named("wasmJsMain") { dependencies { - api(libs.ktor.engine.darwin) + api(libs.coil3.network.ktor3) } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e9b3bfa8..fb6e769b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -17,6 +17,7 @@ androidxJunit = "1.2.1" androidxMacroBenchmark = "1.4.0-alpha01" androidxProfileinstaller = "1.4.0" androidxUiAutomator = "2.3.0" +kotlinxSerializationJson = "1.7.3" jetbrains-compose = "1.6.11" glide = "4.16.0" fresco = "3.2.0" @@ -65,13 +66,17 @@ fresco-websupport = { group = "com.facebook.fresco", name = "webpsupport", versi fresco-middleware = { group = "com.facebook.fresco", name = "middleware", version.ref = "fresco" } coil = { group = "io.coil-kt", name = "coil", version.ref = "coil" } coil-gif = { group = "io.coil-kt", name = "coil-gif", version.ref = "coil" } +coil-video = { group = "io.coil-kt", name = "coil-video", version.ref = "coil" } +coil-svg = { group = "io.coil-kt", name = "coil-svg", version.ref = "coil" } coil3 = { group = "io.coil-kt.coil3", name = "coil", version.ref = "coil3" } coil3-network-ktor2 = { group = "io.coil-kt.coil3", name = "coil-network-ktor2", version.ref = "coil3" } coil3-network-ktor3 = { group = "io.coil-kt.coil3", name = "coil-network-ktor3", version.ref = "coil3" } +coil3-network-okhttp = { group = "io.coil-kt.coil3", name = "coil-network-okhttp", version.ref = "coil3" } ktor-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" } ktor-okhttp = { group = "io.ktor", name = "ktor-client-okhttp", version.ref = "ktor" } ktor-engine-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" } ktor-engine-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" } +kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } # Dependencies of the included build-logic android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }