diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 3a7b7e8..7e8d3fb 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -90,23 +90,22 @@ kotlin { val desktopMain by getting { dependencies { // api(libs.androidx.ui.desktop) + // See https://github.com/JetBrains/compose-multiplatform/blob/master/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/internal/utils/osUtils.kt val osName = System.getProperty("os.name") + val osArch = System.getProperty("os.arch") val targetOs = when { - osName == "Mac OS X" -> "macos" - osName.startsWith("Win") -> "windows" - osName.startsWith("Linux") -> "linux" + osName.equals("Mac OS X", ignoreCase = true) -> "macos" + osName.startsWith("Win", ignoreCase = true) -> "windows" + osName.startsWith("Linux", ignoreCase = true) -> "linux" else -> error("Unsupported OS: $osName") } - - val osArch = System.getProperty("os.arch") val targetArch = when (osArch) { "x86_64", "amd64" -> "x64" "aarch64" -> "arm64" - else -> error("Unsupported arch: $osArch") + else -> error("Unsupported architecture: $osArch") } - - val version = "0.8.9" // or any more recent version val target = "${targetOs}-${targetArch}" + val version = libs.versions.skiko.get() implementation("org.jetbrains.skiko:skiko-awt-runtime-$target:$version") } }