applicationProperties.remove("YEAR");
}
- // FIND THE VERSION NUMBER AND BUILD DATE FROM jalview.jar
- // MUST FOLLOW READING OF LOCAL PROPERTIES FILE AS THE
- // VERSION MAY HAVE CHANGED SINCE LAST USING JALVIEW
- try
- {
- String buildDetails = "jar:".concat(Cache.class.getProtectionDomain()
- .getCodeSource().getLocation().toString()
- .concat("!/.build_properties"));
-
- java.net.URL localJarFileURL = new java.net.URL(buildDetails);
-
- InputStream in = localJarFileURL.openStream();
- applicationProperties.load(in);
- in.close();
- } catch (Exception ex)
- {
- System.out.println("Error reading build details: " + ex);
- applicationProperties.remove("VERSION");
- }
-
- String jnlpVersion = System.getProperty("jalview.version");
- String codeVersion = getProperty("VERSION");
- String codeInstallation = getProperty("INSTALLATION");
- if (codeVersion == null)
- {
- // THIS SHOULD ONLY BE THE CASE WHEN TESTING!!
- codeVersion = "Test";
- jnlpVersion = "Test";
- codeInstallation = "";
- }
- else
- {
- codeInstallation = " (" + codeInstallation + ")";
- }
- new BuildDetails(codeVersion, null, codeInstallation);
+ loadBuildProperties(false);
SiftsSettings
.setMapWithSifts(Cache.getDefault("MAP_WITH_SIFTS", false));
"http://www.jalview.org/services/identifiers"));
IdOrgSettings.setDownloadLocation(ID_ORG_FILE);
- System.out
- .println("Jalview Version: " + codeVersion + codeInstallation);
-
StructureImportSettings.setDefaultStructureFileFormat(jalview.bin.Cache
.getDefault("PDB_DOWNLOAD_FORMAT", PDB_DOWNLOAD_FORMAT));
StructureImportSettings
// StructureImportSettings
// .setDefaultPDBFileParser(jalview.bin.Cache.getDefault(
// "DEFAULT_PDB_FILE_PARSER", DEFAULT_PDB_FILE_PARSER));
- // jnlpVersion will be null if we're using InstallAnywhere
+
+ String jnlpVersion = System.getProperty("jalview.version");
+
+ // jnlpVersion will be null if a latest version check for the channel needs to
+ // be done
// Dont do this check if running in headless mode
+
if (jnlpVersion == null && getDefault("VERSION_CHECK", true)
&& (System.getProperty("java.awt.headless") == null || System
.getProperty("java.awt.headless").equals("false")))
}
}
- setProperty("VERSION", codeVersion);
-
// LOAD USERDEFINED COLOURS
jalview.bin.Cache
.initUserColourSchemes(getProperty("USER_DEFINED_COLOURS"));
false);
}
+ public static void loadBuildProperties(boolean reportVersion)
+ {
+ String codeInstallation = getProperty("INSTALLATION");
+ boolean printV = codeInstallation == null;
+
+ // FIND THE VERSION NUMBER AND BUILD DATE FROM jalview.jar
+ try
+ {
+ String buildDetails = "jar:".concat(Cache.class.getProtectionDomain()
+ .getCodeSource().getLocation().toString()
+ .concat("!/.build_properties"));
+
+ java.net.URL localJarFileURL = new java.net.URL(buildDetails);
+
+ InputStream in = localJarFileURL.openStream();
+ applicationProperties.load(in);
+ in.close();
+ } catch (Exception ex)
+ {
+ System.out.println("Error reading build details: " + ex);
+ applicationProperties.remove("VERSION");
+ }
+ String codeVersion = getProperty("VERSION");
+ codeInstallation = getProperty("INSTALLATION");
+
+ if (codeVersion == null)
+ {
+ // THIS SHOULD ONLY BE THE CASE WHEN TESTING!!
+ codeVersion = "Test";
+ codeInstallation = "";
+ }
+ else
+ {
+ codeInstallation = " (" + codeInstallation + ")";
+ }
+ setProperty("VERSION", codeVersion);
+ new BuildDetails(codeVersion, null, codeInstallation);
+ if (printV && reportVersion)
+ {
+ System.out
+ .println("Jalview Version: " + codeVersion + codeInstallation);
+ }
+ }
+
private static void deleteBuildProperties()
{
applicationProperties.remove("LATEST_VERSION");
try
{
oldValue = applicationProperties.setProperty(key, obj);
- if (!propsAreReadOnly)
+ if (propertiesFile != null && !propsAreReadOnly)
{
FileOutputStream out = new FileOutputStream(propertiesFile);
applicationProperties.store(out, "---JalviewX Properties File---");
}
}
}
+
+ /**
+ *
+ * @return Jalview version, build details and JVM platform version for console
+ */
+ public static String getVersionDetailsForConsole()
+ {
+ return "Jalview Version: "
+ + jalview.bin.Cache.getDefault("VERSION", "TEST")
+ + "\n" + "Jalview Installation: "
+ + jalview.bin.Cache.getDefault("INSTALLATION",
+ "unknown")
+ + "\n" + "Build Date: "
+ + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown")
+ + "\n" + "Java version: "
+ + System.getProperty("java.version") + "\n"
+ + System.getProperty("os.arch") + " "
+ + System.getProperty("os.name") + " "
+ + System.getProperty("os.version")
+ + (jalview.bin.Cache.getDefault("VERSION", "TEST")
+ .equals("DEVELOPMENT")
+ ? "\nJava path:"
+ + System.getProperty(
+ "java.home")
+ + File.separator + "bin"
+ + File.separator + "java"
+ : "");
+ }
+
+ /**
+ *
+ * @return build details as reported in splashscreen
+ */
+ public static String getBuildDetailsForSplash()
+ {
+ // consider returning more human friendly info
+ // eg 'built from Source' or update channel
+ return jalview.bin.Cache.getDefault("INSTALLATION", "unknown");
+ }
}
}
jconsole = new Console(this, showjconsole);
// add essential build information
- jconsole.setHeader(
- "Jalview Version: " + jalview.bin.Cache.getProperty("VERSION")
- + "\n" + "Jalview Installation: "
- + jalview.bin.Cache.getDefault("INSTALLATION",
- "unknown")
- + "\n" + "Build Date: "
- + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown")
- + "\n" + "Java version: "
- + System.getProperty("java.version") + "\n"
- + System.getProperty("os.arch") + " "
- + System.getProperty("os.name") + " "
- + System.getProperty("os.version")
- + (jalview.bin.Cache.getProperty("VERSION").equals("DEVELOPMENT")
- ? "\nJava path:"
- + System.getProperty(
- "java.home")
- + File.separator + "bin"
- + File.separator + "java"
- : "")
- );
+ jconsole.setHeader(jalview.bin.Cache.getVersionDetailsForConsole());
showConsole(showjconsole);
message.append("<h1><strong>Version: "
+ jalview.bin.Cache.getProperty("VERSION")
+ "</strong></h1>");
- message.append("<strong>Last Updated: <em>"
+ message.append("<strong>Built: <em>"
+ jalview.bin.Cache.getDefault("BUILD_DATE", "unknown")
- + "</em></strong>");
+ + "</em> from " + jalview.bin.Cache.getBuildDetailsForSplash()
+ + "</strong>");
}
else
if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
.equals("Checking"))
{
- message.append("<br>...Checking latest version...</br>");
+ // JBP removed this message for 2.11: May be reinstated in future version
+ // message.append("<br>...Checking latest version...</br>");
}
else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
.equals(jalview.bin.Cache.getProperty("VERSION")))