This commit is contained in:
InsanusMokrassar 2023-10-25 15:33:05 +06:00
parent 44e86c9349
commit af04a854ef
3 changed files with 20 additions and 38 deletions

View File

@ -16,8 +16,6 @@ apply plugin: 'application'
mainClassName="RandomFileSenderBotKt" mainClassName="RandomFileSenderBotKt"
apply from: "$nativePartTemplate"
kotlin { kotlin {
jvm() jvm()
@ -32,3 +30,5 @@ kotlin {
} }
} }
apply from: "$nativePartTemplate"

View File

@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx2g
kotlin_version=1.9.20-RC kotlin_version=1.9.20-RC
telegram_bot_api_version=9.3.0-branch_9.3.0-RC-build1893-RC telegram_bot_api_version=9.3.0-RC
micro_utils_version=0.20.9-branch_0.20.9-build747 micro_utils_version=0.20.9-branch_0.20.9-build747
serialization_version=1.6.0 serialization_version=1.6.0
ktor_version=2.3.5 ktor_version=2.3.5

View File

@ -1,38 +1,20 @@
kotlin { kotlin {
// def hostOs = System.getProperty("os.name") def hostOs = System.getProperty("os.name")
// def isMingwX64 = hostOs.startsWith("Windows") def isMingwX64 = hostOs.startsWith("Windows")
// def isArch64 = System.getProperty("os.arch") == "aarch64" def isArch64 = System.getProperty("os.arch") == "aarch64"
//
// def nativeTarget
// if (hostOs == "Linux") {
// if (isArch64) {
// nativeTarget = linuxArm64("native") { binaries { executable() } }
// } else {
// 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 { def nativeTarget
// nativeMain { if (hostOs == "Linux") {
// dependencies { if (isArch64) {
// def engine nativeTarget = linuxArm64("native") { binaries { executable() } }
// } else {
// if (hostOs == "Linux") if (isArch64) engine = "cio" else engine = "curl" nativeTarget = linuxX64("native") { binaries { executable() } }
// else if (isMingwX64) engine = "winhttp" }
// else throw new GradleException("Host OS is not supported in Kotlin/Native.") } else {
// if (isMingwX64) {
// api "io.ktor:ktor-client-$engine:$ktor_version" nativeTarget = mingwX64("native") { binaries { executable() } }
// } } else {
// } throw new GradleException("Host OS is not supported in Kotlin/Native.")
// } }
}
linuxX64() { binaries { executable() } }
mingwX64() { binaries { executable() } }
linuxArm64() { binaries { executable() } }
} }