Skip to content

Commit

Permalink
Include classifier in published distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
octylFractal committed Jul 29, 2024
1 parent 5ae7d02 commit a56bb07
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions gui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
})
}

Expand Down Expand Up @@ -127,5 +127,5 @@ tasks.register<B2Upload>("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" }
}

0 comments on commit a56bb07

Please sign in to comment.