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.
This commit is contained in:
@@ -1,90 +1,39 @@
|
||||
// Dieses Modul stellt gemeinsame technische Hilfsfunktionen bereit,
|
||||
// wie z.B. Konfigurations-Management, Datenbank-Verbindungen und Service Discovery.
|
||||
plugins {
|
||||
alias(libs.plugins.kotlinMultiplatform)
|
||||
alias(libs.plugins.kotlinSerialization)
|
||||
alias(libs.plugins.kotlinMultiplatform)
|
||||
alias(libs.plugins.kotlinSerialization)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
// Toolchain is now handled centrally in the root build.gradle.kts
|
||||
|
||||
// Target platforms
|
||||
jvm {
|
||||
compilerOptions {
|
||||
freeCompilerArgs.add("-opt-in=kotlin.time.ExperimentalTime")
|
||||
jvm()
|
||||
js {
|
||||
browser()
|
||||
}
|
||||
}
|
||||
|
||||
js(IR) {
|
||||
browser {
|
||||
testTask {
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
all {
|
||||
languageSettings.optIn("kotlin.uuid.ExperimentalUuidApi")
|
||||
// Wasm support enabled?
|
||||
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
|
||||
wasmJs {
|
||||
browser()
|
||||
}
|
||||
|
||||
commonMain.dependencies {
|
||||
// Domain models and types (core-utils depends on core-domain, not vice versa)
|
||||
api(projects.core.coreDomain)
|
||||
|
||||
api(libs.kotlinx.serialization.json)
|
||||
api(libs.kotlinx.datetime)
|
||||
// Async support (available for all platforms)
|
||||
api(libs.kotlinx.coroutines.core)
|
||||
// Utilities (multiplatform compatible)
|
||||
api(libs.bignum)
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation(projects.core.coreDomain)
|
||||
implementation(libs.kotlinx.serialization.json)
|
||||
implementation(libs.kotlinx.datetime)
|
||||
implementation(libs.kotlinx.coroutines.core)
|
||||
}
|
||||
}
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation(libs.kotlin.test)
|
||||
}
|
||||
}
|
||||
jvmMain {
|
||||
dependencies {
|
||||
// Removed Exposed dependencies to make this module KMP compatible
|
||||
// implementation(libs.exposed.core)
|
||||
// implementation(libs.exposed.jdbc)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
commonTest.dependencies {
|
||||
implementation(libs.kotlin.test)
|
||||
}
|
||||
|
||||
jvmMain.dependencies {
|
||||
// JVM-specific dependencies - access to central catalog
|
||||
api(projects.platform.platformDependencies)
|
||||
|
||||
// Database Management (JVM-specific)
|
||||
// Exposed dependencies restored for backend compatibility
|
||||
api(libs.exposed.core)
|
||||
api(libs.exposed.dao)
|
||||
api(libs.exposed.jdbc)
|
||||
api(libs.exposed.kotlin.datetime)
|
||||
|
||||
api(libs.flyway.core)
|
||||
api(libs.flyway.postgresql)
|
||||
|
||||
api(libs.hikari.cp)
|
||||
// Service Discovery (JVM-specific)
|
||||
api(libs.spring.cloud.starter.consul.discovery)
|
||||
// Logging (JVM-specific)
|
||||
api(libs.kotlin.logging.jvm)
|
||||
// Jakarta Annotation API
|
||||
api(libs.jakarta.annotation.api)
|
||||
// JSON Processing
|
||||
api(libs.jackson.module.kotlin)
|
||||
api(libs.jackson.datatype.jsr310)
|
||||
}
|
||||
jvmTest.dependencies {
|
||||
// Testing (JVM-specific)
|
||||
implementation(projects.platform.platformTesting)
|
||||
implementation(libs.junit.jupiter.api)
|
||||
implementation(libs.junit.jupiter.engine)
|
||||
implementation(libs.junit.jupiter.params)
|
||||
implementation(libs.junit.platform.launcher)
|
||||
implementation(libs.mockk)
|
||||
implementation(libs.assertj.core)
|
||||
implementation(libs.kotlinx.coroutines.test)
|
||||
|
||||
runtimeOnly(libs.postgresql.driver)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named<Test>("jvmTest") {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user