Samples: Get rid of KotlinNativeTarget and KonanTarget imports
This commit is contained in:
committed by
Ilya Matveev
parent
edda913b04
commit
90decbf517
@@ -1,23 +1,20 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetPreset
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
val hostOs = System.getProperty("os.name")
|
||||
|
||||
val hostPreset: KotlinNativeTargetPreset = when {
|
||||
hostOs == "Mac OS X" -> "macosX64"
|
||||
hostOs == "Linux" -> "linuxX64"
|
||||
hostOs.startsWith("Windows") -> "mingwX64"
|
||||
else -> throw GradleException("Host OS '$hostOs' is not supported in Kotlin/Native $project.")
|
||||
}.let {
|
||||
kotlin.presets[it] as KotlinNativeTargetPreset
|
||||
}
|
||||
|
||||
kotlin {
|
||||
targetFromPreset(hostPreset, "workers") {
|
||||
// Determine host preset.
|
||||
val hostOs = System.getProperty("os.name")
|
||||
|
||||
// Create target for the host platform.
|
||||
val hostTarget = when {
|
||||
hostOs == "Mac OS X" -> macosX64("workers")
|
||||
hostOs == "Linux" -> linuxX64("workers")
|
||||
hostOs.startsWith("Windows") -> mingwX64("workers")
|
||||
else -> throw GradleException("Host OS '$hostOs' is not supported in Kotlin/Native $project.")
|
||||
}
|
||||
|
||||
hostTarget.apply {
|
||||
binaries {
|
||||
executable {
|
||||
entryPoint = "sample.workers.main"
|
||||
|
||||
Reference in New Issue
Block a user