fints4k/multiplatform-utils/build.gradle

122 lines
2.8 KiB
Groovy

plugins {
id "org.jetbrains.kotlin.multiplatform"
id "maven-publish"
}
group = "net.codinux.utils"
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = '1.8'
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(IR) {
binaries.executable()
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
testTask {
useKarma {
// we cannot assume that Chrome and Firefox are installed on all systems
// useChromeHeadless()
// useFirefox()
enabled = false
}
}
}
nodejs {
testTask {
useMocha {
enabled = true
}
testLogging {
events "failed"
}
}
}
}
ios {
binaries {
framework {
baseName = "MultiplatformUtils"
}
}
}
def hostOs = System.getProperty("os.name")
def isMingwX64 = hostOs.startsWith("Windows")
def nativeTarget
if (hostOs == "Mac OS X") nativeTarget = macosX64('native')
else if (hostOs == "Linux") nativeTarget = linuxX64("native")
else if (isMingwX64) nativeTarget = mingwX64("native")
else throw new GradleException("Host OS is not supported in Kotlin/Native.")
sourceSets {
commonMain {
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.3.2"
}
}
commonTest {
dependencies {
implementation kotlin("test-common")
implementation kotlin("test-annotations-common")
}
}
jvmMain {
dependencies {
compileOnly "org.slf4j:slf4j-api:$slf4jVersion"
compileOnly "com.fasterxml.jackson.core:jackson-databind:2.9.9"
}
}
jvmTest {
dependencies {
implementation kotlin("test-junit")
implementation "org.junit.jupiter:junit-jupiter:$junit5Version"
runtimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit5Version"
implementation "org.slf4j:slf4j-simple:$slf4jVersion"
}
}
jsMain {
dependencies {
implementation npm("@js-joda/timezone", "2.3.0")
}
}
jsTest {
dependencies {
implementation kotlin("test-js") // don't know why this dependency is needed here, it's not needed e.g. in fints4k project
}
}
iosMain {
dependencies {
}
}
}
}