JAL-3577 First attempt at new folder names
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 2 Apr 2020 23:41:49 +0000 (00:41 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 2 Apr 2020 23:41:49 +0000 (00:41 +0100)
build.gradle
utils/install4j/install4j8_template.install4j

index 58d2764..b651ab1 100644 (file)
@@ -136,8 +136,9 @@ ext {
   getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher}")
   getdownAppDistDir = getdown_app_dir_alt
   buildProperties = string("${classesDir}/${build_properties_file}")
-  reportRsyncCmd = false
+  reportRsyncCommand = false
   jvlChannelName = CHANNEL.toLowerCase()
+  install4jSuffix = CHANNEL.substring(0, 1).toUpperCase() + CHANNEL.substring(1).toLowerCase(); // BUILD -> Build
   switch (CHANNEL) {
 
     case "BUILD":
@@ -155,6 +156,7 @@ ext {
     case "RELEASE":
     getdownAppDistDir = getdown_app_dir_release
     reportRsyncCommand = true
+    install4jSuffix = ""
     break
 
     case "ARCHIVE":
@@ -184,6 +186,7 @@ ext {
     }
     reportRsyncCommand = true
     getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
+    install4jSuffix = "Archive"
     break
 
     case "DEVELOP":
@@ -192,6 +195,8 @@ ext {
 
     case "TEST-RELEASE":
     reportRsyncCommand = true
+    install4jSuffix = "Test"
+    JALVIEW_VERSION = "TEST"
     break
 
     case ~/^SCRATCH(|-[-\w]*)$/:
@@ -199,6 +204,7 @@ ext {
     getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
     getdownAppBase = string("${getdown_channel_base}/${getdownDir}")
     reportRsyncCommand = true
+    install4jSuffix = "Scratch"
     break
 
     case "TEST-LOCAL":
@@ -208,6 +214,8 @@ ext {
       getdownAppBase = file(file("${LOCALDIR}").getAbsolutePath()).toURI().toString()
       getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
     }
+    install4jSuffix = "Test-Local"
+    JALVIEW_VERSION = "TEST"
     break
 
     case "LOCAL":
@@ -226,7 +234,19 @@ ext {
     println("Overriding getdown appbase with '${getdownAppBase}'")
   }
   // sanitise file name for jalview launcher file for this channel
-  jvlChannelName = jvlChannelName.replaceAll(/[^\w\-]/,"_")
+  jvlChannelName = jvlChannelName.replaceAll("[^\\w\\-]", "_")
+  // install4j application and folder names
+  if (install4jSuffix == "") {
+    install4jApplicationName = "${getdown_txt_title}"
+    install4jApplicationFolder = "${getdown_txt_title}"
+    install4jUnixApplicationFolder = install4jApplicationFolder.toLowerCase()
+  } else {
+    install4jApplicationName = "${getdown_txt_title} ${install4jSuffix}"
+    install4jApplicationFolder = "${getdown_txt_title} ${install4jSuffix}"
+    // sanitise folder names
+    install4jApplicationFolder = install4jApplicationFolder.replaceAll("[\"'~\\.]", "_")
+    install4jUnixApplicationFolder = install4jApplicationFolder.toLowerCase().replaceAll(" ","-")
+  }
 
   getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}")
   //getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}"
@@ -1359,7 +1379,7 @@ task installers(type: com.install4j.gradle.Install4jTask) {
   def install4jBuildDir = "${install4j_build_dir}/${JAVA_VERSION}"
 
   variables = [
-    'JALVIEW_NAME': getdown_txt_title,
+    'JALVIEW_NAME': install4jApplicationName,
     'JALVIEW_DIR': "../..",
     'OSX_KEYSTORE': OSX_KEYSTORE,
     'JSIGN_SH': JSIGN_SH,
@@ -1390,6 +1410,8 @@ task installers(type: com.install4j.gradle.Install4jTask) {
     'INFO_PLIST_FILE_ASSOCIATIONS_FILE': install4j_info_plist_file_associations,
     'BUILD_DIR': install4jBuildDir,
     'UNIX_DESKTOP_ADDITIONS': install4j_unix_desktop_additions,
+    'APPLICATION_FOLDER': install4jApplicationFolder,
+    'UNIX_APPLICATION_FOLDER': install4jUnixApplicationFolder,
   ]
 
   destination = "${jalviewDir}/${install4jBuildDir}"
index 961c5c0..7c36c5a 100644 (file)
@@ -39,6 +39,8 @@
       <variable name="GETDOWN_INSTALL_DIR" value="install" />
       <variable name="INFO_PLIST_FILE_ASSOCIATIONS_FILE" value="file_associations_auto-Info_plist.xml" />
       <variable name="UNIX_DESKTOP_ADDITIONS" value="Categories=Science;Biology;Java;" />
+      <variable name="APPLICATION_FOLDER" value="jalview" />
+      <variable name="UNIX_APPLICATION_FOLDER" value="jalview" />
     </variables>
     <codeSigning macEnabled="true" macPkcs12File="${compiler:OSX_KEYSTORE}" />
   </application>
@@ -512,7 +514,7 @@ return console.askOkCancel(message, true);
                 <serializedBean>
                   <property name="executable">
                     <object class="java.io.File">
-                      <string>Jalview.app</string>
+                      <string>${compiler:APPLICATION_FOLDER}.app</string>
                     </object>
                   </property>
                 </serializedBean>
@@ -1062,7 +1064,7 @@ return console.askYesNo(message, true);
     </styles>
   </installerGui>
   <mediaSets>
-    <windows name="Windows x64 EXE Installer" id="743" mediaFileName="${compiler:sys.shortName}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" runPostProcessor="true" postProcessor="${compiler:JSIGN_SH} $EXECUTABLE" customInstallBaseDir="~/AppData/Local">
+    <windows name="Windows x64 EXE Installer" id="743" mediaFileName="${compiler:sys.shortName}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:APPLICATION_FOLDER}" runPostProcessor="true" postProcessor="${compiler:JSIGN_SH} $EXECUTABLE" customInstallBaseDir="~/AppData/Local">
       <excludedComponents>
         <component id="1155" />
         <component id="1156" />
@@ -1079,7 +1081,7 @@ return console.askYesNo(message, true);
       </exclude>
       <jreBundle jreBundleSource="preCreated" includedJre="${compiler:WINDOWS_JAVA_VM_TGZ}" manualJreEntry="true" />
     </windows>
-    <windows name="Windows x64 MSI Installer" id="2446" mediaFileName="${compiler:sys.shortName}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" runPostProcessor="true" postProcessor="${compiler:JSIGN_SH} $EXECUTABLE" customInstallBaseDir="~/AppData/Local" msi="true" msiScope="perUser">
+    <windows name="Windows x64 MSI Installer" id="2446" mediaFileName="${compiler:sys.shortName}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:APPLICATION_FOLDER}" runPostProcessor="true" postProcessor="${compiler:JSIGN_SH} $EXECUTABLE" customInstallBaseDir="~/AppData/Local" msi="true" msiScope="perUser">
       <excludedComponents>
         <component id="1155" />
         <component id="1156" />
@@ -1111,12 +1113,12 @@ return console.askYesNo(message, true);
         <symlink name="&quot; &quot;" target="/Applications" />
         <file name=".background/jalview_dmg_background.png" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/jalview_dmg_background.png" />
         <file name=".DS_Store" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/DS_Store" />
-        <file name="Jalview.app/Contents/Resources/Jalview-File.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-File.icns" />
-        <file name="Jalview.app/Contents/Resources/Jalview-Launch.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-Launch.icns" />
-        <symlink name="Uninstall Old Jalview (optional).app" target="Jalview.app/Contents/Resources/app/Uninstall Old Jalview.app" />
+        <file name="${compiler:APPLICATION_FOLDER}.app/Contents/Resources/Jalview-File.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-File.icns" />
+        <file name="${compiler:APPLICATION_FOLDER}.app/Contents/Resources/Jalview-Launch.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-Launch.icns" />
+        <symlink name="Uninstall Old Jalview (optional).app" target="${compiler:APPLICATION_FOLDER}.app/Contents/Resources/app/Uninstall Old Jalview.app" />
       </topLevelFiles>
     </macosArchive>
-    <unixInstaller name="Linux x64 Shell Installer" id="1595" mediaFileName="${compiler:sys.shortName}-${compiler:JALVIEW_VERSION}-linux_x64-java_${compiler:JAVA_INTEGER_VERSION}" customInstallBaseDir="~/opt/">
+    <unixInstaller name="Linux x64 Shell Installer" id="1595" mediaFileName="${compiler:sys.shortName}-${compiler:JALVIEW_VERSION}-linux_x64-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}" customInstallBaseDir="~/opt/">
       <excludedComponents>
         <component id="1155" />
         <component id="1156" />
@@ -1133,7 +1135,7 @@ return console.askYesNo(message, true);
       </exclude>
       <jreBundle jreBundleSource="preCreated" includedJre="${compiler:LINUX_JAVA_VM_TGZ}" manualJreEntry="true" />
     </unixInstaller>
-    <unixArchive name="Unix .tar.gz Archive" id="1596" mediaFileName="${compiler:sys.shortName}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}">
+    <unixArchive name="Unix .tar.gz Archive" id="1596" mediaFileName="${compiler:sys.shortName}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}">
       <excludedComponents>
         <component id="1155" />
         <component id="1156" />
@@ -1150,7 +1152,7 @@ return console.askYesNo(message, true);
       </exclude>
       <jreBundle includedJre="${compiler:LINUX_JAVA_VM_TGZ}" manualJreEntry="true" />
     </unixArchive>
-    <unixInstaller name="Unix Shell Installer" id="2639" mediaFileName="${compiler:sys.shortName}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" customInstallBaseDir="~/opt/">
+    <unixInstaller name="Unix Shell Installer" id="2639" mediaFileName="${compiler:sys.shortName}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}" customInstallBaseDir="~/opt/">
       <excludedComponents>
         <component id="1155" />
         <component id="1156" />