-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
75 lines (65 loc) · 2.21 KB
/
build.gradle.kts
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
val toolVersion: String by project
val koinVersion: String by project
val cliktVersion: String by project
val coroutinesVersion: String by project
val serializationVersion: String by project
val datetimeVersion: String by project
val ktorVersion: String by project
plugins {
kotlin("multiplatform") version "1.6.10"
kotlin("plugin.serialization") version "1.6.10"
id("com.github.johnrengelman.shadow") version "7.1.2"
application
}
group = "fi.schro"
version = toolVersion
application {
mainClass.set("fi.schro.Main")
}
repositories {
mavenCentral()
}
kotlin {
//java compilation
jvm {
withJava()
}
//native compilation
val hostOs = System.getProperty("os.name")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
hostOs.startsWith("Windows") -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
nativeTarget.apply {
binaries {
executable("hc") {
entryPoint = "fi.schro.main"
}
}
}
targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
binaries.all {
freeCompilerArgs += "-Xdisable-phases=EscapeAnalysis"
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib"))
implementation("io.insert-koin:koin-core:$koinVersion")
implementation("com.github.ajalt.clikt:clikt:$cliktVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:$datetimeVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-serialization:$ktorVersion")
}
}
val commonTest by getting
val nativeMain by getting
val jvmMain by getting
}
}