Skip to content

Commit

Permalink
add skiko-awt-runtime into gradle config for implement skiko for each OS
Browse files Browse the repository at this point in the history
  • Loading branch information
Merati22 committed Jul 14, 2024
1 parent c39800e commit f625e97
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,24 @@ kotlin {
val desktopMain by getting {
dependencies {
// api(libs.androidx.ui.desktop)
// implementation("org.jetbrains.skiko:skiko-awt-runtime-windows-x64:0.7.92")
val osName = System.getProperty("os.name")
val targetOs = when {
osName == "Mac OS X" -> "macos"
osName.startsWith("Win") -> "windows"
osName.startsWith("Linux") -> "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")
}

val version = "0.8.9" // or any more recent version
val target = "${targetOs}-${targetArch}"
implementation("org.jetbrains.skiko:skiko-awt-runtime-$target:$version")
}
}
val desktopTest by getting {
Expand Down

0 comments on commit f625e97

Please sign in to comment.