Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packaging: Rename jpackage output to GitHub binary names #2319

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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", "")
}
}
}
}
}
Loading