update native buildings configuration

This commit is contained in:
2023-10-21 00:28:12 +06:00
parent 9b7605591e
commit 65c32d97d5
5 changed files with 40 additions and 68 deletions
InlineQueriesBot
RandomFileSenderBot
ResenderBot/native_launcher
build.gradlenative_template.gradle

@ -16,15 +16,9 @@ apply plugin: 'application'
mainClassName="RandomFileSenderBotKt"
apply from: "$nativePartTemplate"
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 {
@ -35,18 +29,6 @@ kotlin {
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.")
api "io.ktor:ktor-client-$engine:$ktor_version"
}
}
}
}