Files
meldestelle/frontend/core/network/build.gradle.kts
T
stefan 591f703015 refactor(build): centralize JVM toolchain configuration in root build.gradle.kts
Removed redundant `jvmToolchain(25)` declarations across module build scripts, as the JVM toolchain is now managed centrally. Added comments for clarity.
2026-01-03 12:52:01 +01:00

70 lines
1.8 KiB
Kotlin

@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
val enableWasm = providers.gradleProperty("enableWasm").orNull == "true"
jvm()
js {
browser {
testTask { enabled = false }
}
}
if (enableWasm) {
@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.bundles.kotlinx.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)
}
if (enableWasm) {
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")
}
}