From: Ben Soares Date: Thu, 4 Jul 2019 13:16:14 +0000 (+0100) Subject: JAL-3353 Change to build.gradle to use the file:// enabled getdown-launcher-local... X-Git-Tag: Release_2_11_0~1^2~3 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=f0dfe10695b42e98e4d7b6801786107c478d5111 JAL-3353 Change to build.gradle to use the file:// enabled getdown-launcher-local.jar for LOCAL and ARCHIVELOCAL builds only. Otherwise the getdown-launcher.jar (with no local file enabled) will be used --- diff --git a/build.gradle b/build.gradle index 2332643..861fa21 100644 --- a/build.gradle +++ b/build.gradle @@ -56,6 +56,7 @@ ext { reportRsyncCmd = false buildDist = true buildProperties = buildPropertiesFile + getdownLauncher = jalviewDir + '/' + getdown_lib_dir + '/' + getdown_launcher switch (CHANNEL) { case "BUILD": @@ -103,6 +104,7 @@ ext { buildDist = false } reportRsyncCommand = true + getdownLauncher = jalviewDir + '/' + getdown_lib_dir + '/' + getdown_launcher_local break case "DEVELOP": @@ -136,6 +138,7 @@ ext { getdown_app_base = file(getdownWebsiteDir).toURI().toString() getdown_app_dir = getdown_app_dir_alt buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile + getdownLauncher = jalviewDir + '/' + getdown_lib_dir + '/' + getdown_launcher_local break default: // something wrong specified @@ -150,7 +153,6 @@ ext { //getdownJ11libDir = getdownWebsiteDir + '/' + getdown_j11lib_dir getdownResourceDir = getdownWebsiteDir + '/' + getdown_resource_dir getdownInstallDir = getdownWebsiteDir + '/' + getdown_install_dir - getdownLauncher = jalviewDir + '/' + getdown_launcher getdownFilesDir = jalviewDir + '/' + getdown_files_dir + '/' + JAVA_VERSION + '/' getdownFilesInstallDir = getdownFilesDir+"/"+getdown_install_dir /* compile without modules -- using classpath libraries @@ -962,6 +964,9 @@ task getdownWebsite() { copy { from getdownLauncher + if (file(getdownLauncher).getName() != getdown_launcher) { + rename(file(getdownLauncher).getName(), getdown_launcher) + } into project.ext.getdownWebsiteDir } @@ -970,6 +975,9 @@ task getdownWebsite() { from getdown_txt from getdownLauncher from getdownWebsiteDir+"/"+getdown_build_properties + if (file(getdownLauncher).getName() != getdown_launcher) { + rename(file(getdownLauncher).getName(), getdown_launcher) + } into getdownInstallDir } @@ -984,6 +992,9 @@ task getdownWebsite() { from launch_jvl from getdownLauncher from getdownWebsiteDir+"/"+getdown_build_properties + if (file(getdownLauncher).getName() != getdown_launcher) { + rename(file(getdownLauncher).getName(), getdown_launcher) + } into getdownFilesDir } @@ -1004,7 +1015,9 @@ task getdownDigest(type: JavaExec) { group = "distribution" description = "Digest the getdown website folder" dependsOn getdownWebsite - classpath = files(jalviewDir + '/' + getdown_core, jalviewDir+'/'+getdown_launcher) + doFirst { + classpath = files(getdownWebsiteDir + '/' + getdown_launcher) + } main = "com.threerings.getdown.tools.Digester" args project.ext.getdownWebsiteDir inputs.dir(project.ext.getdownWebsiteDir) diff --git a/getdown/lib/getdown-core.jar b/getdown/lib/getdown-core.jar index 34723c1..bbe1476 100644 Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ diff --git a/getdown/lib/getdown-launcher-local.jar b/getdown/lib/getdown-launcher-local.jar new file mode 100644 index 0000000..4a36222 Binary files /dev/null and b/getdown/lib/getdown-launcher-local.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index edeadaa..85ede0c 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 0064425..6d6f8e9 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.1.7_JVL + 1.8.3-1.1.8_FJVL getdown-ant diff --git a/getdown/src/getdown/core/pom.xml b/getdown/src/getdown/core/pom.xml index 80d0c38..51d3d5f 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.1.7_JVL + 1.8.3-1.1.8_FJVL getdown-core @@ -37,6 +37,7 @@ jalview.org,*.jalview.org 8 15 + false @@ -87,6 +88,7 @@ + diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl index 86ea47b..1023ede 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl @@ -62,4 +62,15 @@ public class Build { return 30; } } + + /* + *

Whether to allow the local "file://" scheme for appbase + */ + public static boolean allowLocatorFileProtocol() { + try { + return Boolean.valueOf("@allow_file_protocol@"); + } catch (Exception e) { + return false; + } + } } diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/HostWhitelist.java b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/HostWhitelist.java index f2f7ef3..ff0661b 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/HostWhitelist.java +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/HostWhitelist.java @@ -59,5 +59,5 @@ public final class HostWhitelist throw new MalformedURLException( "The host for the specified URL (" + url + ") is not in the host whitelist: " + hosts); } - private static boolean ALLOW_LOCATOR_FILE_PROTOCOL = true; + private static final boolean ALLOW_LOCATOR_FILE_PROTOCOL = Build.allowLocatorFileProtocol(); } diff --git a/getdown/src/getdown/launcher/pom.xml b/getdown/src/getdown/launcher/pom.xml index 4755cc6..bf0b736 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.1.7_JVL + 1.8.3-1.1.8_FJVL getdown-launcher diff --git a/getdown/src/getdown/mvn_cmd b/getdown/src/getdown/mvn_cmd index fd7c716..0cd54eb 100755 --- a/getdown/src/getdown/mvn_cmd +++ b/getdown/src/getdown/mvn_cmd @@ -3,7 +3,7 @@ if [ x$JVLVERSION != x ]; then export VERSION=$JVLVERSION else - export VERSION=1.8.3-1.1.4_JVL + export VERSION=1.8.3-1.1.8_JVL fi if [ x${VERSION%_JVL} = x$VERSION ]; then @@ -11,14 +11,21 @@ if [ x${VERSION%_JVL} = x$VERSION ]; then fi echo "Setting VERSION to '$VERSION'" - perl -p -i -e 's|()[^<]*JVL[^<]*()|${1}$ENV{VERSION}${2}|;' pom.xml */pom.xml +mvn package -Dgetdown.host.whitelist="jalview.org,*.jalview.org" -Dallow_file_protocol=false -Dconnect_timeout=8 -Dread_timeout=15 +RET=$? +if [ x$RET = x0 ]; then + cp launcher/target/getdown-launcher-$VERSION.jar ../../../getdown/lib/getdown-launcher.jar && echo "Copied getdown-launcher-$VERSION.jar to getdown/lib" + cp core/target/getdown-core-$VERSION.jar ../../../getdown/lib/getdown-core.jar && echo "Copied getdown-core-$VERSION.jar to getdown/lib" + cp core/target/getdown-core-$VERSION.jar ../../../j8lib/getdown-core.jar && echo "Copied getdown-core-$VERSION.jar to j8lib" + cp core/target/getdown-core-$VERSION.jar ../../../j11lib/getdown-core.jar && echo "Copied getdown-core-$VERSION.jar to j11lib" +fi -mvn package -Dgetdown.host.whitelist="jalview.org,*.jalview.org" -Dconnect_timeout=8 -Dread_timeout=15 +VERSION=${VERSION/JVL/FJVL} +echo "Setting VERSION to '$VERSION'" +perl -p -i -e 's|()[^<]*JVL[^<]*()|${1}$ENV{VERSION}${2}|;' pom.xml */pom.xml +mvn package -Dgetdown.host.whitelist="jalview.org,*.jalview.org" -Dallow_file_protocol=true -Dconnect_timeout=4 -Dread_timeout=4 RET=$? if [ x$RET = x0 ]; then - cp launcher/target/getdown-launcher-$VERSION.jar ../../../getdown/lib/getdown-launcher.jar && echo "Copied getdown-launcher.jar to getdown/lib" - cp core/target/getdown-core-$VERSION.jar ../../../getdown/lib/getdown-core.jar && echo "Copied getdown-core.jar to getdown/lib" - cp core/target/getdown-core-$VERSION.jar ../../../j8lib/getdown-core.jar && echo "Copied getdown-core.jar to j8lib" - cp core/target/getdown-core-$VERSION.jar ../../../j11lib/getdown-core.jar && echo "Copied getdown-core.jar to j11lib" + cp launcher/target/getdown-launcher-$VERSION.jar ../../../getdown/lib/getdown-launcher-local.jar && echo "Copied getdown-launcher-$VERSION.jar to getdown/lib/getdown-launcher-local.jar" fi diff --git a/getdown/src/getdown/pom.xml b/getdown/src/getdown/pom.xml index 2807be5..a73b59e 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.1.7_JVL + 1.8.3-1.1.8_FJVL getdown An application installer and updater. diff --git a/gradle.properties b/gradle.properties index 4fcb636..6605fa9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -52,7 +52,9 @@ getdown_website_dir = getdown/website getdown_resource_dir = resource #getdown_j11lib_dir = j11lib getdown_files_dir = getdown/files -getdown_launcher = getdown/lib/getdown-launcher.jar +getdown_lib_dir = getdown/lib +getdown_launcher = getdown-launcher.jar +getdown_launcher_local = getdown-launcher-local.jar getdown_launcher_new = getdown-launcher-new.jar getdown_core = getdown/lib/getdown-core.jar getdown_launch_jvl = channel_launch.jvl diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index 34723c1..bbe1476 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 34723c1..bbe1476 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ