task setGitVals {
- def hashStdOut = new ByteArrayOutputStream()
- exec {
- commandLine "git", "rev-parse", "--short", "HEAD"
- standardOutput = hashStdOut
- ignoreExitValue true
- }
- def branchStdOut = new ByteArrayOutputStream()
- exec {
- commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
- standardOutput = branchStdOut
- ignoreExitValue true
- }
+ doFirst {
+ def hashStdOut = new ByteArrayOutputStream()
+ def resultHash = exec {
+ commandLine "git", "rev-parse", "--short", "HEAD"
+ standardOutput = hashStdOut
+ ignoreExitValue true
+ }
+
+ def branchStdOut = new ByteArrayOutputStream()
+ def resultBranch = exec {
+ commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
+ standardOutput = branchStdOut
+ ignoreExitValue true
+ }
- gitHash = hashStdOut.toString().trim()
- gitBranch = branchStdOut.toString().trim()
+ gitHash = resultHash.getExitValue() == 0 ? hashStdOut.toString().trim() : "NO_GIT_COMMITID_FOUND"
+ gitBranch = resultBranch.getExitValue() == 0 ? branchStdOut.toString().trim() : "NO_GIT_BRANCH_FOUND"
+ }
outputs.upToDateWhen { false }
}
task syncDocs(type: Sync) {
- dependsOn convertBuildingMD
+ //dependsOn convertBuildingMD
def syncDir = "${classesDir}/${doc_dir}"
from fileTree("${jalviewDir}/${doc_dir}")
into syncDir
shadowJar {
group = "distribution"
+ description = "Create a single jar file with all dependency libraries merged. Can be run with java -jar"
if (buildDist) {
dependsOn makeDist
}
task sourceDist(type: Tar) {
+ group "distribution"
+ description "Create a source .tar.gz file for distribution"
+ dependsOn convertBuildingMD
+
def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz"
// cater for buildship < 3.1 [3.0.1 is max version in eclipse 2018-09]