From 44e86c9349252b7df0908b58385d524c1e142395 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 21 Oct 2023 00:50:03 +0600 Subject: [PATCH] small fixes in ResenderBot Lib --- ResenderBot/ResenderBotLib/build.gradle | 1 + native_template.gradle | 64 +++++++++++++------------ 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/ResenderBot/ResenderBotLib/build.gradle b/ResenderBot/ResenderBotLib/build.gradle index 0530296..092aa78 100644 --- a/ResenderBot/ResenderBotLib/build.gradle +++ b/ResenderBot/ResenderBotLib/build.gradle @@ -22,6 +22,7 @@ kotlin { } linuxX64() mingwX64() + linuxArm64() sourceSets { commonMain { diff --git a/native_template.gradle b/native_template.gradle index 12cffdd..46c900c 100644 --- a/native_template.gradle +++ b/native_template.gradle @@ -1,34 +1,38 @@ kotlin { - def hostOs = System.getProperty("os.name") - def isMingwX64 = hostOs.startsWith("Windows") - def isArch64 = System.getProperty("os.arch") == "aarch64" +// def hostOs = System.getProperty("os.name") +// def isMingwX64 = hostOs.startsWith("Windows") +// 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.") +// } +// } - 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 { +// nativeMain { +// dependencies { +// def engine +// +// if (hostOs == "Linux") if (isArch64) engine = "cio" else 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" +// } +// } +// } - sourceSets { - nativeMain { - dependencies { - def engine - - if (hostOs == "Linux") if (isArch64) engine = "cio" else 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" - } - } - } + linuxX64() { binaries { executable() } } + mingwX64() { binaries { executable() } } + linuxArm64() { binaries { executable() } } }