Merge pull request #5515 from cd2357/open-binaries-dir-on-finish

Package: Open binaries shared folder on finish
This commit is contained in:
Christoph Atteneder 2021-05-21 15:39:40 +02:00 committed by GitHub
commit bb5c494959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -462,6 +462,16 @@ task packageInstallers {
rename { String fileName -> fileName.replace('-all.jar', "-all-" + os + ".jar") }
}
// Checksum each file present in the binaries folder
ant.checksum(algorithm: 'SHA-256') {
ant.fileset(dir: "${binariesFolderPath}")
}
println "The binaries and checksums are ready:"
FileCollection collection = layout.files { binariesFolderPath.listFiles() }
collection.collect { it.path }.sort().each { println it }
// After binaries are ready, copy them to shared folder
// Env variable can be set by calling "export BISQ_SHARED_FOLDER='Some value'"
// This is to copy the final binary/ies to a shared folder for further processing if a VM is used.
String envVariableSharedFolder = "$System.env.BISQ_SHARED_FOLDER"
@ -474,17 +484,16 @@ task packageInstallers {
from binariesFolderPath
into envVariableSharedFolder
}
executeCmd("open " + envVariableSharedFolder)
}
// Checksum each file present in the binaries folder
ant.checksum(algorithm: 'SHA-256') {
ant.fileset(dir: "${binariesFolderPath}")
// Try to open a native file explorer window at the shared folder location
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
executeCmd("start '${envVariableSharedFolder}'")
} else if (Os.isFamily(Os.FAMILY_MAC)) {
executeCmd("open '${envVariableSharedFolder}'")
} else {
executeCmd("nautilus '${envVariableSharedFolder}'")
}
}
println "The binaries and checksums are ready:"
FileCollection collection = layout.files { binariesFolderPath.listFiles() }
collection.collect { it.path }.sort().each { println it }
}
}