plugins { kotlin("multiplatform") version "1.6.10" kotlin("plugin.serialization") version "1.6.10" } group = "fi.schro" version = "0.0.1" repositories { mavenCentral() } kotlin { val hostOs = System.getProperty("os.name") val isMingwX64 = hostOs.startsWith("Windows") val nativeTarget = when { hostOs == "Mac OS X" -> macosX64("native") hostOs == "Linux" -> linuxX64("native") isMingwX64 -> mingwX64("native") else -> throw GradleException("Host OS is not supported in Kotlin/Native.") } nativeTarget.apply { binaries { executable { entryPoint = "fi.schro.main" } } } targets.withType { binaries.all { freeCompilerArgs += "-Xdisable-phases=EscapeAnalysis" } } sourceSets { val nativeMain by getting { dependencies { implementation("io.insert-koin:koin-core:3.1.5") implementation("com.github.ajalt.clikt:clikt:3.4.0") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.2") implementation("io.ktor:ktor-client-core:1.6.7") implementation("io.ktor:ktor-client-cio:1.6.7") implementation("io.ktor:ktor-client-serialization:1.6.7") } } val nativeTest by getting } }