plugins { id "org.jetbrains.kotlin.multiplatform" id "maven-publish" } allprojects { configurations.all { resolutionStrategy { // otherwise Kotlin throws an exception even though it is on the classpath: // "Ktor native HttpClient requires kotlinx.coroutines version with `native-mt` suffix (like `1.3.9-native-mt`)" force("org.jetbrains.kotlinx:kotlinx-coroutines-core:${coroutinesVersion}-native-mt") } } } kotlin { jvm { compilations.all { kotlinOptions.jvmTarget = '1.8' } withJava() testRuns["test"].executionTask.configure { useJUnitPlatform() } } // js(BOTH) { // browser { // commonWebpackConfig { // cssSupport.enabled = true // } // } // } ios { binaries { framework { baseName = "fints4k" } } } 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 { api project(":multiplatform-utils") implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.3.2" implementation "co.touchlab:stately-concurrency:1.2.0" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion" implementation "io.ktor:ktor-client-core:$ktorVersion" } } commonTest { dependencies { implementation kotlin("test") } } jvmMain { dependencies { implementation "io.ktor:ktor-client-okhttp:$ktorVersion" implementation "org.slf4j:slf4j-api:$slf4jVersion" } } jvmTest { dependencies { implementation "org.assertj:assertj-core:$assertJVersion" implementation "org.mockito:mockito-core:$mockitoVersion" // implementation project(":BankingUiCommon") // implementation project(":BankFinder") // implementation project(":fints4kBankingClient") implementation "org.apache.commons:commons-csv:1.8" implementation "org.slf4j:slf4j-simple:$slf4jVersion" } } // jsMain { // dependencies { // implementation npm("@js-joda/timezone", "2.3.0") // implementation "io.ktor:ktor-client-js:$ktorVersion" // } /* Plus: @JsModule("@js-joda/timezone") @JsNonModule external object JsJodaTimeZoneModule private val jsJodaTz = JsJodaTimeZoneModule */ // } // // jsTest { // // } iosMain { dependencies { // ktor Native needs "-native-mt" coroutines version. Export it so that referencing applications don't need to import it on their own api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion-native-mt") implementation "io.ktor:ktor-client-ios:$ktorVersion" } } nativeMain { dependencies { // ktor Native needs "-native-mt" coroutines version. Export it so that referencing applications don't need to import it on their own api "org.jetbrains.kotlinx:kotlinx-coroutines-core:${coroutinesVersion}-native-mt" // requires cURL to be installed on your system implementation "io.ktor:ktor-client-curl:$ktorVersion" } } } }