``` final def os = org.gradle.internal.os.Operatin...
# multiplatform
m
Copy code
final def os = org.gradle.internal.os.OperatingSystem.current()

kotlin {
    final def hostPreset = os.isWindows() ? presets.mingwX64
                         : os.isLinux()   ? presets.linuxX64
                         : os.isMacOsX()  ? presets.macosX64
                         : /* ??? */ null
    targets {
        fromPreset(hostPreset, 'hello') {
            compilations.main {
                outputKinds 'EXECUTABLE'
                entryPoint 'sample.hello.main'
            }
        }
    }
}
https://github.com/msink/hello-kotlin