@@ -52,14 +52,10 @@ fun defaultHostPreset(
|
||||
else -> null
|
||||
}
|
||||
|
||||
val preset = if (presetCandidate != null && presetCandidate in whitelist)
|
||||
return if (presetCandidate != null && presetCandidate in whitelist)
|
||||
presetCandidate
|
||||
else
|
||||
throw Exception("Host OS '$hostOs' is not supported in Kotlin/Native ${subproject.displayName}.")
|
||||
|
||||
subproject.ext.set("hostPreset", preset)
|
||||
|
||||
return preset
|
||||
}
|
||||
|
||||
// A short-cut to add a Kotlin/Native run task.
|
||||
|
||||
@@ -2,9 +2,12 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project)
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(MPPTools.defaultHostPreset(project), 'csvParser') {
|
||||
fromPreset(hostPreset, 'csvParser') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
compilations.main.entryPoint 'sample.csvparser.main'
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import java.nio.file.Paths
|
||||
|
||||
plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
@@ -10,12 +8,10 @@ repositories {
|
||||
maven { url = "file://$localRepo" }
|
||||
}
|
||||
|
||||
kotlin {
|
||||
presets {
|
||||
// Determine host preset.
|
||||
MPPTools.defaultHostPreset(project, [macosX64, linuxX64])
|
||||
}
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64, kotlin.presets.linuxX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(hostPreset, 'curl') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
|
||||
@@ -2,9 +2,12 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project)
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(MPPTools.defaultHostPreset(project), 'echoServer') {
|
||||
fromPreset(hostPreset, 'echoServer') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
compilations.main.entryPoint 'sample.echoserver.main'
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
kotlin {
|
||||
presets {
|
||||
// Determine host preset.
|
||||
MPPTools.defaultHostPreset(project, [macosX64, linuxX64])
|
||||
}
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64, kotlin.presets.linuxX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(hostPreset, 'gitChurn') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
|
||||
@@ -2,9 +2,12 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project)
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(MPPTools.defaultHostPreset(project), 'globalState') {
|
||||
fromPreset(hostPreset, 'globalState') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
compilations.main.entryPoint 'sample.globalstate.main'
|
||||
compilations.main.cinterops {
|
||||
|
||||
@@ -2,12 +2,10 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
kotlin {
|
||||
presets {
|
||||
// Determine host preset.
|
||||
MPPTools.defaultHostPreset(project, [macosX64, linuxX64])
|
||||
}
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64, kotlin.presets.linuxX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(hostPreset, 'gtk') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
|
||||
@@ -20,12 +20,10 @@ task cleanLocalRepo(type: Delete) {
|
||||
delete localRepo
|
||||
}
|
||||
|
||||
kotlin {
|
||||
presets {
|
||||
// Determine host preset.
|
||||
MPPTools.defaultHostPreset(project, [macosX64, linuxX64])
|
||||
}
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64, kotlin.presets.linuxX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(hostPreset, 'libcurl') {
|
||||
compilations.main.cinterops {
|
||||
|
||||
@@ -2,12 +2,10 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
kotlin {
|
||||
presets {
|
||||
// Determine host preset.
|
||||
MPPTools.defaultHostPreset(project, [macosX64, linuxX64])
|
||||
}
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64, kotlin.presets.linuxX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(hostPreset, 'nonBlockingEchoServer') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
|
||||
@@ -2,9 +2,12 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(MPPTools.defaultHostPreset(project, [presets.macosX64]), 'objc') {
|
||||
fromPreset(hostPreset, 'objc') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
compilations.main.entryPoint 'sample.objc.main'
|
||||
}
|
||||
|
||||
@@ -2,9 +2,12 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(MPPTools.defaultHostPreset(project, [presets.macosX64]), 'opengl') {
|
||||
fromPreset(hostPreset, 'opengl') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
compilations.main.entryPoint 'sample.opengl.main'
|
||||
}
|
||||
|
||||
@@ -4,9 +4,12 @@ plugins {
|
||||
|
||||
def tensorflowHome = "${MPPTools.kotlinNativeDataPath()}/third-party/tensorflow"
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64, kotlin.presets.linuxX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(MPPTools.defaultHostPreset(project, [presets.macosX64, presets.linuxX64]), 'tensorflow') {
|
||||
fromPreset(hostPreset, 'tensorflow') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
compilations.main.entryPoint 'sample.tensorflow.main'
|
||||
compilations.main.linkerOpts "-L$tensorflowHome/lib", '-ltensorflow'
|
||||
|
||||
@@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
File winCompiledResourceFile = file("$buildDir/compiledWindowsResources/Tetris.res")
|
||||
project.ext.hostPreset = determinePreset()
|
||||
def hostPreset = determinePreset()
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
|
||||
@@ -4,9 +4,12 @@ plugins {
|
||||
|
||||
def torchHome = "${MPPTools.kotlinNativeDataPath()}/third-party/torch"
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64, kotlin.presets.linuxX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(MPPTools.defaultHostPreset(project, [presets.macosX64, presets.linuxX64]), 'torch') {
|
||||
fromPreset(hostPreset, 'torch') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
compilations.main.entryPoint 'sample.torch.main'
|
||||
compilations.main.linkerOpts "-L$torchHome/lib", '-lATen'
|
||||
|
||||
@@ -2,12 +2,10 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
kotlin {
|
||||
presets {
|
||||
// Determine host preset.
|
||||
MPPTools.defaultHostPreset(project, [macosX64, linuxX64, mingwX64])
|
||||
}
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64, kotlin.presets.linuxX64, kotlin.presets.mingwX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(hostPreset, 'videoPlayer') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
|
||||
@@ -2,9 +2,12 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.mingwX64])
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(MPPTools.defaultHostPreset(project, [presets.mingwX64]), 'win32') {
|
||||
fromPreset(hostPreset, 'win32') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
compilations.main.entryPoint 'sample.win32.main'
|
||||
compilations.main.linkerOpts '-Wl,--subsystem,windows'
|
||||
|
||||
@@ -2,9 +2,12 @@ plugins {
|
||||
id 'kotlin-multiplatform'
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project)
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(MPPTools.defaultHostPreset(project), 'workers') {
|
||||
fromPreset(hostPreset, 'workers') {
|
||||
compilations.main.outputKinds 'EXECUTABLE'
|
||||
compilations.main.entryPoint 'sample.workers.main'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user