X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=build.gradle;h=39c8261c8bd4b2ec269de7ed842c1d7a99f55504;hb=40b6567d5fbcdaf81ab9b3604cd5041343c3d0d7;hp=97d7ecfb1c82c6f18b4872e0dd752c295083537a;hpb=fc59e4fa8e496692052905f4427fe03cc118dbf2;p=jalview.git diff --git a/build.gradle b/build.gradle index 97d7ecf..39c8261 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -/* Convention for properties. Read from this file, use lower_case_underlines for property names. +/* Convention for properties. Read from gradle.properties, use lower_case_underlines for property names. * For properties set within build.gradle, use camelCaseNoSpace. */ import org.apache.tools.ant.filters.ReplaceTokens @@ -148,7 +148,7 @@ ext { cloverBuildDir = "${buildDir}/clover" cloverInstrDir = file("${cloverBuildDir}/clover-instr") cloverClassesDir = file("${cloverBuildDir}/clover-classes") - cloverReportDir = file("${buildDir}/reports") + cloverReportDir = file("${buildDir}/reports/clover") cloverTestInstrDir = file("${cloverBuildDir}/clover-test-instr") cloverTestClassesDir = file("${cloverBuildDir}/clover-test-classes") //cloverTestClassesDir = cloverClassesDir @@ -733,6 +733,7 @@ eclipseGroovyCorePreferences.mustRunAfter eclipseJdt task cleanClover { doFirst { delete cloverBuildDir + delete cloverReportDir } } @@ -855,7 +856,7 @@ task cloverHtmlReport(type: JavaExec) { file(cloverDb).exists() } - def cloverHtmlDir = "${cloverReportDir}/clover" + def cloverHtmlDir = cloverReportDir inputs.dir cloverClassesDir outputs.dir cloverHtmlDir @@ -991,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 + } - gitHash = hashStdOut.toString().trim() - gitBranch = branchStdOut.toString().trim() + def branchStdOut = new ByteArrayOutputStream() + def resultBranch = exec { + commandLine "git", "rev-parse", "--abbrev-ref", "HEAD" + standardOutput = branchStdOut + ignoreExitValue true + } + + 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 } } @@ -1081,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 @@ -1308,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 } @@ -1782,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] @@ -2858,7 +2867,7 @@ task jalviewjsIDE_PrepareSite { description "Sync libs and resources to site dir, but not closure cores" dependsOn jalviewjsIDE_SyncSiteAll - dependsOn cleanJalviewjsTransferSite + //dependsOn cleanJalviewjsTransferSite // not sure why this clean is here -- will slow down a re-run of this task }