From 8d812a04c605f329367e185d20ffebd16a088f89 Mon Sep 17 00:00:00 2001 From: Martmists Date: Sat, 1 Jun 2024 15:18:58 +0200 Subject: [PATCH] add macos support Signed-off-by: Martmists --- buildSrc/src/main/kotlin/DownloadPythonTask.kt | 2 ++ kpy-library/build.gradle.kts | 1 + 2 files changed, 3 insertions(+) diff --git a/buildSrc/src/main/kotlin/DownloadPythonTask.kt b/buildSrc/src/main/kotlin/DownloadPythonTask.kt index 6ac8f58..c2667ad 100644 --- a/buildSrc/src/main/kotlin/DownloadPythonTask.kt +++ b/buildSrc/src/main/kotlin/DownloadPythonTask.kt @@ -30,6 +30,7 @@ abstract class DownloadPythonTask : DefaultTask() { enum class Platform { Windows, Linux, + MacOS, } @get:Input @@ -56,6 +57,7 @@ abstract class DownloadPythonTask : DefaultTask() { val hostOs = when (platform) { Platform.Windows -> "pc-windows-msvc" Platform.Linux -> "unknown-linux-gnu" + Platform.MacOS -> "apple-darwin" else -> throw IllegalArgumentException("Unsupported platform: $platform") } val tmpFile by tarFile diff --git a/kpy-library/build.gradle.kts b/kpy-library/build.gradle.kts index 3d9dccf..9218ecf 100644 --- a/kpy-library/build.gradle.kts +++ b/kpy-library/build.gradle.kts @@ -39,6 +39,7 @@ kotlin { platform = when (konanTarget) { KonanTarget.MINGW_X64 -> DownloadPythonTask.Platform.Windows KonanTarget.LINUX_X64 -> DownloadPythonTask.Platform.Linux + KonanTarget.MACOS_X64 -> DownloadPythonTask.Platform.MacOS else -> throw IllegalArgumentException("Unsupported target: $targetName") } }