From a56bb07eb44d62751d84bc52a5f9faec8dbd4e1d Mon Sep 17 00:00:00 2001 From: Octavia Togami Date: Sun, 28 Jul 2024 23:10:14 -0700 Subject: [PATCH] Include classifier in published distributions --- gui/build.gradle.kts | 46 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/gui/build.gradle.kts b/gui/build.gradle.kts index 07cb1b2..4a3eb20 100644 --- a/gui/build.gradle.kts +++ b/gui/build.gradle.kts @@ -27,6 +27,27 @@ repositories { } } +val classifierValue = when (osdetector.os) { + "osx" -> when (osdetector.arch) { + "x86_64" -> "mac" + "aarch_64" -> "mac-aarch64" + else -> error("Unsupported architecture: ${osdetector.arch}") + } + + "windows" -> when (osdetector.arch) { + "x86_64" -> "win" + else -> error("Unsupported architecture: ${osdetector.arch}") + } + + "linux" -> when (osdetector.arch) { + "x86_64" -> "linux" + "aarch_64" -> "linux-aarch64" + else -> error("Unsupported architecture: ${osdetector.arch}") + } + + else -> error("Unsupported OS: ${osdetector.os}") +} + dependencies { compileOnly(libs.jspecify.annotations) @@ -39,28 +60,7 @@ dependencies { for (lib in listOf(libs.javafx.base, libs.javafx.controls, libs.javafx.graphics)) { implementation(lib) implementation(variantOf(lib) { - classifier( - when (osdetector.os) { - "osx" -> when (osdetector.arch) { - "x86_64" -> "mac" - "aarch_64" -> "mac-aarch64" - else -> error("Unsupported architecture: ${osdetector.arch}") - } - - "windows" -> when (osdetector.arch) { - "x86_64" -> "win" - else -> error("Unsupported architecture: ${osdetector.arch}") - } - - "linux" -> when (osdetector.arch) { - "x86_64" -> "linux" - "aarch_64" -> "linux-aarch64" - else -> error("Unsupported architecture: ${osdetector.arch}") - } - - else -> error("Unsupported OS: ${osdetector.os}") - } - ) + classifier(classifierValue) }) } @@ -127,5 +127,5 @@ tasks.register("uploadDistributions") { dependsOn(tasks.jpackage) inputDir = tasks.jpackage.map { it.jpackageData.installerOutputDir } bucketName = providers.environmentVariable("B2_BUCKET_NAME") - prefix = providers.environmentVariable("B2_PREFIX").map { "$it/$appVersionValue" } + prefix = providers.environmentVariable("B2_PREFIX").map { "$it/$appVersionValue/$classifierValue" } }