JAL-3322 New progress bar. Added option to report appbase in launcher window. Added...
[jalview.git] / build.gradle
index 9aedd2f..21ecde6 100644 (file)
@@ -484,13 +484,20 @@ task convertBuildingMD(type: Exec) {
   def buildingMD = "$jalviewDir/$docDir/building.md"
   def css = "$jalviewDir/$docDir/github.css"
 
-  def pandoc = pandoc_exec
+  def pandoc = null
+  pandoc_exec.split(",").each {
+    if (file(it.trim()).exists()) {
+      pandoc = it.trim()
+      return true
+    }
+  }
+
   def hostname = "hostname".execute().text.trim()
-  if (! file(pandoc).exists() && hostname.equals("jv-bamboo")) {
+  if ((pandoc == null || ! file(pandoc).exists()) && hostname.equals("jv-bamboo")) {
     pandoc = System.getProperty("user.home")+"/buildtools/pandoc/bin/pandoc"
   }
 
-  if (file(pandoc).exists()) {
+  if (pandoc != null && file(pandoc).exists()) {
     commandLine pandoc, '-s', '-o', buildingHTML, '--metadata', 'pagetitle="Building Jalview from Source"', '--toc', '-H', css, buildingMD
   } else {
     commandLine "true"
@@ -714,11 +721,20 @@ task getdownWebsite() {
   def getdownResourceDir = project.ext.getdownResourceDir
   def getdownAppDir = project.ext.getdownAppDir
   def getdownResourceFilenames = []
+  
+  copy {
+               from "$classes/$buildPropertiesFile"
+               rename(buildPropertiesFile, getdown_install_build_properties)
+               into project.ext.getdownWebsiteDir
+  }
+  getdownResourceFilenames += getdown_current_build_properties
+  
   doFirst {
     // 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)
+       props.put("getdown_txt_resource", "$classes/$buildPropertiesFile")
 
     if (getdown_local == "true") {
       getdown_app_base = file(getdownWebsiteDir).toURI().toString()
@@ -734,7 +750,7 @@ task getdownWebsite() {
           }
         } else {
           // file values rationalised
-          if (val.indexOf('/') > -1) {
+          if (val.indexOf('/') > -1 || prop.startsWith("getdown_txt_resource")) {
             def r = null
             if (val.indexOf('/') == 0) {
               // absolute path
@@ -749,8 +765,10 @@ task getdownWebsite() {
               getdownResourceFilenames += r.getPath()
             }
           }
-          def line = prop.substring(12) + " = " + val + "\n"
-          getdownTextString += line
+                 if (! prop.startsWith("getdown_txt_resource")) {
+                         def line = prop.substring(12) + " = " + val + "\n"
+                         getdownTextString += line
+                 }
         }
       }
     }
@@ -800,19 +818,31 @@ task getdownWebsite() {
 
     // getdown-launcher.jar should not be in main application class path so the main application can move it when updated.  Listed as a resource so it gets updated.
     //getdownTextString += "class = " + file(getdownLauncher).getName() + "\n"
-    getdownTextString += "resource = " + file(getdownLauncher).getName() + "\n"
+    getdownTextString += "resource = " + getdown_launcher_new + "\n"
     getdownTextString += "class = " + mainClass + "\n"
 
     def getdown_txt = file(project.ext.getdownWebsiteDir + "/getdown.txt")
     getdown_txt.write(getdownTextString)
+       
+       def launch_jvl = file(project.ext.getdownWebsiteDir + "/" + getdown_launch_jvl)
+       launch_jvl.write("appbase="+props.get("getdown_txt_appbase"))
 
     copy {
       from getdown_txt
+         from launch_jvl
+         from project.ext.getdownWebsiteDir+"/"+getdown_current_build_properties
+         from project.ext.getdownWebsiteDir+"/"+getdown_install_build_properties
       into project.ext.getdownFilesDir
     }
 
     copy {
       from getdownLauncher
+      into project.ext.getdownWebsiteDir
+      rename(file(getdownLauncher).getName(), getdown_launcher_new)
+    }
+
+    copy {
+      from getdownLauncher
       into project.ext.getdownFilesDir
     }