mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-12-23 00:57:18 +00:00
47 lines
1.2 KiB
Groovy
47 lines
1.2 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id "org.jetbrains.kotlin.multiplatform"
|
|
}
|
|
|
|
|
|
kotlin {
|
|
def hostOs = System.getProperty("os.name")
|
|
def isMingwX64 = hostOs.startsWith("Windows")
|
|
def nativeTarget
|
|
if (hostOs == "Linux") nativeTarget = linuxX64("native") { binaries { executable() } }
|
|
else if (isMingwX64) nativeTarget = mingwX64("native") { binaries { executable() } }
|
|
else throw new GradleException("Host OS is not supported in Kotlin/Native.")
|
|
|
|
sourceSets {
|
|
commonMain {
|
|
dependencies {
|
|
implementation kotlin('stdlib')
|
|
|
|
api project(":ResenderBot:ResenderBotLib")
|
|
}
|
|
}
|
|
|
|
nativeMain {
|
|
dependencies {
|
|
def engine
|
|
|
|
if (hostOs == "Linux") engine = "curl"
|
|
else if (isMingwX64) engine = "winhttp"
|
|
else throw new GradleException("Host OS is not supported in Kotlin/Native.")
|
|
|
|
api "io.ktor:ktor-client-$engine:$ktor_version"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|