From: Jim Procter Date: Thu, 27 Jun 2019 16:04:14 +0000 (+0100) Subject: Merge branch 'JAL-3322_getdown_speed_improvement' into develop X-Git-Tag: Release_2_11_0~2^2~32^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6935c8332c2a60f24dfa19a7418e1f1cd49447d0;hp=91e1a778afa1d0752d9d7ec6e1f2a9bf64b9fb09;p=jalview.git Merge branch 'JAL-3322_getdown_speed_improvement' into develop --- 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 7ee98a0..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 42efe3c..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 c3a3d79..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); @@ -150,9 +151,12 @@ public class Application /** Whether progress text should be hidden or not. */ public final boolean hideProgressText; - /** Whether the splash screen should retain focus. */ + /** Whether the splash screen should update non-asynchronously before being shown. */ public final boolean progressSync; + /** Whether the splash screen should update non-asynchronously after being shown. */ + public final boolean progressSyncAfterShown; + /** Whether the splash screen should retain focus. */ public final boolean keepOnTop; @@ -180,7 +184,8 @@ public class Application ", pb=" + progressBar + ", srect=" + status + ", st=" + statusText + ", shadow=" + textShadow + ", err=" + installError + ", nrect=" + patchNotes + ", notes=" + patchNotesUrl + ", stepPercentages=" + stepPercentages + - ", hideProgressText=" + hideProgressText + ", keepOnTop=" + keepOnTop + ", progressSync=" + progressSync + ", minShow=" + minShowSeconds + + ", hideProgressText=" + hideProgressText + ", keepOnTop=" + keepOnTop + ", progressSync=" + progressSync + + ", progressSyncAfterShown=" + progressSyncAfterShown + ", minShow=" + minShowSeconds + ", displayAppbase=" + displayAppbase + ", displayVersion=" + displayVersion + "]"; } @@ -189,8 +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.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"); @@ -278,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); } /** @@ -318,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; } /** @@ -597,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); @@ -1919,8 +1945,6 @@ public class Application log.warning("Failure reading locator file", "file", _locatorFile, e); } - log.info("Returning locatorConfig", locatorConfig); - return locatorConfig; } @@ -1930,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 ba238de..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(); @@ -1124,7 +1124,7 @@ public abstract class Getdown extends Thread } catch (Exception e) { log.warning("Could't read config when invoking GUI action", "Exception", e.getMessage()); } - if (_ifc != null && _ifc.progressSync) { + if (_ifc != null && (_shownContainer?_ifc.progressSyncAfterShown:_ifc.progressSync)) { try { EventQueue.invokeAndWait(r); //r.run(); @@ -1159,13 +1159,15 @@ public abstract class Getdown extends Thread protected boolean _launchInSilent; protected boolean _noUpdate; protected long _startup; - + protected Set _toInstallResources; protected boolean _readyToInstall; protected boolean _enableTracking = true; protected int _reportedProgress = 0; + protected boolean _shownContainer; + /** Number of minutes to wait after startup before beginning any real heavy lifting. */ protected int _delay; diff --git a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java index 4adc77c..7c54f80 100644 --- a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java +++ b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java @@ -203,6 +203,7 @@ public class GetdownApp SwingUtil.centerWindow(_frame); _frame.setVisible(true); } + _shownContainer = true; } @Override 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 6f3092e..2e6e38c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -62,7 +62,8 @@ 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 getdown_txt_ui.display_version = true @@ -82,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 @@ -122,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 7ee98a0..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 7ee98a0..cef4b46 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ