1
0
Fork 0
happy-cat/build.gradle.kts

75 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

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
2022-02-12 09:28:46 -05:00
plugins {
kotlin("multiplatform") version "1.6.10"
kotlin("plugin.serialization") version "1.6.10"
id("com.github.johnrengelman.shadow") version "7.1.2"
application
2022-02-12 09:28:46 -05:00
}
group = "fi.schro"
version = toolVersion
2022-02-12 09:28:46 -05:00
application {
mainClass.set("fi.schro.Main")
}
2022-02-12 09:28:46 -05:00
repositories {
mavenCentral()
}
kotlin {
//java compilation
jvm {
withJava()
}
//native compilation
2022-02-12 09:28:46 -05:00
val hostOs = System.getProperty("os.name")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
hostOs.startsWith("Windows") -> mingwX64("native")
2022-02-12 09:28:46 -05:00
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
nativeTarget.apply {
binaries {
2022-02-25 13:47:05 -05:00
executable("hc") {
2022-02-12 09:28:46 -05:00
entryPoint = "fi.schro.main"
}
}
}
2022-02-14 15:38:34 -05:00
targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
binaries.all {
freeCompilerArgs += "-Xdisable-phases=EscapeAnalysis"
}
}
2022-02-12 09:28:46 -05:00
sourceSets {
val commonMain by getting {
2022-02-12 09:28:46 -05:00
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")
2022-02-12 09:28:46 -05:00
}
}
val commonTest by getting
val nativeMain by getting
val jvmMain by getting
2022-02-12 09:28:46 -05:00
}
}