JAL-3280 fixes after CR-JAL-241. Now only checking release build_properties.
[jalview.git] / build.gradle
index db1b533..c796b3b 100644 (file)
@@ -98,7 +98,7 @@ ext {
 
   getdownChannelName = CHANNEL.toLowerCase()
   // default to "default". Currently only has different cosmetics for "develop", "release", "default"
-  propertiesChannelName = ["develop", "release", "test-release"].contains(getdownChannelName) ? getdownChannelName : "default"
+  propertiesChannelName = ["develop", "release", "test-release", "jalviewjs", "jalviewjs-release" ].contains(getdownChannelName) ? getdownChannelName : "default"
   // Import channel_properties
   channelDir = string("${jalviewDir}/${channel_properties_dir}/${propertiesChannelName}")
   channelGradleProperties = string("${channelDir}/channel_gradle.properties")
@@ -221,7 +221,7 @@ ext {
     install4jExtraScheme = "jalviewb"
     break
 
-    case "RELEASE":
+    case [ "RELEASE", "JALVIEWJS-RELEASE" ]:
     getdownAppDistDir = getdown_app_dir_release
     reportRsyncCommand = true
     install4jSuffix = ""
@@ -307,7 +307,7 @@ ext {
     install4jInstallerName = "${jalview_name} Test Installer"
     break
 
-    case "LOCAL":
+    case [ "LOCAL", "JALVIEWJS" ]:
     JALVIEW_VERSION = "TEST"
     getdownAppBase = file(getdownWebsiteDir).toURI().toString()
     getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
@@ -1270,12 +1270,16 @@ task buildIndices(type: JavaExec) {
   outputs.file("${workingDir}/JavaHelpSearch/TMAP")
 }
 
-task prepare {
+task buildResources {
   dependsOn copyResources
+  dependsOn copyChannelResources
+  dependsOn createBuildProperties
+}
+
+task prepare {
+  dependsOn buildResources
   dependsOn copyDocs
   dependsOn copyHelp
-  dependsOn createBuildProperties
-  dependsOn copyChannelResources
   dependsOn convertMdFiles
   dependsOn buildIndices
 }
@@ -1596,6 +1600,10 @@ task getdownWebsite() {
     //getdownTextString += "class = " + file(getdownLauncher).getName() + "\n"
     getdownTextString += "resource = ${getdown_launcher_new}\n"
     getdownTextString += "class = ${main_class}\n"
+    /* NOT setting these properties so that getdownappbase and getdowndistdir will default to release version
+     * getdownTextString += "jvmarg = -Dgetdowndistdir=${getdownAppDistDir}\n"
+     * getdownTextString += "jvmarg = -Dgetdownappbase=${getdownAppBase}\n"
+     */
 
     def getdown_txt = file("${getdownWebsiteDir}/getdown.txt")
     getdown_txt.write(getdownTextString)
@@ -1622,7 +1630,7 @@ task getdownWebsite() {
       copy {
         from getdown_txt
         from getdownLauncher
-        from "${getdownWebsiteDir}/${getdown_build_properties}"
+        from "${getdownAppDir}/${getdown_build_properties}"
         if (file(getdownLauncher).getName() != getdown_launcher) {
           rename(file(getdownLauncher).getName(), getdown_launcher)
         }
@@ -2313,7 +2321,9 @@ task jalviewjsSyncAllLibs (type: Sync) {
 
 
 task jalviewjsSyncResources (type: Sync) {
-  def inputFiles = fileTree(dir: resourceDir)
+  dependsOn buildResources
+
+  def inputFiles = fileTree(dir: resourcesBuildDir)
   def outputDir = "${jalviewDir}/${jalviewjsSiteDir}/${jalviewjs_j2s_subdir}"
 
   from inputFiles