BankingClient/BankingClientModel/build.gradle.kts

139 lines
3.1 KiB
Plaintext

@file:OptIn(ExperimentalWasmDsl::class)
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
plugins {
kotlin("multiplatform")
kotlin("plugin.noarg")
// kotlin("plugin.serialization")
}
kotlin {
jvmToolchain(8)
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
// suppresses compiler warning: [EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING] 'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta.
freeCompilerArgs.add("-Xexpect-actual-classes")
}
jvm {
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
testLogging {
showExceptions = true
showStandardStreams = true
events("passed", "skipped", "failed")
// exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
}
js {
moduleName = "banking-client-model"
binaries.executable()
browser {
testTask {
useKarma {
useChromeHeadless()
useFirefoxHeadless()
}
}
}
nodejs {
testTask {
useMocha {
timeout = "20s" // Mocha times out after 2 s, which is too short for bufferExceeded() test
}
}
}
}
wasmJs()
linuxX64()
mingwX64()
iosX64()
iosArm64()
iosSimulatorArm64()
macosX64()
macosArm64()
watchosArm64()
watchosSimulatorArm64()
tvosArm64()
tvosSimulatorArm64()
applyDefaultHierarchyTemplate()
val kotlinxDateTimeVersion: String by project
val jsJodaTimeZoneVersion: String by project
val ionspinBigNumVersion: String by project
sourceSets {
commonMain {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-datetime:$kotlinxDateTimeVersion")
}
}
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
jvmMain {
dependencies {
compileOnly("com.fasterxml.jackson.core:jackson-annotations:2.15.0")
}
}
jvmTest { }
jsMain {
dependencies {
api(npm("@js-joda/timezone", jsJodaTimeZoneVersion))
implementation(npm("big.js", "6.0.3"))
}
}
jsTest { }
nativeMain { }
nativeTest { }
linuxMain {
dependencies {
implementation("com.ionspin.kotlin:bignum:$ionspinBigNumVersion")
}
}
mingwMain {
dependencies {
implementation("com.ionspin.kotlin:bignum:$ionspinBigNumVersion")
}
}
}
}
noArg {
annotation("net.codinux.accounting.common.config.NoArgConstructor")
}
ext["customArtifactId"] = "banking-client-model"
apply(from = "../gradle/scripts/publish-codinux.gradle.kts")