meldestelle/frontend/core/network/build.gradle.kts
Stefan Mogeritsch 35da070893 refactor(build): enable Wasm by default and refactor modules for improved KMP compatibility
Enabled Wasm target across all relevant modules and removed conditional enablement logic. Refactored `core:core-utils` to move JVM-specific code to a new `backend:infrastructure:persistence` module for strict KMP compliance. Updated dependencies, adjusted Gradle configurations, and resolved circular dependencies.
2026-01-09 14:36:10 +01:00

66 lines
1.6 KiB
Plaintext

@file:OptIn(ExperimentalKotlinGradlePluginApi::class)
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.kotlinSerialization)
}
kotlin {
// Toolchain is now handled centrally in the root build.gradle.kts
jvm()
js {
browser {
testTask { enabled = false }
}
}
// Wasm enabled by default
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs { browser() }
sourceSets {
commonMain.dependencies {
// Ktor Client core + JSON and Auth + Logging + Timeouts + Retry
api(libs.ktor.client.core)
implementation(libs.ktor.client.contentNegotiation)
implementation(libs.ktor.client.serialization.kotlinx.json)
implementation(libs.ktor.client.auth)
implementation(libs.ktor.client.logging)
// ktor-client-resources optional; disabled until version is added to catalog
// Kotlinx core bundles
implementation(libs.kotlinx.coroutines.core)
// DI (Koin)
api(libs.koin.core)
// Project modules via typesafe accessors
// (none here; kept for consistency)
}
jvmMain.dependencies {
implementation(libs.ktor.client.cio)
}
jsMain.dependencies {
implementation(libs.ktor.client.js)
}
val wasmJsMain = getByName("wasmJsMain")
wasmJsMain.dependencies {
implementation(libs.ktor.client.js)
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_25)
freeCompilerArgs.addAll("-opt-in=kotlin.RequiresOptIn")
}
}