JAL-3830 Moved wrappers to bin/jalview.* and make a symlink bin/jalview. Install4j...
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 24 Mar 2021 01:49:24 +0000 (01:49 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 24 Mar 2021 01:49:24 +0000 (01:49 +0000)
build.gradle
gradle.properties
utils/getdown/bin/jalview.ps1 [moved from utils/getdown/jalviewc.ps1 with 90% similarity]
utils/getdown/bin/jalview.sh [moved from utils/getdown/jalviewc with 99% similarity]
utils/install4j/install4j8_template.install4j

index bea9951..e6c8fbd 100644 (file)
@@ -204,7 +204,7 @@ ext {
   install4jDMGDSStore = "${install4j_images_dir}/${install4j_dmg_ds_store}"
   install4jDMGBackgroundImage = "${install4j_images_dir}/${install4j_dmg_background}"
   install4jInstallerName = "${jalview_name} Non-Release Installer"
-  install4jExecutableName = jalview_name.replaceAll("[^\\w]+", "_").toLowerCase()
+  install4jExecutableName = install4j_executable_name
   install4jExtraScheme = "jalviewx"
   install4jMacIconsFile = string("${install4j_images_dir}/${install4j_mac_icons_file}")
   install4jWindowsIconsFile = string("${install4j_images_dir}/${install4j_windows_icons_file}")
@@ -1575,13 +1575,13 @@ task getdownWebsite() {
     
     def getdownWrapperScripts = [ getdown_bash_wrapper_script, getdown_powershell_wrapper_script ]
     getdownWrapperScripts.each{ script ->
-      def s = file( "${jalviewDir}/utils/getdown/${script}" )
+      def s = file( "${jalviewDir}/utils/getdown/${getdown_wrapper_script_dir}/${script}" )
       if (s.exists()) {
         copy {
           from s
-          into getdownWebsiteDir
+          into "${getdownWebsiteDir}/${getdown_wrapper_script_dir}"
         }
-        getdownTextString += "resource = ${script}\n"
+        getdownTextString += "resource = ${getdown_wrapper_script_dir}/${script}\n"
       }
     }
 
@@ -1912,8 +1912,10 @@ task installers(type: com.install4j.gradle.Install4jTask) {
     'WINDOWS_APPLICATION_ID': install4jWinApplicationId,
     'MACOS_DMG_DS_STORE': install4jDMGDSStore,
     'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage,
-    'MACOS_DMG_WRAPPER_LINK': getdown_bash_wrapper_script,
-    'MACOS_WRAPPER_SCRIPT': getdown_bash_wrapper_script,
+    'WRAPPER_LINK': getdown_wrapper_link,
+    'BASH_WRAPPER_SCRIPT': getdown_bash_wrapper_script,
+    'POWERSHELL_WRAPPER_SCRIPT': getdown_powershell_wrapper_script,
+    'WRAPPER_SCRIPT_BIN_DIR': getdown_wrapper_script_dir,
     'INSTALLER_NAME': install4jInstallerName,
     'INSTALL4J_UTILS_DIR': install4j_utils_dir,
     'GETDOWN_WEBSITE_DIR': getdown_website_dir,
@@ -1963,7 +1965,7 @@ task installers(type: com.install4j.gradle.Install4jTask) {
     println("Using projectFile "+projectFile)
     if (!disableNotarization) { println("Will notarize OSX App DMG") }
   }
-  verbose=true
+  //verbose=true
 
   inputs.dir(getdownWebsiteDir)
   inputs.file(install4jConfFile)
index ba87a6c..9e7d8da 100644 (file)
@@ -123,6 +123,7 @@ install4j_info_plist_file_associations = file_associations_auto-Info_plist.xml
 install4j_installer_file_associations = file_associations_auto-install4j8.xml
 #install4j_DMG_uninstaller_app_files = uninstall_old_jalview_files.xml
 install4j_build_dir = build/install4j
+install4j_executable_name = jalviewg
 install4j_media_types = windows,macosArchive,unixArchive,unixInstaller
 install4j_faster = false
 install4j_application_categories = Science;Biology;Java;
@@ -133,8 +134,10 @@ install4j_png_icon_file = jalview_logo.png
 install4j_background = jalview_logo_background_fade-640x480.png
 install4j_dmg_background = jalview_dmg_background-NON-RELEASE.png
 install4j_dmg_ds_store = jalview_dmg_DS_Store
-getdown_bash_wrapper_script = jalviewc
-getdown_powershell_wrapper_script = jalviewc.ps1
+getdown_wrapper_script_dir = bin
+getdown_wrapper_link = jalview
+getdown_bash_wrapper_script = jalview.sh
+getdown_powershell_wrapper_script = jalview.ps1
 
 OSX_KEYSTORE =
 OSX_KEYPASS =
similarity index 90%
rename from utils/getdown/jalviewc.ps1
rename to utils/getdown/bin/jalview.ps1
index 0a5802b..b84e275 100755 (executable)
@@ -18,7 +18,7 @@ if ( $IsWindows -eq $null ) {
 
 # parent dir of this script (should be the getdown app dir). Follow symlinks.
 $TARGET = ( Get-Item $MyInvocation.MyCommand.Path ).Target
-$DIR = If ( $TARGET -eq $null -or $TARGET.LinkType -ne "SymbolicLink" ) { Split-Path $MyInvocation.MyCommand.Path -Parent } Else { Split-Path $TARGET -Parent }
+$DIR = If ( $TARGET -eq $null -or $TARGET.LinkType -ne "SymbolicLink" ) { Split-Path -Path $MyInvocation.MyCommand.Path -Parent } Else { Split-Path -Path $TARGET -Parent }
 
 # set the "-open" parameter if myArg1 is non-zero-length, and not "open" or starts with a "-"
 $OPEN = ""
@@ -26,7 +26,7 @@ if ( $myArg1.length -gt 0 -and ( -not $myArg1.StartsWith("-") ) -and $myArg1 -cn
   $OPEN = "-open"
 }
 
-$APPDIR = $DIR
+$APPDIR = If ( ( Split-Path -Path $DIR -Leaf ) -eq "bin" ) { Split-Path -Path $DIR -Parent } Else { $DIR }
 $JAVAEXE = If ( $myIsWindows ) { "java.exe" } Else { "java" }
 $JAVA = Join-Path -Path $APPDIR -ChildPath ( "jre/" + $( If ( $myIsMacOS ) { "Contents/Home/" } Else { "" } ) + "bin/${JAVAEXE}" )
 $GETDOWNTXT = Join-Path -Path $APPDIR -ChildPath "getdown.txt"
similarity index 99%
rename from utils/getdown/jalviewc
rename to utils/getdown/bin/jalview.sh
index 08c5494..112c3e6 100755 (executable)
@@ -53,7 +53,7 @@ if [ "${ISMACOS}" = 1 ]; then
 else
 # NOT MACOS
   DIR="$(dirname "$(readlink -f "$0")")"
-  APPDIR="${DIR}"
+  APPDIR="${DIR%/bin}"
   JAVA="${APPDIR}/jre/bin/java"
 fi
 
index f81bab8..60366b3 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<install4j version="8.0.10" transformSequenceNumber="8">
-  <directoryPresets config="../.." />
+<install4j version="8.0.11" transformSequenceNumber="8">
+  <directoryPresets config="bin/jalview" />
   <application name="${compiler:JALVIEW_APPLICATION_NAME}" applicationId="${compiler:WINDOWS_APPLICATION_ID}" mediaDir="${compiler:BUILD_DIR}" lzmaCompression="true" shortName="${compiler:INTERNAL_ID}" publisher="University of Dundee" publisherWeb="https://www.jalview.org/" version="${compiler:JALVIEW_VERSION}" allPathsRelative="true" macVolumeId="5aac4968c304f65" javaMinVersion="${compiler:JAVA_MIN_VERSION}" javaMaxVersion="9999999999${compiler:JAVA_MAX_VERSION}" allowBetaVM="true" jdkMode="jdk" jdkName="JDK 11.0">
     <searchSequence>
       <directory location="${compiler:JRE_DIR}" />
       <variable name="INTERNAL_ID" value="Jalview" />
       <variable name="WINDOWS_APPLICATION_ID" value="6595-2347-1923-0725" />
       <variable name="MACOS_DMG_DS_STORE" value="jalview_dmg_DS_Store" />
-      <variable name="MACOS_DMG_BG_IMAGE" />
-      <variable name="MACOS_DMG_WRAPPER_LINK" />
-      <variable name="MACOS_WRAPPER_SCRIPT" />
+      <variable name="MACOS_DMG_BG_IMAGE" value="jalview_dmg_background-72dpi.png" />
+      <variable name="WRAPPER_LINK" value="jalview" />
+      <variable name="BASH_WRAPPER_SCRIPT" value="jalview.sh" />
+      <variable name="POWERSHELL_WRAPPER_SCRIPT" value="jalview.ps1" />
+      <variable name="WRAPPER_SCRIPT_BIN_DIR" value="bin" />
       <variable name="INSTALLER_NAME" value="Jalview Installer" />
       <variable name="INSTALL4J_UTILS_DIR" value="utils/install4j" />
       <variable name="GETDOWN_WEBSITE_DIR" value="getdown/website" />
@@ -55,6 +57,7 @@
       <variable name="WINDOWS_ICONS_FILE" value="utils/channels/release/images/jalview_logo.ico" />
       <variable name="PNG_ICON_FILE" value="utils/channels/release/images/jalview_logo.png" />
       <variable name="BACKGROUND" value="utils/channels/release/images/jalview_logo_background_fade-640x480.png" />
+      <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:BASH_WRAPPER_SCRIPT}" />
     </variables>
     <codeSigning macEnabled="true" macPkcs12File="${compiler:OSX_KEYSTORE}" macNotarize="true" appleId="${compiler:OSX_APPLEID}">
       <macAdditionalBinaries>
       <dirEntry mountPoint="454" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_FILES_DIR}/${compiler:JAVA_VERSION}" uninstallMode="2" overrideOverwriteMode="true" overrideUninstallMode="true" subDirectory="files" />
       <dirEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_WEBSITE_DIR}/${compiler:JAVA_VERSION}" uninstallMode="2" overrideOverwriteMode="true" overrideUninstallMode="true" subDirectory="files">
         <exclude>
-          <entry location="jalviewc" />
-          <entry location="jalviewc.ps1" />
+          <entry location="${compiler:WRAPPER_SCRIPT_BIN_DIR}" />
         </exclude>
       </dirEntry>
       <dirEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/examples" overwriteMode="1" uninstallMode="2" overrideFileMode="true" overrideOverwriteMode="true" overrideUninstallMode="true" entryMode="subdir" subDirectory="examples" />
-      <fileEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_WEBSITE_DIR}/${compiler:JAVA_VERSION}/jalviewc" fileMode="755" overrideFileMode="true" />
-      <fileEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_WEBSITE_DIR}/${compiler:JAVA_VERSION}/jalviewc.ps1" fileMode="755" overrideFileMode="true" />
+      <dirEntry mountPoint="736" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_WEBSITE_DIR}/${compiler:JAVA_VERSION}/${compiler:WRAPPER_SCRIPT_BIN_DIR}" fileMode="755" overrideFileMode="true" overrideUninstallMode="true" entryMode="subdir" subDirectory="${compiler:WRAPPER_SCRIPT_BIN_DIR}" overrideDirMode="true" />
       <dirEntry mountPoint="884" file="${compiler:MACOS_JAVA_VM_DIR}" fileMode="755" overrideFileMode="true" overrideUninstallMode="true" entryMode="subdir" subDirectory="${compiler:JRE_DIR}" />
       <dirEntry mountPoint="885" file="${compiler:WINDOWS_JAVA_VM_DIR}" fileMode="755" overrideFileMode="true" overrideUninstallMode="true" entryMode="subdir" subDirectory="${compiler:JRE_DIR}" />
       <dirEntry mountPoint="1875" file="${compiler:JALVIEW_DIR}/${compiler:GETDOWN_WEBSITE_DIR}/${compiler:JAVA_VERSION}/${compiler:GETDOWN_DIST_DIR}" overwriteMode="1" uninstallMode="2" overrideFileMode="true" overrideOverwriteMode="true" overrideUninstallMode="true" entryMode="subdir" subDirectory="${compiler:GETDOWN_DIST_DIR}" overrideDirMode="true" />
@@ -532,6 +533,20 @@ return console.askOkCancel(message, true);
           </screen>
           <screen id="20" beanClass="com.install4j.runtime.beans.screens.FinishedScreen" rollbackBarrierExitCode="0" finishScreen="true">
             <actions>
+              <action name="Linux/Unix symlink" id="2733" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" actionElevationType="elevated" rollbackBarrierExitCode="0" errorMessage="Could not make symlink to wrapper script">
+                <serializedBean>
+                  <property name="file">
+                    <object class="java.io.File">
+                      <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:LINK_TO_WRAPPER_SCRIPT}</string>
+                    </object>
+                  </property>
+                  <property name="linkFile">
+                    <object class="java.io.File">
+                      <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:WRAPPER_LINK}</string>
+                    </object>
+                  </property>
+                </serializedBean>
+              </action>
               <action id="2012" beanClass="com.install4j.runtime.beans.actions.desktop.CreateStartMenuEntryAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
                 <serializedBean>
                   <property name="allUsers" type="boolean" value="false" />
@@ -713,7 +728,7 @@ return console.askYesNo(message, true);
               </action>
               <action id="1525" beanClass="com.install4j.runtime.beans.actions.files.DeleteFileAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
                 <serializedBean>
-                  <property name="files" type="array" class="java.io.File" length="40">
+                  <property name="files" type="array" class="java.io.File" length="38">
                     <element index="0">
                       <object class="java.io.File">
                         <string>jre</string>
@@ -896,22 +911,12 @@ return console.askYesNo(message, true);
                     </element>
                     <element index="36">
                       <object class="java.io.File">
-                        <string>jalviewc</string>
+                        <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}</string>
                       </object>
                     </element>
                     <element index="37">
                       <object class="java.io.File">
-                        <string>jalviewc.ps1</string>
-                      </object>
-                    </element>
-                    <element index="38">
-                      <object class="java.io.File">
-                        <string>jalviewcv</string>
-                      </object>
-                    </element>
-                    <element index="39">
-                      <object class="java.io.File">
-                        <string>jalviewc.ps1v</string>
+                        <string>bin</string>
                       </object>
                     </element>
                   </property>
@@ -1187,6 +1192,9 @@ return console.askYesNo(message, true);
         <entry filesetId="1873" />
         <entry filesetId="2105" />
       </exclude>
+      <variables>
+        <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:POWERSHELL_WRAPPER_SCRIPT}" />
+      </variables>
       <jreBundle jreBundleSource="preCreated" includedJre="${compiler:WINDOWS_JAVA_VM_TGZ}" manualJreEntry="true" />
     </windows>
     <macosArchive name="macOS Disk Image" id="878" customizedId="MACOS_DISK_IMAGE" mediaFileName="${compiler:APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" volumeName="${compiler:INSTALLER_NAME}" launcherId="737">
@@ -1200,13 +1208,16 @@ return console.askYesNo(message, true);
         <entry filesetId="882" />
         <entry filesetId="1873" />
       </exclude>
+      <variables>
+        <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:BASH_WRAPPER_SCRIPT}" />
+      </variables>
       <topLevelFiles>
         <symlink name="&quot; &quot;" target="/Applications" />
         <file name=".background/jalview_dmg_background.png" file="${compiler:JALVIEW_DIR}/${compiler:MACOS_DMG_BG_IMAGE}" />
         <file name=".DS_Store" file="${compiler:JALVIEW_DIR}/${compiler:MACOS_DMG_DS_STORE}" />
         <file name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/Jalview-File.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-File.icns" />
         <file name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/Jalview-Launch.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-Launch.icns" />
-        <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/MacOS/${compiler:MACOS_DMG_WRAPPER_LINK}" target="../Resources/app/${compiler:MACOS_WRAPPER_SCRIPT}" />
+        <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/MacOS/${compiler:WRAPPER_LINK}" target="../Resources/app/${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT}" />
       </topLevelFiles>
     </macosArchive>
     <unixInstaller name="Linux x64 Shell Installer" id="1595" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-linux_x64-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}" customInstallBaseDir="~/opt/">
@@ -1223,6 +1234,9 @@ return console.askYesNo(message, true);
         <entry filesetId="1873" />
         <entry filesetId="2105" />
       </exclude>
+      <variables>
+        <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:BASH_WRAPPER_SCRIPT}" />
+      </variables>
       <jreBundle jreBundleSource="preCreated" includedJre="${compiler:LINUX_JAVA_VM_TGZ}" manualJreEntry="true" />
     </unixInstaller>
     <unixArchive name="Unix .tar.gz Archive" id="1596" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}">
@@ -1239,6 +1253,9 @@ return console.askYesNo(message, true);
         <entry filesetId="1873" />
         <entry filesetId="2105" />
       </exclude>
+      <variables>
+        <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:BASH_WRAPPER_SCRIPT}" />
+      </variables>
       <jreBundle includedJre="${compiler:LINUX_JAVA_VM_TGZ}" manualJreEntry="true" />
     </unixArchive>
     <unixInstaller name="Unix Shell Installer" id="2639" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}" customInstallBaseDir="~/opt/">
@@ -1255,6 +1272,9 @@ return console.askYesNo(message, true);
         <entry filesetId="1873" />
         <entry filesetId="2105" />
       </exclude>
+      <variables>
+        <variable name="LINK_TO_WRAPPER_SCRIPT" value="${compiler:BASH_WRAPPER_SCRIPT}" />
+      </variables>
       <jreBundle includedJre="${compiler:LINUX_JAVA_VM_TGZ}" manualJreEntry="true" />
     </unixInstaller>
   </mediaSets>