JAL-3631 Ensure the DMG default vmoptions.txt has the commented properties
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 29 Jul 2024 18:06:45 +0000 (19:06 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 29 Jul 2024 18:06:45 +0000 (19:06 +0100)
build.gradle
gradle.properties
utils/install4j/default.vmoptions [new file with mode: 0644]
utils/install4j/install4j10_template.install4j

index 3625ffc..1375997 100644 (file)
@@ -2924,9 +2924,52 @@ task install4jCustomiseDS_Store {
   dependsOn install4jCustomiseDS_StoreAarch64
 }
 
+task install4jDMGVmoptionsFile(type: Copy) {
+  def inputDir = "${jalviewDir}/${install4j_utils_dir}"
+  def outputDir = "${jalviewDir}/${install4j_build_dir}/tmp"
+
+  def installDateTime = getDate("yyyy-MM-dd HH:mm:ss") + " (build time)"
+
+  from(inputDir) {
+    include(string("${install4j_default_vmoptions}"))
+    rename(string("${install4j_default_vmoptions}"), string("${install4j_default_vmoptions}.X64"))
+
+    filter(ReplaceTokens,
+      beginToken: '__',
+      endToken: '__',
+      tokens: [
+        'INSTALLERFILENAME': string("${install4jmacOSArchiveX64DMGFilename}.dmg"),
+        'INSTALLDATETIME': installDateTime
+      ]
+    )
+
+  }
+
+  from(inputDir) {
+    include(string("${install4j_default_vmoptions}"))
+    rename(string("${install4j_default_vmoptions}"), string("${install4j_default_vmoptions}.AARCH64"))
+
+    filter(ReplaceTokens,
+      beginToken: '__',
+      endToken: '__',
+      tokens: [
+        'INSTALLERFILENAME': string("${install4jmacOSArchiveAarch64DMGFilename}.dmg"),
+        'INSTALLDATETIME': installDateTime
+      ]
+    )
+  }
+
+  into outputDir
+
+  inputs.file("${inputDir}/${install4j_default_vmoptions}")
+  outputs.file("${outputDir}/${install4j_default_vmoptions}.X64")
+  outputs.file("${outputDir}/${install4j_default_vmoptions}.AARCH64")
+}
+
 task install4jDMGProcesses {
   dependsOn install4jDMGBackgroundImageProcess
   dependsOn install4jCustomiseDS_Store
+  dependsOn install4jDMGVmoptionsFile
 }
 
 task installerFiles(type: com.install4j.gradle.Install4jTask) {
@@ -2993,7 +3036,7 @@ task installerFiles(type: com.install4j.gradle.Install4jTask) {
     'GETDOWN_ALT_DIR': getdown_app_dir_alt,
     'GETDOWN_INSTALL_DIR': getdown_install_dir,
     'INFO_PLIST_FILE_ASSOCIATIONS_FILE': install4j_info_plist_file_associations,
-    'BUILD_DIR': install4jBuildDir,
+    'BUILD_DIR': install4j_build_dir,
     'APPLICATION_CATEGORIES': install4j_application_categories,
     'APPLICATION_FOLDER': install4jApplicationFolder,
     'UNIX_APPLICATION_FOLDER': install4jUnixApplicationFolder,
index 041dc13..fb6be1a 100644 (file)
@@ -158,6 +158,7 @@ install4j_dmg_volume_icon = jalview-VolumeIcon.icns
 install4j_installer_icon = jalview_installer.png
 install4j_installer_mac_icon = jalview_installer.icns
 install4j_installer_windows_icon = jalview_installer.ico
+install4j_default_vmoptions = default.vmoptions
 jalview_customise_ds_store = utils/macos_dmg/jalview_customise_dsstore.py
 
 
diff --git a/utils/install4j/default.vmoptions b/utils/install4j/default.vmoptions
new file mode 100644 (file)
index 0000000..4b483b0
--- /dev/null
@@ -0,0 +1,20 @@
+# Enter one VM parameter per line
+# For example, to adjust the maximum memory usage to 512 MB, uncomment the following line:
+# -Xmx512m
+# To include another file, uncomment the following line:
+# -include-options [path to other .vmoption file]
+
+# Jalview specific options below
+# Jalview options added by __INSTALLERFILENAME__ at __INSTALLDATETIME__
+# 
+# Uncomment the following line to disable user-space updates
+#-Dnouserdefaultappdir=true
+# 
+# Uncomment the below line to set a custom path for user-space updates -- use with caution.
+# A leading ~/ or %h anywhere will be substituted with the user's home path, and %u by the username.
+# If not set, the default is ${installer:userDefaultAppdirBase} for ${installer:osName}
+#-Dsetuserappdirpath=/tmp/jalview/%u
+# 
+# Uncomment the following line to also disable all updates
+#-Dsilent=noupdate 
+
index d2e2c0a..b8de2b6 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <install4j version="10.0.8" transformSequenceNumber="10">
   <directoryPresets config="." />
-  <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="${compiler:JAVA_MAX_VERSION}" allowBetaVM="true" jdkMode="jdk" jdkName="JDK 11.0">
+  <application name="${compiler:JALVIEW_APPLICATION_NAME}" applicationId="${compiler:WINDOWS_APPLICATION_ID}" mediaDir="${compiler:JALVIEW_DIR}/${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="${compiler:JAVA_MAX_VERSION}" allowBetaVM="true" jdkMode="jdk" jdkName="JDK 11.0">
     <searchSequence>
       <directory location="${compiler:JRE_DIR}" />
       <registry />
@@ -2689,6 +2689,7 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
         <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/app/jre/Contents/Home/bin/${compiler:JALVIEW_APPLICATION_NAME}" target="java" />
         <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/app/jre/Contents/Home/bin/${compiler:JALVIEW_NAME}" target="java" />
         <file name=".VolumeIcon.icns" file="${compiler:JALVIEW_DIR}/${compiler:MACOSARCHIVE_VOLUMEICON}" />
+        <file name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/vmoptions.txt" file="${compiler:JALVIEW_DIR}/${compiler:BUILD_DIR}/tmp/default.vmoptions.X64" />
       </topLevelFiles>
     </macosArchive>
     <macosArchive name="macOS (Apple Silicon) Disk Image" id="2796" customizedId="MACOS-AARCH64-DMG" mediaFileName="${compiler:MACOSARCHIVE_AARCH64_DMG_FILENAME}" volumeName="${compiler:MACOSARCHIVE_AARCH64_NAME}" architecture="aarch64" launcherId="2823" setupAppId="2746">
@@ -2710,6 +2711,7 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
         <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/app/jre/Contents/Home/bin/${compiler:JALVIEW_APPLICATION_NAME}" target="java" />
         <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/app/jre/Contents/Home/bin/${compiler:JALVIEW_NAME}" target="java" />
         <file name=".VolumeIcon.icns" file="${compiler:JALVIEW_DIR}/${compiler:MACOSARCHIVE_VOLUMEICON}" />
+        <file name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/vmoptions.txt" file="${compiler:JALVIEW_DIR}/${compiler:BUILD_DIR}/tmp/default.vmoptions.AARCH64" />
       </topLevelFiles>
     </macosArchive>
     <unixInstaller name="Linux x64 Shell Installer" id="1595" customizedId="LINUX-X64-SH" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-linux-x64-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}">