TelegramBotAPI-examples/RandomFileSenderBot/build.gradle

53 lines
1.2 KiB
Groovy
Raw Permalink Normal View History

2020-06-02 13:28:10 +00:00
buildscript {
repositories {
mavenCentral()
2020-06-02 13:28:10 +00:00
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
2023-04-19 14:20:11 +00:00
plugins {
id "org.jetbrains.kotlin.multiplatform"
}
2020-06-02 13:28:10 +00:00
apply plugin: 'application'
2020-06-02 14:24:41 +00:00
mainClassName="RandomFileSenderBotKt"
2020-06-02 13:28:10 +00:00
2023-04-19 14:20:11 +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.")
jvm()
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
api "dev.inmo:tgbotapi:$telegram_bot_api_version"
}
}
2020-06-02 13:28:10 +00:00
2023-04-19 14:20:11 +00:00
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"
}
}
}
2020-06-02 13:28:10 +00:00
}
2023-04-19 14:20:11 +00:00