JAL-3280 Test for remote release build_properties file version check
[jalview.git] / build.gradle
index 5ed88d1..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"].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
 }
@@ -1311,6 +1315,11 @@ test {
     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
@@ -1591,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)
@@ -1617,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)
         }
@@ -1870,7 +1883,7 @@ task installers(type: com.install4j.gradle.Install4jTask) {
     'BUNDLE_ID': install4jBundleId,
     'INTERNAL_ID': install4jInternalId,
     'WINDOWS_APPLICATION_ID': install4jWinApplicationId,
-    'MACOS_DS_STORE': install4jDMGDSStore,
+    'MACOS_DMG_DS_STORE': install4jDMGDSStore,
     'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage,
     'INSTALLER_NAME': install4jInstallerName,
     'INSTALL4J_UTILS_DIR': install4j_utils_dir,
@@ -2308,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