Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use stable Ktor for non-wasm targets #28

Merged
merged 1 commit into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions catalog/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ kotlin {
implementation(compose.foundation)
implementation(compose.material3)
implementation(libs.kotlinx.serialization.json)

implementation(libs.ktor.client.core)
implementation(libs.ktor.serialization.json)
implementation(libs.ktor.client.contentNegotiation)
Expand Down Expand Up @@ -97,8 +98,7 @@ kotlin {
}
}

val webMain by creating {
dependsOn(commonMain)
val jsMain by getting {
resources.srcDirs("src/commonRes", "../sdui/src/commonRes")
dependencies {
implementation(projects.design)
Expand All @@ -107,12 +107,19 @@ kotlin {
}
}

val jsMain by getting {
dependsOn(webMain)
}

val wasmJsMain by getting {
dependsOn(webMain)
dependsOn(commonMain)
resources.srcDirs("src/commonRes", "../sdui/src/commonRes")
dependencies {
implementation(projects.design)
implementation(compose.ui)

val wasmKtor = "3.0.0-wasm1"
implementation("io.ktor:ktor-client-core:$wasmKtor")
implementation("io.ktor:ktor-serialization-kotlinx-json:$wasmKtor")
implementation("io.ktor:ktor-client-content-negotiation:$wasmKtor")
implementation("io.ktor:ktor-client-logging:$wasmKtor")
}
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions design/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kotlin {

js(IR) { browser() }
@OptIn(ExperimentalWasmDsl::class)
wasmJs() { browser() }
wasmJs { browser() }

androidTarget {
compilations.all {
Expand Down Expand Up @@ -73,19 +73,23 @@ kotlin {
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
implementation(libs.coil.network.ktor)
implementation(libs.ktor.client.core)
}
}

val jsMain by getting {
dependsOn(webMain)
dependencies {
implementation(libs.ktor.client.js)
implementation(libs.ktor.client.core)
}
}

val wasmJsMain by getting {
dependsOn(webMain)
dependencies {
val wasmKtor = "3.0.0-wasm1"
implementation("io.ktor:ktor-client-core:$wasmKtor")
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ coroutines = "1.8.1"
foundation = "1.6.7"
kotlin = "1.9.23"
kotlinx-serialization = "1.6.3"
ktor = "3.0.0-wasm1"
ktor = "2.3.8"
compose-compiler = "1.5.13"
compose-jb = "1.6.1"
spotless = "6.14.0"
Expand Down Expand Up @@ -49,4 +49,4 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
jetbrain-compose = { id = "org.jetbrains.compose", version.ref = "compose-jb" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
Loading