-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
34 lines (30 loc) · 917 Bytes
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
plugins {
id 'kotlin-multiplatform' version '1.3.0'
}
repositories {
mavenCentral()
}
final def os = org.gradle.internal.os.OperatingSystem.current()
kotlin {
final def nativePreset = os.isWindows() ? presets.mingwX64
: os.isLinux() ? presets.linuxX64
: os.isMacOsX() ? presets.macosX64
: /*unknown host*/ null
targets {
fromPreset(nativePreset, 'native') {
compilations.main {
outputKinds 'EXECUTABLE'
entryPoint 'sample.hello.main'
}
}
}
}
task runProgram {
def buildType = 'DEBUG' // 'RELEASE'
dependsOn kotlin.targets.native.compilations.main.linkTaskName('EXECUTABLE', buildType)
doLast {
exec {
executable kotlin.targets.native.compilations.main.getBinary('EXECUTABLE', buildType)
}
}
}