X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=build.gradle;h=39c8261c8bd4b2ec269de7ed842c1d7a99f55504;hb=40b6567d5fbcdaf81ab9b3604cd5041343c3d0d7;hp=e4ffa8aca9fca1a3ecbc9d86898558ffaf2b6837;hpb=3f64ad92740da6fb32d918adbe52d9f97726d1a1;p=jalview.git diff --git a/build.gradle b/build.gradle index e4ffa8a..39c8261 100644 --- a/build.gradle +++ b/build.gradle @@ -992,22 +992,25 @@ def getDate(format) { 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 } } @@ -1082,7 +1085,7 @@ task convertBuildingMD(type: Exec) { task syncDocs(type: Sync) { - dependsOn convertBuildingMD + //dependsOn convertBuildingMD def syncDir = "${classesDir}/${doc_dir}" from fileTree("${jalviewDir}/${doc_dir}") into syncDir @@ -1309,6 +1312,7 @@ task cleanDist { shadowJar { group = "distribution" + description = "Create a single jar file with all dependency libraries merged. Can be run with java -jar" if (buildDist) { dependsOn makeDist } @@ -1783,7 +1787,11 @@ spotless { 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]