Merge branch 'merge/JAL-3609_and_JAL-3608' into releases/Release_2_11_1_Branch
[jalview.git] / build.gradle
index dba3fd3..2c7f138 100644 (file)
@@ -78,6 +78,26 @@ ext {
     }
   }
 
+  ////  
+  // Import releaseProps from the RELEASE file
+  // or a file specified via JALVIEW_RELEASE_FILE if defined
+  // Expect jalview.version and target release branch in jalview.release        
+  def releaseProps = new Properties();
+  def releasePropFile = findProperty("JALVIEW_RELEASE_FILE");
+  def defaultReleasePropFile = "${jalviewDirAbsolutePath}/RELEASE";
+  try {
+    (new File(releasePropFile!=null ? releasePropFile : defaultReleasePropFile)).withInputStream { 
+     releaseProps.load(it)
+    }
+  } catch (Exception fileLoadError) {
+    throw new Error("Couldn't load release properties file "+(releasePropFile==null ? defaultReleasePropFile : "from custom location: releasePropFile"),fileLoadError);
+  }
+  ////
+  // Set JALVIEW_VERSION if it is not already set
+  if (findProperty(JALVIEW_VERSION)==null || "".equals(JALVIEW_VERSION)) {
+    JALVIEW_VERSION = releaseProps.get("jalview.version")
+  }
+  
   // this property set when running Eclipse headlessly
   j2sHeadlessBuildProperty = string("net.sf.j2s.core.headlessbuild")
   // this property set by Eclipse
@@ -202,15 +222,26 @@ ext {
 
     case "DEVELOP":
     reportRsyncCommand = true
+    
+    // DEVELOP-RELEASE is usually associated with a Jalview release series so set the version
+    JALVIEW_VERSION=JALVIEW_VERSION+"-develop"
+    
+    install4jSuffix = "Develop"
+    install4jDSStore = "DS_Store-DEVELOP"
+    install4jDMGBackgroundImage = "jalview_dmg_background-DEVELOP.png"
     install4jExtraScheme = "jalviewd"
+    install4jInstallerName = "${jalview_name} Develop Installer"
     break
 
     case "TEST-RELEASE":
     reportRsyncCommand = true
-    JALVIEW_VERSION = "TEST"
+    
+    // TEST-RELEASE is usually associated with a Jalview release series so set the version
+    JALVIEW_VERSION=JALVIEW_VERSION+"-test"
+    
     install4jSuffix = "Test"
     install4jDSStore = "DS_Store-TEST-RELEASE"
-    install4jDMGBackgroundImage = "jalview_dmg_background.png"
+    install4jDMGBackgroundImage = "jalview_dmg_background-TEST.png"
     install4jExtraScheme = "jalviewt"
     install4jInstallerName = "${jalview_name} Test Installer"
     break
@@ -233,7 +264,7 @@ ext {
     JALVIEW_VERSION = "TEST"
     install4jSuffix = "Test-Local"
     install4jDSStore = "DS_Store-TEST-RELEASE"
-    install4jDMGBackgroundImage = "jalview_dmg_background.png"
+    install4jDMGBackgroundImage = "jalview_dmg_background-TEST.png"
     install4jExtraScheme = "jalviewt"
     install4jInstallerName = "${jalview_name} Test Installer"
     break
@@ -927,6 +958,16 @@ test {
 
   workingDir = jalviewDir
   //systemProperties 'clover.jar' System.properties.clover.jar
+  def testLaf = project.findProperty("test_laf")
+  if (testLaf != null) {
+    println("Setting Test LaF to '${testLaf}'")
+    systemProperty "laf", testLaf
+  }
+  def testHiDPIScale = project.findProperty("test_HiDPIScale")
+  if (testHiDPIScale != null) {
+    println("Setting Test HiDPI Scale to '${testHiDPIScale}'")
+    systemProperty "sun.java2d.uiScale", testHiDPIScale
+  }
   sourceCompatibility = compile_source_compatibility
   targetCompatibility = compile_target_compatibility
   jvmArgs += additional_compiler_args
@@ -1269,8 +1310,10 @@ task getdownWebsite() {
 
 // a helper task to allow getdown digest of any dir: `gradle getdownDigestDir -PDIGESTDIR=/path/to/my/random/getdown/dir
 task getdownDigestDir(type: JavaExec) {
+  group "Help"
+  description "A task to run a getdown Digest on a dir with getdown.txt. Provide a DIGESTDIR property via -PDIGESTDIR=..."
+
   def digestDirPropertyName = "DIGESTDIR"
-  description = "Digest a local dir (-P${digestDirPropertyName}=...) for getdown"
   doFirst {
     classpath = files(getdownLauncher)
     def digestDir = findProperty(digestDirPropertyName)
@@ -1390,7 +1433,8 @@ task copyInstall4jTemplate {
     // NB we're deleting the /other/ one!
     // Also remove the examples subdir from non-release versions
     def customizedIdToDelete = "PROGRAM_GROUP_RELEASE"
-    if (CHANNEL=="RELEASE") {
+    // 2.11.1.0 NOT releasing with the Examples folder in the Program Group
+    if (false && CHANNEL=="RELEASE") { // remove 'false && ' to include Examples folder in RELEASE channel
       customizedIdToDelete = "PROGRAM_GROUP_NON_RELEASE"
     } else {
       // remove the examples subdir from Full File Set