Bernhard
02/26/2026, 9:46 AMimport com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
repositories {
mavenCentral()
}
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.versions)
alias(libs.plugins.openapi.generator)
}
group = "at.fyayc"
version = "0.0.1-SNAPSHOT"
description = "Emporix API Client"
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict", "-Xannotation-default-target=param-property")
}
sourceSets {
commonMain.dependencies {
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.cio)
implementation(libs.kotlinx.serialization.core)
implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlinx.datetime)
implementation(libs.kotlinx.coroutines)
}
commonTest.dependencies {
implementation(libs.kotlin.test)
}
jsMain.dependencies {
implementation(libs.kotlinx.coroutines.js)
}
jsTest.dependencies {
implementation(libs.kotlin.test.js)
}
jvmMain.dependencies {
implementation(libs.ktor.client.java)
}
jvmTest.dependencies {
}
}
js {
}
jvm {
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
// do not show beta and milestone versions as upgrades
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
val version = candidate.version
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
isStable.not()
}
}CLOVIS
02/26/2026, 9:49 AMrepositories {} block after the plugins {} block
• I always see the declaration of platforms (js {} , jvm {}) before the sourceSets configuration
I'm not sure if that could impact it thoughBernhard
02/26/2026, 9:49 AMBernhard
02/26/2026, 9:50 AMBernhard
02/26/2026, 9:50 AMBernhard
02/26/2026, 9:51 AMBernhard
02/26/2026, 9:51 AMhfhbd
02/26/2026, 10:10 AMBernhard
02/26/2026, 10:10 AMhfhbd
02/26/2026, 10:12 AMBernhard
02/26/2026, 10:12 AMBernhard
02/26/2026, 10:12 AMBernhard
02/26/2026, 10:12 AMBernhard
02/26/2026, 10:12 AMhfhbd
02/26/2026, 10:13 AMhfhbd
02/26/2026, 10:14 AMBernhard
02/26/2026, 10:14 AMBernhard
02/26/2026, 10:16 AMBernhard
02/26/2026, 10:16 AMCLOVIS
02/26/2026, 10:21 AMval client = HttpClient()
in commonMainCLOVIS
02/26/2026, 10:21 AMBernhard
02/26/2026, 10:23 AMBernhard
02/26/2026, 10:23 AMBernhard
02/26/2026, 10:25 AMBernhard
02/26/2026, 10:27 AMpackage at.fyayc.emporixapi
import io.ktor.client.*
import io.ktor.client.request.get
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
@OptIn(DelicateCoroutinesApi::class)
fun main() {
println("yo")
val client = HttpClient()
GlobalScope.launch {
val response = client.get("<https://webhook.site/84e3873b-4d08-4191-bd5a-ad7d7d07524a>")
println(response.status.value)
println("this is a test")
}
}Bernhard
02/26/2026, 10:28 AMBernhard
02/26/2026, 10:28 AMBernhard
02/26/2026, 10:28 AMBernhard
02/26/2026, 10:29 AMBernhard
02/26/2026, 10:29 AMBernhard
02/26/2026, 10:37 AMhfhbd
02/26/2026, 10:38 AMsuspend fun main() = coroutineScope {} and launch(CoroutineExceptionHandler { _, exception ->
exception.printStackTrace()
}) {} instead of GlobalScope (is it okay on JS, but a code smell IMHO)hfhbd
02/26/2026, 10:39 AMrunBlocking is not supported on JS. JS is almost async.CLOVIS
02/26/2026, 10:39 AMalso using ./gradlew runJvm does not print anything after the get requestThat's expected, you're using GlobalScope, and main doesn't wait for it to finish
CLOVIS
02/26/2026, 10:40 AMfun main() = runBlocking(Dispatchers.Default) {
// …
}hfhbd
02/26/2026, 10:40 AMCLOVIS
02/26/2026, 10:40 AMBernhard
02/26/2026, 10:40 AMBernhard
02/26/2026, 10:41 AMhfhbd
02/26/2026, 10:41 AMCLOVIS
02/26/2026, 10:41 AMcoroutineScope {} will workhfhbd
02/26/2026, 10:41 AMBernhard
02/26/2026, 10:43 AMBernhard
02/26/2026, 10:43 AMBernhard
02/26/2026, 10:43 AMhfhbd
02/26/2026, 10:44 AMBernhard
02/26/2026, 10:46 AMBernhard
02/26/2026, 10:46 AMBernhard
02/26/2026, 10:47 AMBernhard
02/26/2026, 10:48 AMpackage at.fyayc.emporixapi
import io.ktor.client.*
import io.ktor.client.request.get
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
suspend fun main() = coroutineScope {
println("yo")
val client = HttpClient()
println("test")
launch(CoroutineExceptionHandler { _, exception ->
exception.printStackTrace()
}) {
val response = client.get("<https://webhook.site/84e3873b-4d08-4191-bd5a-ad7d7d07524a>")
println(response.status.value)
println("this is a test")
}
return@coroutineScope
}Bernhard
02/26/2026, 10:49 AMhfhbd
02/26/2026, 10:49 AMBernhard
02/26/2026, 10:49 AMTLS sessions are not supported on Native platform
CLOVIS
02/26/2026, 10:50 AMCLOVIS
02/26/2026, 10:50 AMBernhard
02/26/2026, 10:50 AMBernhard
02/26/2026, 10:50 AM