JAL-3631 Rename/rationalise informational system property names. Re-order display...
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 19 Jun 2024 12:35:09 +0000 (13:35 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 19 Jun 2024 12:35:09 +0000 (13:35 +0100)
build.gradle
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher-local.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java
j11lib/getdown-core.jar
j8lib/getdown-core.jar
src/jalview/bin/Cache.java
src/jalview/bin/Jalview.java
src/jalview/bin/Launcher.java

index b02e511..27d0470 100644 (file)
@@ -2439,8 +2439,7 @@ task getdownWebsiteBuild() {
     getdownTextLines += "class = ${main_class}"
     // Not setting these properties in general so that getdownappbase and getdowndistdir will default to release version in jalview.bin.Cache
     if (getdownSetAppBaseProperty) {
-      getdownTextLines += "jvmarg = -Dgetdowndistdir=${getdownAppDistDir}"
-      getdownTextLines += "jvmarg = -Dgetdownappbase=${getdownAppBase}"
+      getdownTextLines += "jvmarg = -Dlauncher.distdir=${getdownAppDistDir}"
     }
 
     def getdownTxt = file("${getdownAppBaseDir}/getdown.txt")
index e0cf638..4d92cc8 100644 (file)
Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ
index e641840..0cae0b8 100644 (file)
Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ
index 0025436..722e965 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index d5a3def..59e1bcb 100644 (file)
@@ -1087,16 +1087,21 @@ public class Application
        }
 
         // add the getdowninstanceappbase property.
-        args.add("-Dgetdowninstanceappbase=" + getAppbase().toString());
-        args.add("-Dinstaller.appdir=" + System.getProperty("installer.appdir"));
-        args.add("-Dgetdownappdir=" + getAppDir());
-
+        args.add("-Dlauncher.appbase=" + getAppbase().toString());
+        args.add("-Dlauncher.appdir=" + getAppDir());
+        args.add("-Dlauncher.version=" + Build.version());
+        if (System.getProperty("installer.appdir") != null) {
+          args.add("-Dinstaller.appdir=" + System.getProperty("installer.appdir"));
+        }
         // add the marker indicating the app is running in getdown
         args.add("-D" + Properties.GETDOWN + "=true");
         args.add("-Dsys.install4jVersion=" + Application.i4jVersion);
-        args.add("-Dinstaller.template_version=" + System.getProperty("installer.template_version"));
-        args.add("-Dlauncher.version=" + Build.version());
-        args.add("-Dinstall4j.extrainfo=" + System.getProperty("install4j.extrainfo"));
+        if (System.getProperty("installer.template_version") != null) {
+          args.add("-Dinstaller.template_version=" + System.getProperty("installer.template_version"));
+        }
+        if (System.getProperty("installer.extrainfo") != null) {
+          args.add("-Dinstaller.extrainfo=" + System.getProperty("installer.extrainfo"));
+        }
 
         // set HiDPI property if wanted
         String scalePropertyArg = HiDPISetting.getScalePropertyArg();
index e0cf638..4d92cc8 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index e0cf638..4d92cc8 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ
index 642e360..036f663 100755 (executable)
@@ -1225,6 +1225,8 @@ public class Cache
    */
   public static String getVersionDetailsForConsole()
   {
+    boolean extra = Console.isDebugEnabled()
+            || !"release".equals(ChannelProperties.getProperty("channel"));
     StringBuilder sb = new StringBuilder();
     sb.append(ChannelProperties.getProperty("app_name"))
             .append(" Version: ");
@@ -1234,48 +1236,63 @@ public class Cache
             .append(" Installation: ");
     sb.append(Cache.getDefault("INSTALLATION", "unknown"));
     sb.append("\n");
+    appendIfNotNull(sb, "Channel: ",
+            ChannelProperties.getProperty("channel"), "\n", null);
+    if (extra)
+    {
+      appendIfNotNull(sb, "Preferences file: ", propertiesFile, "\n",
+              "unknown");
+    }
     sb.append("Build Date: ");
     sb.append(Cache.getDefault("BUILD_DATE", "unknown"));
     sb.append("\n");
     sb.append("Java version: ");
     sb.append(System.getProperty("java.version"));
     sb.append("\n");
-    sb.append("Java platform: ");
-    sb.append(System.getProperty("os.arch"));
-    sb.append(" ");
-    sb.append(System.getProperty("os.name"));
-    sb.append(" ");
-    sb.append(System.getProperty("os.version"));
-    sb.append("\n");
-    appendIfNotNull(sb, "Install4j version: ",
-            System.getProperty("sys.install4jVersion"), "\n", null);
-    appendIfNotNull(sb, "Install4j template version: ",
-            System.getProperty("installer.template_version"), "\n", null);
-    appendIfNotNull(sb, "Install4j extrainfo: ",
-            System.getProperty("install4j.extrainfo"), "\n", null);
-    appendIfNotNull(sb, "Launcher version: ",
-            System.getProperty("launcher.version"), "\n", null);
-    LookAndFeel laf = UIManager.getLookAndFeel();
-    String lafName = laf == null ? "Not obtained" : laf.getName();
-    String lafClass = laf == null ? "unknown" : laf.getClass().getName();
-    sb.append("LookAndFeel: ");
-    sb.append(lafName);
-    sb.append(" (");
-    sb.append(lafClass);
-    sb.append(")\n");
-    appendIfNotNull(sb, "Channel: ",
-            ChannelProperties.getProperty("channel"), "\n", null);
-    if (Console.isDebugEnabled()
-            || !"release".equals(ChannelProperties.getProperty("channel")))
+    if (extra)
     {
-      appendIfNotNull(sb, "Getdown appdir: ",
-              System.getProperty("getdowninstanceappdir"), "\n", null);
-      appendIfNotNull(sb, "Getdown appbase: ",
-              System.getProperty("getdowninstanceappbase"), "\n", null);
       appendIfNotNull(sb, "Java home: ", System.getProperty("java.home"),
               "\n", "unknown");
-      appendIfNotNull(sb, "Preferences file: ", propertiesFile, "\n",
-              "unknown");
+      appendIfNotNull(sb, "Java launch class: ",
+              System.getProperty("sun.java.command"), "\n", "unknown");
+      sb.append("Java platform: ");
+      sb.append(System.getProperty("os.name"));
+      sb.append(" ");
+      sb.append(System.getProperty("os.version"));
+      sb.append(" (");
+      sb.append(System.getProperty("os.arch"));
+      sb.append(")");
+      sb.append("\n");
+      LookAndFeel laf = UIManager.getLookAndFeel();
+      String lafName = laf == null ? "Not obtained" : laf.getName();
+      String lafClass = laf == null ? "unknown" : laf.getClass().getName();
+      sb.append("LookAndFeel: ");
+      sb.append(lafName);
+      sb.append(" (");
+      sb.append(lafClass);
+      sb.append(")\n");
+    }
+    appendIfNotNull(sb, "Installer version: ",
+            System.getProperty("sys.install4jVersion"), "\n", null);
+    if (extra)
+    {
+      appendIfNotNull(sb, "Installer template version: ",
+              System.getProperty("installer.template_version"), "\n", null);
+      appendIfNotNull(sb, "Installer appdir: ",
+              System.getProperty("installer.appdir"), "\n", null);
+      appendIfNotNull(sb, "Installer extrainfo: ",
+              System.getProperty("installer.extrainfo"), "\n", null);
+    }
+    appendIfNotNull(sb, "Launcher version: ",
+            System.getProperty("launcher.version"), "\n", null);
+    if (extra)
+    {
+      appendIfNotNull(sb, "Launcher appdir: ",
+              System.getProperty("launcher.appdir"), "\n", null);
+      appendIfNotNull(sb, "Launcher distdir: ",
+              System.getProperty("launcher.distdir"), "\n", null);
+      appendIfNotNull(sb, "Launcher appbase: ",
+              System.getProperty("launcher.appbase"), "\n", null);
     }
     return sb.toString();
   }
@@ -1621,8 +1638,16 @@ public class Cache
     {
       return;
     }
-    String appbase = System.getProperty("getdownappbase");
-    String distDir = System.getProperty("getdowndistdir");
+    String appbase = System.getProperty("launcher.appbase");
+    if (appbase == null)
+    {
+      appbase = System.getProperty("getdownappbase"); // old name
+    }
+    String distDir = System.getProperty("launcher.distdir");
+    if (distDir == null)
+    {
+      distDir = System.getProperty("getdowndistdir"); // old name
+    }
     if (appbase == null)
     {
       appbase = buildProperties.getProperty("GETDOWNAPPBASE");
index 3df1734..8dfddcf 100755 (executable)
@@ -370,7 +370,7 @@ public class Jalview implements JalviewObjectI
 
     // Move any new getdown-launcher-new.jar into place over old
     // getdown-launcher.jar
-    String appdirString = System.getProperty("getdownappdir");
+    String appdirString = System.getProperty("launcher.appdir");
     if (appdirString != null && appdirString.length() > 0)
     {
       final File appdir = new File(appdirString);
@@ -401,23 +401,38 @@ public class Jalview implements JalviewObjectI
       String val = System.getProperty("sys.install4jVersion");
       if (val != null)
       {
-        Console.outPrintln("Install4j version: " + val);
+        Console.outPrintln("Installer version: " + val);
       }
       val = System.getProperty("installer.template_version");
       if (val != null)
       {
-        Console.outPrintln("Install4j template version: " + val);
+        Console.outPrintln("Installer template version: " + val);
       }
-      val = System.getProperty("install4j.extrainfo");
+      val = System.getProperty("installer.appdir");
       if (val != null)
       {
-        Console.outPrintln("Install4j extrainfo: " + val);
+        Console.outPrintln("Installer appdir: " + val);
+      }
+      val = System.getProperty("installer.extrainfo");
+      if (val != null)
+      {
+        Console.outPrintln("Installer extrainfo: " + val);
       }
       val = System.getProperty("launcher.version");
       if (val != null)
       {
         Console.outPrintln("Launcher version: " + val);
       }
+      val = appdirString;
+      if (val != null)
+      {
+        Console.outPrintln("Launcher appdir: " + val);
+      }
+      val = System.getProperty("launcher.appbase");
+      if (val != null)
+      {
+        Console.outPrintln("Launcher appbase: " + val);
+      }
     }
 
     if (Platform.isLinux() && LaunchUtils.getJavaVersion() < 11)
index 9387be4..ec53219 100644 (file)
@@ -294,8 +294,9 @@ public class Launcher
     {
       if (!dockIcon)
       {
-        String dockIconPath = System.getProperty("getdownappdir", ".")
-                + File.separator + "resource/jalview_logo.png";
+        String dockIconPath = System.getProperty("launcher.appdir", ".")
+                + File.separator + "resource" + File.separator
+                + "jalview_logo.png";
         addJvmArgs.add("-Xdock:icon=" + dockIconPath);
       }
       if (!dockName)