-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packaging: Rename jpackage output to GitHub binary names
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
build-logic/packaging/src/main/kotlin/bisq/gradle/packaging/ReleaseBinariesTaskFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", "") | ||
} | ||
} | ||
} | ||
} | ||
} |