diff --git a/build-logic/packaging/src/main/kotlin/bisq/gradle/packaging/PackagingPlugin.kt b/build-logic/packaging/src/main/kotlin/bisq/gradle/packaging/PackagingPlugin.kt index 97fea2f35b..597fadf62a 100644 --- a/build-logic/packaging/src/main/kotlin/bisq/gradle/packaging/PackagingPlugin.kt +++ b/build-logic/packaging/src/main/kotlin/bisq/gradle/packaging/PackagingPlugin.kt @@ -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 { diff --git a/build-logic/packaging/src/main/kotlin/bisq/gradle/packaging/ReleaseBinariesTaskFactory.kt b/build-logic/packaging/src/main/kotlin/bisq/gradle/packaging/ReleaseBinariesTaskFactory.kt new file mode 100644 index 0000000000..0fe4cf220f --- /dev/null +++ b/build-logic/packaging/src/main/kotlin/bisq/gradle/packaging/ReleaseBinariesTaskFactory.kt @@ -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 = project.providers + .gradleProperty("bisq.release.binaries_path") + val releaseDir: Provider = project.layout.buildDirectory.dir("packaging/release") + + project.tasks.register("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", "") + } + } + } + } +} \ No newline at end of file