From: Ben Soares Date: Thu, 27 Jun 2019 12:02:54 +0000 (+0100) Subject: JAL-3322 Removed debug logging. Enabled backup install/getdown.txt config. Added... X-Git-Tag: Release_2_11_0~2^2~36 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7d8ba6c44b69e49f071c082d19470c399ff84255;hp=e71869cde71ac42b05f9a1c45776dc5bb7f469d7;p=jalview.git JAL-3322 Removed debug logging. Enabled backup install/getdown.txt config. Added a dev doc diagram. --- diff --git a/build.gradle b/build.gradle index 16c31b3..3aa4c45 100644 --- a/build.gradle +++ b/build.gradle @@ -123,7 +123,7 @@ ext { reportRsyncCommand = true break - case ~/^SCRATCH(|-\w*)$/: + case ~/^SCRATCH(|-[-\w]*)$/: getdown_channel_name = CHANNEL getdownDir = getdown_channel_name + "/" + JAVA_VERSION getdown_app_base = getdown_channel_base + "/" + getdownDir @@ -163,6 +163,7 @@ def JAVA_INTEGER_VERSION def additional_compiler_args = [] // these are getdown.txt properties defined dependent on the JAVA_VERSION def getdown_alt_java_min_version +def getdown_alt_java_max_version // this property is assigned below and expanded to multiple lines in the getdown task def getdown_alt_multi_java_location // this property is for the Java library used in eclipse @@ -175,6 +176,7 @@ if (JAVA_VERSION.equals("1.8")) { compile_source_compatibility = 1.8 compile_target_compatibility = 1.8 getdown_alt_java_min_version = getdown_alt_java8_min_version + getdown_alt_java_max_version = getdown_alt_java8_max_version getdown_alt_multi_java_location = getdown_alt_java8_txt_multi_java_location eclipse_java_runtime_name = "JavaSE-1.8" } else if (JAVA_VERSION.equals("11")) { @@ -184,6 +186,7 @@ if (JAVA_VERSION.equals("1.8")) { compile_source_compatibility = 11 compile_target_compatibility = 11 getdown_alt_java_min_version = getdown_alt_java11_min_version + getdown_alt_java_max_version = getdown_alt_java11_max_version getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location eclipse_java_runtime_name = "JavaSE-11" additional_compiler_args += [ @@ -197,6 +200,7 @@ if (JAVA_VERSION.equals("1.8")) { compile_source_compatibility = JAVA_VERSION compile_target_compatibility = JAVA_VERSION getdown_alt_java_min_version = getdown_alt_java11_min_version + getdown_alt_java_max_version = getdown_alt_java11_max_version getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location eclipse_java_runtime_name = "JavaSE-11" additional_compiler_args += [ @@ -833,14 +837,19 @@ task getdownWebsite() { copy { from buildProperties rename(buildPropertiesFile, getdown_build_properties) - into project.ext.getdownWebsiteDir + into project.ext.getdownAppDir } - getdownWebsiteResourceFilenames += getdown_build_properties + getdownWebsiteResourceFilenames += getdown_app_dir+"/"+getdown_build_properties // go through properties looking for getdown_txt_... def props = project.properties.sort { it.key } - props.put("getdown_txt_java_min_version", getdown_alt_java_min_version) - props.put("getdown_txt_multi_java_location", getdown_alt_multi_java_location) + if (getdown_alt_java_min_version.length() > 0) { + props.put("getdown_txt_java_min_version", getdown_alt_java_min_version) + } + if (getdown_alt_java_max_version.length() > 0) { + props.put("getdown_txt_java_max_version", getdown_alt_java_max_version) + } + props.put("getdown_txt_multi_java_location", getdown_alt_multi_java_location) props.put("getdown_txt_appbase", getdown_app_base) props.each{ prop, val -> @@ -996,7 +1005,7 @@ task getdown() { def fromDir = getdownWebsiteDir + (getdownWebsiteDir.endsWith("/")?"":"/") def toDir = getdown_rsync_dest + "/" + getdownDir + (getdownDir.endsWith("/")?"":"/") println "LIKELY RSYNC COMMAND:" - println "rsync -avh --delete '$fromDir' '$toDir'" + println "mkdir -p '$toDir'\nrsync -avh --delete '$fromDir' '$toDir'" if (RUNRSYNC == "true") { exec { commandLine "mkdir", "-p", toDir diff --git a/doc/getdown_installation_structure.pdf b/doc/getdown_installation_structure.pdf new file mode 100644 index 0000000..9fc0dc6 Binary files /dev/null and b/doc/getdown_installation_structure.pdf differ diff --git a/getdown/lib/getdown-core.jar b/getdown/lib/getdown-core.jar index b3aa99b..cef4b46 100644 Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index 264ed45..32921f5 100644 Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ diff --git a/getdown/src/getdown/ant/pom.xml b/getdown/src/getdown/ant/pom.xml index 16af8b3..22b9995 100644 --- a/getdown/src/getdown/ant/pom.xml +++ b/getdown/src/getdown/ant/pom.xml @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.0_JVL + 1.8.3-1.1_JVL getdown-ant diff --git a/getdown/src/getdown/core/pom.xml b/getdown/src/getdown/core/pom.xml index d8264b4..6fff245 100644 --- a/getdown/src/getdown/core/pom.xml +++ b/getdown/src/getdown/core/pom.xml @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.0_JVL + 1.8.3-1.1_JVL getdown-core diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java index bbac55f..0ba2a5e 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java @@ -23,8 +23,6 @@ import java.util.concurrent.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.zip.GZIPInputStream; -import com.sun.management.OperatingSystemMXBean; -import java.lang.management.ManagementFactory; import jalview.bin.MemorySetting; @@ -46,6 +44,9 @@ public class Application { /** The name of our configuration file. */ public static final String CONFIG_FILE = "getdown.txt"; + + /** Dir where a backup config file might reside */ + public static final String BACKUP_CONFIG_DIR = "install"; /** The name of our target version file. */ public static final String VERSION_FILE = "version.txt"; @@ -75,11 +76,11 @@ public class Application DOWNLOAD(50), PATCH(60), //VERIFY_RESOURCES(70, 97), - VERIFY_RESOURCES(30, 60), + VERIFY_RESOURCES(30, 90), //REDOWNLOAD_RESOURCES(90), - REDOWNLOAD_RESOURCES(70), + REDOWNLOAD_RESOURCES(75), //UNPACK(98), - UNPACK(90), + UNPACK(95), //LAUNCH(99); LAUNCH(100); @@ -193,9 +194,9 @@ public class Application this.name = config.getString("ui.name"); this.progress = config.getRect("ui.progress", new Rectangle(5, 5, 300, 15)); this.progressText = config.getColor("ui.progress_text", Color.BLACK); - this.hideProgressText = config.getBoolean("ui.hide_progress_text"); - this.progressSync = config.getBoolean("ui.progress_sync"); - this.progressSyncAfterShown = config.getBoolean("ui.progress_sync_after_shown"); + this.hideProgressText = config.getBoolean("ui.hide_progress_text"); + this.progressSync = config.getBoolean("ui.progress_sync_before_shown"); + this.progressSyncAfterShown = config.getBoolean("ui.progress_sync_after_shown"); this.keepOnTop = config.getBoolean("ui.keep_on_top"); this.displayAppbase = config.getBoolean("ui.display_appbase"); this.displayVersion = config.getBoolean("ui.display_version"); @@ -283,6 +284,7 @@ public class Application public Application (EnvConfig envc) { _envc = envc; _config = getLocalPath(envc.appDir, CONFIG_FILE); + _backupConfig = getLocalPath(new File(envc.appDir.getAbsolutePath()+File.separator+BACKUP_CONFIG_DIR), CONFIG_FILE); } /** @@ -323,11 +325,22 @@ public class Application */ public Resource getConfigResource () { + Resource res = null; try { - return createResource(CONFIG_FILE, Resource.NORMAL); + res = createResource(CONFIG_FILE, Resource.NORMAL); } catch (Exception e) { - throw new RuntimeException("Invalid appbase '" + _vappbase + "'.", e); + log.warning("Invalid appbase '" + _vappbase + "'.", e); + } + if (res == null) { + try { + String backupConfig = BACKUP_CONFIG_DIR + File.separator + CONFIG_FILE; + log.warning("Could not read config '"+CONFIG_FILE+"'. Attempting to use backup '"+backupConfig+"'"); + res = createResource(backupConfig, Resource.NORMAL); + } catch (Exception ex) { + throw new RuntimeException("Invalid appbase in backup config'" + _vappbase + "'.", ex); + } } + return res; } /** @@ -602,6 +615,14 @@ public class Application } catch (Exception e) { log.warning("Failure reading config file", "file", _config, e); } + if (config == null || config.getString("appbase") == null || config.getString("appbase").isEmpty()) { + try { + config = Config.parseConfig(_backupConfig, opts); + log.warning("Using backup config file", "appdir", getAppDir(), "backupConfig", _backupConfig.getAbsoluteFile()); + } catch (Exception e) { + log.warning("Failure reading backup config file", "file", _backupConfig, e); + } + } // see if there's an override config from locator file Config locatorConfig = createLocatorConfig(opts); @@ -1924,8 +1945,6 @@ public class Application log.warning("Failure reading locator file", "file", _locatorFile, e); } - log.info("Returning locatorConfig", locatorConfig); - return locatorConfig; } @@ -1935,6 +1954,7 @@ public class Application protected final EnvConfig _envc; protected File _config; + protected File _backupConfig; protected Digest _digest; protected long _version = -1; diff --git a/getdown/src/getdown/launcher/pom.xml b/getdown/src/getdown/launcher/pom.xml index 90e5c83..1a35bee 100644 --- a/getdown/src/getdown/launcher/pom.xml +++ b/getdown/src/getdown/launcher/pom.xml @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.0_JVL + 1.8.3-1.1_JVL getdown-launcher diff --git a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java index f64959b..01bf370 100644 --- a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java +++ b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java @@ -981,7 +981,7 @@ public abstract class Getdown extends Thread } }); - if (! _addedStatusLayer) { + if (_status != null && ! _addedStatusLayer) { _layers.add(_status, Integer.valueOf(2)); _addedStatusLayer = true; initInterface(); @@ -1128,14 +1128,12 @@ public abstract class Getdown extends Thread try { EventQueue.invokeAndWait(r); //r.run(); - log.warning("INVOKEANDWAIT", "shownContainer", _shownContainer); } catch (Exception e) { log.warning("Tried to invokeAndWait but couldn't. Going to invokeLater instead", "Exception", e.getMessage()); EventQueue.invokeLater(r); } } else { EventQueue.invokeLater(r); - log.warning("INVOKELATER", "ifc", _ifc, "shownContainer", _shownContainer); //r.run(); } diff --git a/getdown/src/getdown/pom.xml b/getdown/src/getdown/pom.xml index 3334828..f11f925 100644 --- a/getdown/src/getdown/pom.xml +++ b/getdown/src/getdown/pom.xml @@ -10,7 +10,7 @@ com.threerings.getdown getdown pom - 1.8.3-1.0_JVL + 1.8.3-1.1_JVL getdown An application installer and updater. diff --git a/gradle.properties b/gradle.properties index 0cb5c68..2e6e38c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -62,7 +62,7 @@ getdown_txt_multi_jvmarg = -Dgetdownappdir=%APPDIR% getdown_txt_strict_comments = true getdown_txt_title = Jalview getdown_txt_ui.name = Jalview -getdown_txt_ui.progress_sync = true +getdown_txt_ui.progress_sync_before_shown = true getdown_txt_ui.progress_sync_after_shown = false getdown_txt_ui.keep_on_top = true getdown_txt_ui.display_appbase = true @@ -83,7 +83,9 @@ getdown_txt_ui.status_text = 000066 getdown_txt_ui.install_error = http://www.jalview.org/faq/getdownerror getdown_txt_ui.mac_dock_icon = resources/images/jalview_logos.ico getdown_alt_java8_min_version = 01080000 +getdown_alt_java8_max_version = 01089999 getdown_alt_java11_min_version = 11000000 +getdown_alt_java11_max_version = getdown_alt_java11_txt_multi_java_location = [windows-amd64] /getdown/jre/windows-jre11.jar,[linux-amd64] /getdown/jre/linux-jre11.tgz,[mac os x] /getdown/jre/macos-jre11.tgz getdown_alt_java8_txt_multi_java_location = [windows-amd64] /getdown/jre/windows-jre1.8.tgz,[linux-amd64] /getdown/jre/linux-jre1.8.tgz,[mac os x] /getdown/jre/macos-jre1.8.tgz JRE_installs = /Users/bsoares/Java/installs @@ -123,8 +125,8 @@ CHANNEL=LOCAL getdown_channel_base = http://www.jalview.org/getdown getdown_channel_name = SCRATCH-DEFAULT getdown_app_dir_release = release -getdown_install_dir = install getdown_app_dir_alt = alt +getdown_install_dir = install getdown_rsync_dest = /Volumes/jalview/docroot/getdown reportRsyncCommand = RUNRSYNC=false diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index b3aa99b..cef4b46 100644 Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ diff --git a/j8lib/getdown-core.jar b/j8lib/getdown-core.jar index b3aa99b..cef4b46 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ