JAL-3543 remove debugging output
[jalview.git] / build.gradle
index 27e040c..ca73859 100644 (file)
@@ -126,6 +126,7 @@ ext {
   getdownAppDistDir = getdown_app_dir_alt
   buildProperties = string("${classesDir}/${build_properties_file}")
   reportRsyncCmd = false
+  jvlChannelName = CHANNEL.toLowerCase()
   switch (CHANNEL) {
 
     case "BUILD":
@@ -133,6 +134,7 @@ ext {
     getdown_channel_base = bamboo_channelbase
     getdownChannelName = string("${bamboo_planKey}/${JAVA_VERSION}")
     getdownAppBase = string("${bamboo_channelbase}/${bamboo_planKey}${bamboo_getdown_channel_suffix}/${JAVA_VERSION}")
+    jvlChannelName += "_${getdownChannelName}"
     break
 
     case "RELEASE":
@@ -208,6 +210,8 @@ ext {
     getdownAppBase = string(getProperty("getdown_appbase_override"))
     println("Overriding getdown appbase with '${getdownAppBase}'")
   }
+  // sanitise file name for jalview launcher file for this channel
+  jvlChannelName = jvlChannelName.replaceAll(/[^\w\-]/,"_")
 
   getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}")
   //getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}"
@@ -565,25 +569,43 @@ task cloverInstr() {
 }
 
 
+task cloverReportHTML (type: JavaExec) {
+    inputs.dir "${buildDir}/clover"
+    outputs.dir "${reportsDir}/clover"
+
+    classpath configurations.cloverRuntime
+    maxHeapSize "${cloverReportJVMHeap}"
+    jvmArgs += "${cloverReportJVMArgs}"
+    main = "com.atlassian.clover.reporters.html.HtmlReporter"
+    args  "--initstring", "${buildDir}/clover/clover.db", "-o", "${reportsDir}/clover"
+    "${cloverReportHTMLOptions}".split(",").each {
+      args+= it.trim()
+      }
+}
+
+task cloverReportXML (type: JavaExec) {
+    inputs.dir "${buildDir}/clover"
+    outputs.dir "${reportsDir}/clover"
+    maxHeapSize "${cloverReportJVMHeap}"
+    jvmArgs "${cloverReportJVMArgs}"
+    classpath configurations.cloverRuntime
+    main = "com.atlassian.clover.reporters.xml.XMLReporter"
+    args  "--initstring", "${buildDir}/clover/clover.db", "-o", "${reportsDir}/clover/clover.xml"
+    
+    "${cloverReportXMLOptions}".split(",").each {
+      args+= it.trim()
+      }
+}
 task cloverReport {
   group = "Verification"
-    description = "Createst the Clover report"
+    description = "Creates the Clover report"
     inputs.dir "${buildDir}/clover"
     outputs.dir "${reportsDir}/clover"
     onlyIf {
       file("${buildDir}/clover/clover.db").exists()
     }
-  doFirst {
-    def argsList = ["--initstring", "${buildDir}/clover/clover.db",
-    "-o", "${reportsDir}/clover"]
-    String[] args = argsList.toArray()
-    com.atlassian.clover.reporters.html.HtmlReporter.runReport(args)
-
-    // and generate ${reportsDir}/clover/clover.xml
-    args = ["--initstring", "${buildDir}/clover/clover.db",
-    "-o", "${reportsDir}/clover/clover.xml"].toArray()
-    com.atlassian.clover.reporters.xml.XMLReporter.runReport(args)
-  }
+    dependsOn cloverReportXML
+    dependsOn cloverReportHTML
 }
 // end clover bits
 
@@ -1096,9 +1118,9 @@ task getdownWebsite() {
     def getdown_txt = file("${getdownWebsiteDir}/getdown.txt")
     getdown_txt.write(getdownTextString)
 
-    def getdownLaunchJvl = ( (getdownChannelName != null && getdownChannelName.length() > 0)?"${getdownChannelName}_":"" ) + getdown_launch_jvl
-    def launch_jvl = file("${getdownWebsiteDir}/${getdown_launch_jvl}")
-    launch_jvl.write("appbase="+props.get("getdown_txt_appbase"))
+    def getdownLaunchJvl = getdown_launch_jvl_name + ( (jvlChannelName != null && jvlChannelName.length() > 0)?"-${jvlChannelName}":"" ) + ".jvl"
+    def launchJvl = file("${getdownWebsiteDir}/${getdownLaunchJvl}")
+    launchJvl.write("appbase="+props.get("getdown_txt_appbase"))
 
     copy {
       from getdownLauncher
@@ -1133,7 +1155,7 @@ task getdownWebsite() {
 
     copy {
       from getdown_txt
-      from launch_jvl
+      from launchJvl
       from getdownLauncher
       from "${getdownWebsiteDir}/${getdown_build_properties}"
       if (file(getdownLauncher).getName() != getdown_launcher) {
@@ -1383,33 +1405,47 @@ task sourceDist(type: Tar) {
   
   into project.name
 
-  def EXCLUDE_FILES=["build/*","bin/*","test-output/","test-reports","tests","clover*/*"
-  ,".*"
-  ,"benchmarking/*"
-  ,"**/.*"
-  ,"*.class"
-  ,"**/*.class","${j11modDir}/**/*.jar","appletlib","**/*locales"
-  ,"*locales/**",
-  ,"utils/InstallAnywhere"] 
-  def PROCESS_FILES=[   "AUTHORS",
-  "CITATION",
-  "FEATURETODO",
-  "JAVA-11-README",
-  "FEATURETODO",
-  "LICENSE",
-  "**/README",
-  "RELEASE",
-  "THIRDPARTYLIBS","TESTNG",
-  "build.gradle",
-  "gradle.properties",
-  "**/*.java",
-  "**/*.html",
-  "**/*.xml",
-  "**/*.gradle",
-  "**/*.groovy",
-  "**/*.properties",
-  "**/*.perl",
-  "**/*.sh"]
+  def EXCLUDE_FILES=[
+    "build/*",
+    "bin/*",
+    "test-output/",
+    "test-reports",
+    "tests",
+    "clover*/*",
+    ".*",
+    "benchmarking/*",
+    "**/.*",
+    "*.class",
+    "**/*.class","$j11modDir/**/*.jar","appletlib","**/*locales",
+    "*locales/**",
+    "utils/InstallAnywhere",
+    "**/*.log",
+  ] 
+  def PROCESS_FILES=[
+    "AUTHORS",
+    "CITATION",
+    "FEATURETODO",
+    "JAVA-11-README",
+    "FEATURETODO",
+    "LICENSE",
+    "**/README",
+    "RELEASE",
+    "THIRDPARTYLIBS",
+    "TESTNG",
+    "build.gradle",
+    "gradle.properties",
+    "**/*.java",
+    "**/*.html",
+    "**/*.xml",
+    "**/*.gradle",
+    "**/*.groovy",
+    "**/*.properties",
+    "**/*.perl",
+    "**/*.sh",
+  ]
+  def INCLUDE_FILES=[
+    ".settings/org.eclipse.jdt.core.jalview.prefs",
+  ]
 
   from(jalviewDir) {
     exclude (EXCLUDE_FILES)
@@ -1435,14 +1471,17 @@ task sourceDist(type: Tar) {
     exclude (getdown_website_dir)
 
     // exluding these as not using jars as modules yet
-    exclude ("${j11modDir}/**/*.jar")
-  }
-  //  from (jalviewDir) {
-  //    // explicit includes for stuff that seemed to not get included
-  //    include(fileTree("test/**/*."))
-  //    exclude(EXCLUDE_FILES)
-  //    exclude(PROCESS_FILES)
-  //  }
+    exclude ("$j11modDir/**/*.jar")
+  }
+  from(jalviewDir) {
+    include(INCLUDE_FILES)
+  }
+//  from (jalviewDir) {
+//    // explicit includes for stuff that seemed to not get included
+//    include(fileTree("test/**/*."))
+//    exclude(EXCLUDE_FILES)
+//    exclude(PROCESS_FILES)
+//  }
 }