* You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
-->
-<project name="jalviewX" default="usage" basedir=".">
+<project name="jalviewX" default="usage" basedir="."
+ xmlns:if="ant:if"
+ xmlns:unless="ant:unless">
+ <taskdef classpath="${clover.jar}" resource="cloverlib.xml" if:set="clover.jar"/>
+ <clover-env if:set="clover.jar"/>
+
<target name="help" depends="usage" />
<target name="usage" depends="init">
<echo message="~~~Jalview Ant build.xml Usage~~~~" />
<echo message="testng - run jalview's tests via testNG. Default group is '${testng-groups}'" />
<echo message=" you can specify particular test groups as a list via -Dtestng-groups=" />
<echo message="See docs/building.html and the comments in build file for other targets." />
- <echo message="note: compile and makeApplet require the property java118.home to be set to point to a java 1.1.8 jdk." />
+ <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>
<!-- default TestNG groups to run -->
<property name="testng-groups" value="Functional" />
+ <!-- Java 9 JVM args -->
+ <condition property="java9">
+ <equals arg1="${ant.java.version}" arg2="9"/>
+ </condition>
<!-- 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.7" />
- <property name="javac.target" value="1.7" />
+ <property name="javac.source" value="1.8" />
+ <property name="javac.target" value="1.8" />
<!-- Permissions for running Java applets and applications. -->
<!-- Defaults are those suitable for deploying jalview webstart www.jalview.org -->
<property name="docDir" value="doc" />
<property name="sourceDir" value="src" />
<property name="schemaDir" value="schemas" />
- <property name="outputDir" value="classes" />
+ <property name="outputDir" value="classes" unless:set="clover.jar"/>
+ <property name="outputDir" value="cloverclasses" if:set="clover.jar"/>
<property name="packageDir" value="dist" />
<property name="outputJar" value="jalview.jar" />
<!-- Jalview Applet JMol Jar Dependency -->
</path>
<property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
<!-- The Location of the java 1.1.8 jdk -->
- <!--<property name="java118.home" value="C:\Sun\jdk1.1.8" /> -->
<property name="java118.home" value="${java.home}" />
- <!-- <property name="applet.jre.tools" value="${java118.home}/lib/classes.zip" />
- -->
<!-- jre for 1.4 version -->
- <property name="applet.jre.tools" value="${java.home}/lib/rt.jar" />
+ <property name="applet.jre.tools" value="${java118.home}/lib/rt.jar" />
<!-- the classpath for building the 1.1 applet -->
<path id="jalviewlite.deps">
<fileset dir="${java118.home}">
- <include name="lib/classes.zip" />
+ <include name="lib/rt.jar" />
</fileset>
<fileset dir="${java.home}/lib">
<include name="plugin.jar" />
verbose="2">
<classpath>
<pathelement location="${testOutputDir}" />
+ <pathelement location="${clover.jar}" if:set="clover.jar"/>
<path refid="test.classpath" />
</classpath>
+ <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="buildindices" depends="init, prepare" unless="help.uptodate">
+ <replace value="${JALVIEW_VERSION}">
+ <replacetoken><![CDATA[$$Version-Rel$$]]></replacetoken>
+ <fileset dir="${outputDir}/${helpDir}">
+ <include name="help.jhm" />
+ </fileset>
+ </replace>
+
<java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
<arg line="html" />
</java>
</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>
<association mime-type="application-x/ext-file" extensions="jar"/>-->
</target>
- <target name="-jarsignwithtsa" depends="makedist,preparejnlp" if="timestamp">
+ <target name="-jarsignwithtsa" depends="makedist,preparejnlp" if="timestamp" unless="nosign">
<signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="${jalview.keyalg}" digestalg="${jalview.keydig}"
tsaproxyhost="${proxyHost}" tsaproxyport="${proxyPort}" tsaurl="${jalview.tsaurl}">
<fileset dir="${packageDir}">
</fileset>
</signjar>
</target>
- <target name="-jarsignnotsa" depends="makedist,preparejnlp" unless="timestamp">
+ <target name="-jarsignnotsa" depends="makedist,preparejnlp" if:blank="timestamp" unless="nosign">
<signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="${jalview.keyalg}" digestalg="${jalview.keydig}">
<fileset dir="${packageDir}">
<include name="*.jar" />
<offline_allowed />
</information>
<resources>
- <j2se version="9+" />
- <j2se version="7,8" initial-heap-size="${inih}" max-heap-size="${maxh}" />
+ <j2se version="1.8+" />
<jar main="true" href="jalview.jar"/>
<fileset dir="${packageDir}">
<exclude name="jalview.jar" />
<include name="*.jar" />
<include name="*_*.jar" />
- <exclude name="*jnilib.jar" />
+ <exclude name="*quaqua*.jar" />
</fileset>
<property name="jalview.version" value="${JALVIEW_VERSION}" />
</resources>
<resources os="Mac OS X">
<fileset dir="${packageDir}">
- <include name="*quaqua*.jnilib.jar" />
+ <include name="quaqua-filechooser-only-8.0.jar"/>
+ <include name="*quaqua64*.jnilib.jar" />
</fileset>
</resources>
</presetdef>
<jnlpf toFile="${jnlpFile}" />
- <!-- add a j2se entry for java 9 -->
- <replace file="${jnlpFile}" value="j2se version="9+" initial-heap-size="${inih}" max-heap-size="${maxh}" java-vm-args="--add-modules=java.se.ee"">
- <replacetoken>j2se version="9+"</replacetoken>
-
- </replace>
+ <!-- add the add-modules j2se attribute for java 9 -->
+ <replace file="${jnlpFile}" value="j2se version="1.8+" initial-heap-size="${inih}" max-heap-size="${maxh}" java-vm-args="--add-modules=java.se.ee --illegal-access=warn"">
+ <replacetoken>j2se version="1.8+"</replacetoken>
+ </replace>
</target>
<target name="-dofakejnlpfileassoc" depends="-generatejnlpf" if="nojnlpfileassocs">
</target>
<target name="makedist" depends="build, buildPropertiesFile, linkcheck, buildindices">
+ <fail if="clover.jar">
+ Ignoring request to build jalview distribution with clover-instrumented classes
+ </fail>
<!-- make the package jar if not already existing -->
<mkdir dir="${packageDir}" />
<!-- clean dir if it already existed -->
</target>
<target name="packageApplet" depends="compileApplet, buildPropertiesFile">
- <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif" />
<copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
<copy todir="${outputDir}/lang">
<fileset dir="${resourceDir}/lang">
<include name="MCview/**" />
<include name="jalview/**" />
<include name=".build_properties" />
- <include name="images/idwidth.gif" />
<include name="images/link.gif" />
<include name="lang/**" />
</fileset>
<include name="plugin.jar" />
</fileset>
</path>
- <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
+ <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard_5.3.3.jar" />
<proguard verbose="true" >
<injar file="in.jar" />
<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>