JAL-3130 Some fixes to ant build xml, and the modules list file creation (to remove...
authorBen Soares <bsoares@dundee.ac.uk>
Mon, 17 Dec 2018 10:34:21 +0000 (10:34 +0000)
committerBen Soares <bsoares@dundee.ac.uk>
Mon, 17 Dec 2018 10:34:21 +0000 (10:34 +0000)
build-j11.xml
modules
utils/jdeps_jlink_all.sh

index 6ed0b0f..4bc58b4 100755 (executable)
   <taskdef resource="testngtasks" classpath="utils/testnglibs/testng.jar" />
 
   <target name="testng" depends="buildTests">
+    <loadfile property="j11modules" srcFile="modules"/>
+    <echo message="j11libDir is '${j11libDir}'" />
+    <echo message="j11modules is '${j11modules}'" />
     <testng outputDir="${reportDir}" haltOnFailure="false" groups="${testng-groups}" mode="testng"
       verbose="2">
       <classpath>
         <path refid="test.classpath" />
       </classpath>
       <jvmarg value="--module-path=${j11libDir}:${java.home}/jmods" if:set="java11"/>
+      <jvmarg value="--add-modules=${j11modules}" if:set="java11"/>
       <jvmarg value="--add-modules=java.se.ee" if:set="java9"/>
       <jvmarg value="--illegal-access=warn" if:set="java9"/>
       <classfileset dir="${testOutputDir}" includes="**/*.class" />
     </condition>
     <fail unless="propsSpecified" message="class.name property not specified."/>
     <echo message="testng-groups is '${testng-groups}'" />
+    <loadfile property="j11modules" srcFile="modules"/>
     <testng outputDir="${reportDir}" haltOnFailure="false" groups="${testng-groups}" mode="testng" verbose="2">
       <classpath>
         <pathelement location="${testOutputDir}" />
         <path refid="test.classpath" />
       </classpath>
       <jvmarg value="--module-path=${j11libDir}:${java.home}/jmods" if:set="java11"/>
+      <jvmarg value="--add-modules=${j11modules}" if:set="java11"/>
       <jvmarg value="--add-modules=java.se.ee" if:set="java9"/>
       <jvmarg value="--illegal-access=warn" if:set="java9"/>
       <classfileset dir="${testOutputDir}" includes="${class.name}" />
diff --git a/modules b/modules
index 356b1a6..6ab8594 100644 (file)
--- a/modules
+++ b/modules
@@ -1 +1 @@
-com.sun.istack.runtime,com.sun.xml.bind,com.sun.xml.fastinfoset,com.sun.xml.streambuffer,com.sun.xml.txw2,com.sun.xml.ws.policy,java.activation,java.annotation,java.base,java.compiler,java.datatransfer,java.desktop,java.logging,java.management,java.management.rmi,java.naming,java.prefs,java.rmi,java.scripting,java.security.sasl,java.sql,java.xml,java.xml.bind,java.xml.soap,java.xml.ws,javax.jws,jdk.httpserver,jdk.jsobject,jdk.unsupported,jdk.xml.dom,org.jvnet.mimepull,org.jvnet.staxex
+com.sun.istack.runtime,com.sun.xml.bind,com.sun.xml.fastinfoset,com.sun.xml.streambuffer,com.sun.xml.txw2,com.sun.xml.ws.policy,java.activation,java.annotation,java.base,java.compiler,java.datatransfer,java.desktop,java.logging,java.management,java.management.rmi,java.naming,java.prefs,java.rmi,java.scripting,java.security.sasl,java.sql,java.xml,java.xml.bind,java.xml.soap,java.xml.ws,javax.jws,jdk.httpserver,jdk.jsobject,jdk.unsupported,jdk.xml.dom,org.jvnet.mimepull,org.jvnet.staxex
\ No newline at end of file
index 1474fb1..9f79d2d 100755 (executable)
@@ -10,7 +10,7 @@
 # creates file modules.new which is comma-separated list of modules needed, can be used like this in jlink argument
 # and a java 11 JRE in j11jre/jre-new
 
-( for x in lib/*.jar j11lib/*.jar dist/jalview.jar; do echo $x >&2; jdeps --list-deps --module-path j11lib $x | grep -v Warning: | grep -v "JDK removed" | sed -e 's/^ *//;s/\/.*//;s/$/,/;'; done ) | sort -u | perl -p -e 'chomp;' | sed -e 's/,$//;' > modules.new
+( for x in lib/*.jar j11lib/*.jar dist/jalview.jar; do echo $x >&2; jdeps --list-deps --module-path j11lib $x | grep -v Warning: | grep -v "JDK removed" | sed -e 's/^ *//;s/\/.*//;s/$/,/;'; done ) | sort -u | perl -p -e 'chomp;' | perl -p -e 's/,$//;chomp;' > modules.new
 
 if [ x$JAVA_HOME != x ]; then
   jlink --no-header-files --no-man-pages --strip-debug --module-path "$JAVA_HOME/jmods:j11lib" --add-modules `cat modules.new` --compress=2 --output j11jre/jre-new
@@ -20,4 +20,4 @@ fi
 
 
 # or if you're in a hurry for a one-liner...
-#jlink --no-header-files --no-man-pages --strip-debug --module-path "$JAVA_HOME/jmods:j11lib" --add-modules ` ( for x in lib/*.jar j11lib/*.jar dist/jalview.jar; do echo $x >&2; jdeps --list-deps --module-path j11mod $x | grep -v "Warning:" | grep -v "JDK removed" | sed -e 's/^ *//;s/\/.*//;s/$/,/;'; done ) | sort -u | perl -p -e 'chomp;' | sed -e 's/,$//;' ` --compress=2 --output j11jre/jre-new
+#jlink --no-header-files --no-man-pages --strip-debug --module-path "$JAVA_HOME/jmods:j11lib" --add-modules ` ( for x in lib/*.jar j11lib/*.jar dist/jalview.jar; do echo $x >&2; jdeps --list-deps --module-path j11mod $x | grep -v "Warning:" | grep -v "JDK removed" | sed -e 's/^ *//;s/\/.*//;s/$/,/;'; done ) | sort -u | perl -p -e 'chomp;' | perl -p -e 's/,$//;chomp;' ` --compress=2 --output j11jre/jre-new