TelegramBotAPI-examples/NativeRandomFileSenderBot/build.gradle

50 lines
1.3 KiB
Groovy
Raw Normal View History

2023-04-03 19:01:22 +00:00
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "org.jetbrains.kotlin.multiplatform"
}
2023-04-17 21:17:04 +00:00
repositories {
maven { url "https://maven.pkg.jetbrains.space/public/p/ktor/eap/" }
}
2023-04-03 19:01:22 +00:00
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 "dev.inmo:tgbotapi:$telegram_bot_api_version"
}
}
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.")
2023-04-17 21:17:04 +00:00
api "io.ktor:ktor-client-$engine:2.3.0-eap-638"
2023-04-03 19:01:22 +00:00
}
}
}
}