JAL-3349 Remove processed args from list to send to jalview
[jalview.git] / build.gradle
index 16c31b3..2effa06 100644 (file)
@@ -123,7 +123,7 @@ ext {
     reportRsyncCommand = true
     break
 
-    case ~/^SCRATCH(|-\w*)$/:
+    case ~/^SCRATCH(|-[-\w]*)$/:
     getdown_channel_name = CHANNEL
     getdownDir = getdown_channel_name + "/" + JAVA_VERSION
     getdown_app_base = getdown_channel_base + "/" + getdownDir
@@ -163,6 +163,7 @@ def JAVA_INTEGER_VERSION
 def additional_compiler_args = []
 // these are getdown.txt properties defined dependent on the JAVA_VERSION
 def getdown_alt_java_min_version
+def getdown_alt_java_max_version
 // this property is assigned below and expanded to multiple lines in the getdown task
 def getdown_alt_multi_java_location
 // this property is for the Java library used in eclipse
@@ -175,6 +176,7 @@ if (JAVA_VERSION.equals("1.8")) {
   compile_source_compatibility = 1.8
   compile_target_compatibility = 1.8
   getdown_alt_java_min_version = getdown_alt_java8_min_version
+  getdown_alt_java_max_version = getdown_alt_java8_max_version
   getdown_alt_multi_java_location = getdown_alt_java8_txt_multi_java_location
   eclipse_java_runtime_name = "JavaSE-1.8"
 } else if (JAVA_VERSION.equals("11")) {
@@ -184,6 +186,7 @@ if (JAVA_VERSION.equals("1.8")) {
   compile_source_compatibility = 11
   compile_target_compatibility = 11
   getdown_alt_java_min_version = getdown_alt_java11_min_version
+  getdown_alt_java_max_version = getdown_alt_java11_max_version
   getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location
   eclipse_java_runtime_name = "JavaSE-11"
   additional_compiler_args += [
@@ -197,6 +200,7 @@ if (JAVA_VERSION.equals("1.8")) {
   compile_source_compatibility = JAVA_VERSION
   compile_target_compatibility = JAVA_VERSION
   getdown_alt_java_min_version = getdown_alt_java11_min_version
+  getdown_alt_java_max_version = getdown_alt_java11_max_version
   getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location
   eclipse_java_runtime_name = "JavaSE-11"
   additional_compiler_args += [
@@ -590,10 +594,13 @@ task convertBuildingMD(type: Exec) {
     pandoc = System.getProperty("user.home")+"/buildtools/pandoc/bin/pandoc"
   }
 
-  if (pandoc != null && file(pandoc).exists()) {
-    commandLine pandoc, '-s', '-o', buildingHTML, '--metadata', 'pagetitle="Building Jalview from Source"', '--toc', '-H', css, buildingMD
-  } else {
-    commandLine "true"
+  doFirst {
+    if (pandoc != null && file(pandoc).exists()) {
+        commandLine pandoc, '-s', '-o', buildingHTML, '--metadata', 'pagetitle="Building Jalview from Source"', '--toc', '-H', css, buildingMD
+    } else {
+        println("Cannot find pandoc. Skipping convert building.md to HTML")
+        throw new StopExecutionException()
+    }
   }
 
   ignoreExitValue true
@@ -717,7 +724,7 @@ task compileLinkCheck(type: JavaCompile) {
   outputs.file("$jalviewDir/$utilsDir/BufferedLineReader.class")
 }
 
-def helplinkscheckeroutputfile = file("$jalviewDir/$utilsDir/HelpLinksChecker.out")
+def helplinkscheckertouchfile = file("$jalviewDir/$utilsDir/HelpLinksChecker.touch")
 task linkCheck(type: JavaExec) {
   dependsOn prepare, compileLinkCheck
   classpath = files("$jalviewDir/$utilsDir")
@@ -726,12 +733,12 @@ task linkCheck(type: JavaExec) {
   def help = "$classes/$helpDir"
   args = [ "$classes/$helpDir", "-nointernet" ]
 
-  doFirst {
-    helplinkscheckeroutputfile.createNewFile()
-    standardOutput new FileOutputStream(helplinkscheckeroutputfile, false)
+  doLast {
+    helplinkscheckertouchfile.createNewFile()
   }
 
-  outputs.file(helplinkscheckeroutputfile)
+  inputs.dir("$classes/$helpDir")
+  outputs.file(helplinkscheckertouchfile)
 }
 
 task cleanPackageDir(type: Delete) {
@@ -833,17 +840,22 @@ task getdownWebsite() {
     copy {
       from buildProperties
       rename(buildPropertiesFile, getdown_build_properties)
-      into project.ext.getdownWebsiteDir
+      into project.ext.getdownAppDir
     }
-    getdownWebsiteResourceFilenames += getdown_build_properties
+    getdownWebsiteResourceFilenames += getdown_app_dir+"/"+getdown_build_properties
 
     // go through properties looking for getdown_txt_...
     def props = project.properties.sort { it.key }
-    props.put("getdown_txt_java_min_version", getdown_alt_java_min_version)
-    props.put("getdown_txt_multi_java_location", getdown_alt_multi_java_location)
+       if (getdown_alt_java_min_version.length() > 0) {
+               props.put("getdown_txt_java_min_version", getdown_alt_java_min_version)
+       }
+       if (getdown_alt_java_max_version.length() > 0) {
+               props.put("getdown_txt_java_max_version", getdown_alt_java_max_version)
+       }
+       props.put("getdown_txt_multi_java_location", getdown_alt_multi_java_location)
 
     props.put("getdown_txt_appbase", getdown_app_base)
-    props.each{ prop, val ->
+    props.sort().each{ prop, val ->
       if (prop.startsWith("getdown_txt_") && val != null) {
         if (prop.startsWith("getdown_txt_multi_")) {
           def key = prop.substring(18)
@@ -996,7 +1008,7 @@ task getdown() {
       def fromDir = getdownWebsiteDir + (getdownWebsiteDir.endsWith("/")?"":"/")
       def toDir = getdown_rsync_dest + "/" + getdownDir + (getdownDir.endsWith("/")?"":"/")
       println "LIKELY RSYNC COMMAND:"
-      println "rsync -avh --delete '$fromDir' '$toDir'"
+      println "mkdir -p '$toDir'\nrsync -avh --delete '$fromDir' '$toDir'"
       if (RUNRSYNC == "true") {
         exec {
           commandLine "mkdir", "-p", toDir
@@ -1130,3 +1142,5 @@ clean {
   delete install4jConf
 }
 
+
+