Samples: Drop MPPTools + migrate to KTS

This commit is contained in:
Dmitriy Dolovov
2019-05-29 11:54:42 +03:00
committed by Ilya Matveev
parent 859b670798
commit e95be11ade
43 changed files with 981 additions and 980 deletions
-16
View File
@@ -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'
}
}
}
}
+27
View File
@@ -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"
}
}
}
}