JAL-3130 Some re-reorganisation for build process
[jalview.git] / build.xml
index d613a03..8eeaf7f 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -43,6 +43,7 @@
     <echo message="See docs/building.html and the comments in build file for other targets." />
     <echo message="note: compile and makeApplet optionally compile/obfuscate applet against a different Java version by specifying -Djava118.home=PathtoJDK/lib which is the lib directory in the JDK install that contains rt.jar " />
     <echo message="Useful -D flags: -Ddonotobfuscate will prevent applet obfuscation" />
+    <echo message="Useful -D flags: -Dclover.jar to specify path to openclover for testng coverage report" />
   </target>
 
 
     <condition property="java9">
       <equals arg1="${ant.java.version}" arg2="9"/>
     </condition>
+    <!-- Java 10 JVM args -->
+    <condition property="java10">
+      <equals arg1="${ant.java.version}" arg2="10"/>
+    </condition>
+    <!-- Java 11 JVM args -->
+    <condition property="java11">
+      <equals arg1="${ant.java.version}" arg2="11"/>
+    </condition>
+    <echo message="java version is ${ant.java.version}"/>
 
     <!-- Don't change anything below here unless you know what you are doing! -->
     <!-- Url path for WebStart in JNLP file -->
 
     <!-- build directory configuration -->
     <property name="libDir" value="lib" />
+    <property name="j11libDir" value="j11lib" />
     <property name="resourceDir" value="resources" />
     <property name="helpDir" value="help" />
     <property name="docDir" value="doc" />
         <include name="*.jar" />
         <include name="**/*.jar" />
       </fileset>
+      <fileset dir="${j11libDir}">
+        <include name="*.jar" />
+        <include name="**/*.jar" />
+      </fileset>
       <fileset dir="${libDir}">
         <include name="*.jar" />
         <include name="**/*.jar" />
         <pathelement location="${clover.jar}" if:set="clover.jar"/>
         <path refid="test.classpath" />
       </classpath>
+      <jvmarg value="--module-path=${j11libDir}" 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" />
     </jar>
 
     <antcall target="writejnlpf">
-      <param name="jnlpFile" value="${packageDir}/jalview.jnlp" />
+      <param name="jnlpFile" value="${packageDir}/jalview_256M.jnlp" />
       <param name="inih" value="10M" />
       <param name="maxh" value="256M" />
     </antcall>
+    <antcall target="writejnlpf">
+      <param name="jnlpFile" value="${packageDir}/jalview.jnlp" />
+      <param name="inih" value="800M" />
+      <param name="maxh" value="1024M" />
+    </antcall>
 
     <antcall target="writejnlpf">
       <param name="jnlpFile" value="${packageDir}/jalview_1G.jnlp" />
 
     <antcall target="writejnlpf">
       <param name="jnlpFile" value="${packageDir}/jalview_2G.jnlp" />
-      <param name="inih" value="256M" />
+      <param name="inih" value="800M" />
       <param name="maxh" value="1024M" />
     </antcall>
 
     <!-- add the add-modules j2se attribute for java 9 -->
     <replace file="${jnlpFile}" value="j2se version=&quot;1.8+&quot; initial-heap-size=&quot;${inih}&quot; max-heap-size=&quot;${maxh}&quot; java-vm-args=&quot;--add-modules=java.se.ee --illegal-access=warn&quot;">
           <replacetoken>j2se version="1.8+"</replacetoken>
-           
-        </replace>
+    </replace>
   </target>
 
   <target name="-dofakejnlpfileassoc" depends="-generatejnlpf" if="nojnlpfileassocs">
   <delete file="in.jar" />
 </target>
 
-<target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
-  <taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask" classpathref="build.classpath" />
-  <delete>
-    <fileset dir="${sourceDir}/jalview/schemabinding/version2">
-      <include name="*.java" />
-      <include name="descriptors/*.java" />
-    </fileset>
-  </delete>
-  <castor-srcgen file="${schemaDir}/vamsas.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
-  <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
-  <castor-srcgen file="${schemaDir}/JalviewWsParamSet.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
-  <castor-srcgen file="${schemaDir}/jalview.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
-  <!-- 
-               now build the jalview.binding package with the old schema set
-               -->
-  <delete>
-    <fileset dir="${sourceDir}/jalview/binding/">
-      <include name="**" />
-    </fileset>
-  </delete>
-  <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
-  <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
-  <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
-</target>
 <target name="sourcedist" description="create jalview source distribution" depends="init">
   <delete file="${source.dist.name}" />
   <!-- temporary copy of source to update timestamps -->
     <include name="ap_${jsonSimple}" />
   </fileset>
 </target>
-<target name="-signappletnotsa" unless="timestamp" depends="-signapplet">
+<target name="-signappletnotsa" if:blank="timestamp" depends="-signapplet" unless="nosign">
   <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
     <fileset refid="signappletjarset" />
   </signjar>
 </target>
 
-<target name="-signapplettsa" if="timestamp" depends="-signapplet">
+<target name="-signapplettsa" if="timestamp" depends="-signapplet" unless="nosign">
   <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" tsaproxyhost="${proxyHost}" tsaproxyport="${proxyPort}" tsaurl="${jalview.tsaurl}">
     <fileset refid="signappletjarset" />
   </signjar>