<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" />
+ <echo message="Useful -D flags: -Ddeprecation=true to add -Xlint:deprecation to the java compiler" />
</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="ant.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 -->
<!-- Anne's version needs 1.7 - should rebuild VARNA to java 1.6 for release -->
<property name="j2sev" value="1.7+" />
<!-- Java Compilation settings - source and target javac version -->
- <property name="javac.source" value="1.8" />
- <property name="javac.target" value="1.8" />
+ <property name="javac.source" value="11" if:set="java11" />
+ <property name="javac.target" value="11" if:set="java11" />
+ <property name="javac.source" value="1.8" unless:set="java11" />
+ <property name="javac.target" value="1.8" unless:set="java11" />
+ <echo message="javac.source is ${javac.source}"/>
+ <echo message="javac.target is ${javac.target}"/>
<!-- Permissions for running Java applets and applications. -->
<!-- Defaults are those suitable for deploying jalview webstart www.jalview.org -->
<!-- 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" />
<include name="${jmolJar}" />
<include name="${varnaJar}" />
</fileset>
+ <pathelement location="${clover.jar}" if:set="clover.jar"/>
</path>
<path id="test.classpath">
<pathelement path="${outputDir}" />
<target name="build" depends="prepare">
<!-- not efficient yet. -->
- <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="build.classpath">
+ <!-- Echo the build.classpath
+ <pathconvert property="echoClasspath" refid="build.classpath" />
+ <echo message="build.classpath is '${echoClasspath}'" />
+ -->
+ <echo message="javac.target is '${javac.target}'" />
+ <echo message="adding -Xlint:deprecation to javac" if:set="deprecation"/>
+ <javac includeantruntime="false" source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="build.classpath">
+ <compilerarg value="-Xlint:deprecation" if:set="deprecation" />
<exclude name="jalview/*applet*" />
<exclude name="jalview/appletgui/**" />
<exclude name="com/stevesoft/**" />
<taskdef resource="testngtasks" classpath="utils/testnglibs/testng.jar" />
<target name="testng" depends="buildTests">
+ <loadfile property="j11modules" srcFile="modules">
+ <filterchain>
+ <striplinebreaks/>
+ </filterchain>
+ </loadfile>
+ <echo message="j11libDir is '${j11libDir}'" />
+ <echo message="j11modules is '${j11modules}'" />
<testng outputDir="${reportDir}" haltOnFailure="false" groups="${testng-groups}" mode="testng"
verbose="2">
<classpath>
<pathelement location="${clover.jar}" if:set="clover.jar"/>
<path refid="test.classpath" />
</classpath>
+ <!--
+ <jvmarg value="DASH_DASH_module-path=${j11libDir}:${java.home}/jmods" if:set="java11"/>
+ -->
+ <jvmarg value="--module-path=${j11libDir}" 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" />
</testng>
</target>
+ <target name="testngclass" depends="buildTests">
+ <condition property="propsSpecified">
+ <isset property="class.name" />
+ </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}" />
+ <pathelement location="${clover.jar}" if:set="clover.jar"/>
+ <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}" />
+ </testng>
+ </target>
+
<target name="buildindices" depends="init, prepare" unless="help.uptodate">
<replace value="${JALVIEW_VERSION}">
<replacetoken><![CDATA[$$Version-Rel$$]]></replacetoken>