JAL-3353 Change to build.gradle to use the file:// enabled getdown-launcher-local...
authorBen Soares <bsoares@dundee.ac.uk>
Thu, 4 Jul 2019 13:16:14 +0000 (14:16 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Thu, 4 Jul 2019 13:16:14 +0000 (14:16 +0100)
14 files changed:
build.gradle
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher-local.jar [new file with mode: 0644]
getdown/lib/getdown-launcher.jar
getdown/src/getdown/ant/pom.xml
getdown/src/getdown/core/pom.xml
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl
getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/HostWhitelist.java
getdown/src/getdown/launcher/pom.xml
getdown/src/getdown/mvn_cmd
getdown/src/getdown/pom.xml
gradle.properties
j11lib/getdown-core.jar
j8lib/getdown-core.jar

index 2332643..861fa21 100644 (file)
@@ -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)
index 34723c1..bbe1476 100644 (file)
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 (file)
index 0000000..4a36222
Binary files /dev/null and b/getdown/lib/getdown-launcher-local.jar differ
index edeadaa..85ede0c 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index 0064425..6d6f8e9 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3_1.1.7_JVL</version>
+    <version>1.8.3-1.1.8_FJVL</version>
   </parent>
 
   <artifactId>getdown-ant</artifactId>
index 80d0c38..51d3d5f 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3_1.1.7_JVL</version>
+    <version>1.8.3-1.1.8_FJVL</version>
   </parent>
 
   <artifactId>getdown-core</artifactId>
@@ -37,6 +37,7 @@
     <getdown.host.whitelist>jalview.org,*.jalview.org</getdown.host.whitelist>
     <connect_timeout>8</connect_timeout>
     <read_timeout>15</read_timeout>
+    <allow_file_protocol>false</allow_file_protocol>
   </properties>
 
   <build>
@@ -87,6 +88,7 @@
                     <filter token="host_whitelist" value="${getdown.host.whitelist}" />
                     <filter token="connect_timeout" value="${connect_timeout}" />
                     <filter token="read_timeout" value="${read_timeout}" />
+                    <filter token="allow_file_protocol" value="${allow_file_protocol}" />
                   </filterset>
                 </copy>
               </target>
index 86ea47b..1023ede 100644 (file)
@@ -62,4 +62,15 @@ public class Build {
                        return 30;
                }
     }
+    
+    /*
+     * <p>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;
+               }
+    }
 }
index f2f7ef3..ff0661b 100644 (file)
@@ -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();
 }
index 4755cc6..bf0b736 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3_1.1.7_JVL</version>
+    <version>1.8.3-1.1.8_FJVL</version>
   </parent>
 
   <artifactId>getdown-launcher</artifactId>
index fd7c716..0cd54eb 100755 (executable)
@@ -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|(<version>)[^<]*JVL[^<]*(</version>)|${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|(<version>)[^<]*JVL[^<]*(</version>)|${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
index 2807be5..a73b59e 100644 (file)
@@ -10,7 +10,7 @@
   <groupId>com.threerings.getdown</groupId>
   <artifactId>getdown</artifactId>
   <packaging>pom</packaging>
-  <version>1.8.3_1.1.7_JVL</version>
+  <version>1.8.3-1.1.8_FJVL</version>
 
   <name>getdown</name>
   <description>An application installer and updater.</description>
index 4fcb636..6605fa9 100644 (file)
@@ -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
index 34723c1..bbe1476 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index 34723c1..bbe1476 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ