Skip to content

Commit

Permalink
packaging: Rename jpackage output to GitHub binary names
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed Jun 24, 2024
1 parent 959634f commit 7ccb203
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class PackagingPlugin @Inject constructor(private val javaToolchainService: Java

outputDirectory.set(project.layout.buildDirectory.dir("packaging/jpackage/packages"))
}

ReleaseBinariesTaskFactory.registerCopyReleaseBinariesTask(project)
}

private fun getHashFileForOs(project: Project): Provider<RegularFile> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package bisq.gradle.packaging

import org.gradle.api.Project
import org.gradle.api.file.Directory
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Copy
import org.gradle.kotlin.dsl.register

class ReleaseBinariesTaskFactory {
companion object {
fun registerCopyReleaseBinariesTask(project: Project) {
val inputBinariesProperty: Provider<String> = project.providers
.gradleProperty("bisq.release.binaries_path")
val releaseDir: Provider<Directory> = project.layout.buildDirectory.dir("packaging/release")

project.tasks.register<Copy>("copyReleaseBinaries") {
from(inputBinariesProperty)
into(releaseDir)
rename { fileName: String ->
fileName.replace("Bisq 2", "Bisq") // "Bisq 2-2.0.4.exe", "Bisq 2-2.0.4.dmg"
.replace("bisq2_", "Bisq-") // "bisq2_2.0.4-1_amd64.deb"
.replace("bisq2-", "Bisq-") // "bisq2-2.0.4-1.x86_64.rpm"
.replace("-1_amd64", "")
.replace("-1.x86_64", "")
}
}
}
}
}

0 comments on commit 7ccb203

Please sign in to comment.