Samples: Drop MPPTools + migrate to KTS
This commit is contained in:
committed by
Ilya Matveev
parent
859b670798
commit
e95be11ade
@@ -1,16 +0,0 @@
|
||||
plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project)
|
||||
|
||||
kotlin {
|
||||
targetFromPreset(hostPreset, 'workers') {
|
||||
binaries {
|
||||
executable() {
|
||||
entryPoint = 'sample.workers.main'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
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") {
|
||||
binaries {
|
||||
executable {
|
||||
entryPoint = "sample.workers.main"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user