3 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
4 * Copyright (C) $$Year-Rel$$ The Jalview Authors
6 * This file is part of Jalview.
8 * Jalview is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
20 <project name="jalviewX" default="usage" basedir="."
22 xmlns:unless="ant:unless">
23 <taskdef classpath="${clover.jar}" resource="cloverlib.xml" if:set="clover.jar"/>
24 <clover-env if:set="clover.jar"/>
26 <target name="help" depends="usage" />
27 <target name="usage" depends="init">
28 <echo message="~~~Jalview Ant build.xml Usage~~~~" />
29 <echo message="Targets include:" />
30 <echo message="usage - default target, displays this message" />
31 <echo message="buildindices - generates JavaHelpSearch from the help files" />
32 <echo message="build - compiles all necessary files for Application" />
33 <echo message="makedist - compiles and places all necessary jar files into directory dist" />
34 <echo message="makefulldist - signs all jar files and builds jnlp file for full distribution" />
35 <echo message=" this needs a keystore and key."/>
36 <echo message=" Add -Dtimestamp to timestamp signed jars"/>
37 <echo message=" -Djalview.keyalg and -Djalview.keydig are SHA1/SHA1withRSA"/>
38 <echo message=" See docs/building.html for more information." />
39 <echo message="compileApplet - compiles all necessary files for Applet" />
40 <echo message="makeApplet - compiles, then packages and obfuscates the Applet" />
41 <echo message="testng - run jalview's tests via testNG. Default group is '${testng-groups}'" />
42 <echo message=" you can specify particular test groups as a list via -Dtestng-groups=" />
43 <echo message="See docs/building.html and the comments in build file for other targets." />
44 <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 " />
45 <echo message="Useful -D flags: -Ddonotobfuscate will prevent applet obfuscation" />
46 <echo message="Useful -D flags: -Dclover.jar to specify path to openclover for testng coverage report" />
50 <!-- utils is a class path to additional utilities needed for
51 building docs, jars and webstart stuff -->
53 Userdefined build property defaults
55 wsdl.server list (plus namespace mapping info ???) - also want
56 ... to make this a dynamically generatable property
58 Build location - provide a temporary root for speed
59 jarsigner keystore and info
60 Jakarta and axis classpath ?
61 Default argument for starting Jalview (if it exists).
66 <path id="axis.classpath">
68 <fileset dir="/usr/local/axis/lib">
69 <include name="**/*.jar" />
71 <fileset dir="/usr/local/jakarta-tomcat-5/webapps/axis/WEB-INF/lib">
72 <include name="**/*.jar"/>
73 <include name="*.jar"/>
77 <!-- Jalview Version String displayed by application on startup and used to check for updates -->
78 <property name="JALVIEW_VERSION" value="DEVELOPMENT" />
80 <property name="INSTALLATION" value="Source" />
82 <!-- 2.4 (VAMSAS)" -->
83 <!-- Include debugging information in javac true or false -->
84 <property name="javac.debug" value="true" />
86 <!-- JarSigner Key Store for Webstart Distribution -->
87 <property name="jalview.keystore" value="./keys/.keystore" />
88 <!-- Keystore Password -->
89 <property name="jalview.keystore.pass" value="alignmentisfun" />
91 <property name="jalview.key" value="jalview" />
93 <property name="jalview.key.pass" value="alignmentisfun" />
94 <!-- time stamp server URL -->
95 <property name="jalview.tsaurl" value="" />
96 <!-- locally valid proxy for signing with external time server -->
97 <property name="proxyPort" value="80"/>
98 <property name="proxyHost" value="sqid"/>
99 <!-- key sign/digest algorithms -->
100 <property name="jalview.keyalg" value="SHA1withRSA" description="key algorithm for signing"/>
101 <property name="jalview.keydig" value="SHA1" description="algorithm for jar digest"/>
103 <!-- default TestNG groups to run -->
104 <property name="testng-groups" value="Functional" />
105 <!-- default verbosity for TestNG -->
106 <property name="testng-verbosity" value="2"/>
107 <!-- Java 9 JVM args -->
108 <condition property="java9">
109 <equals arg1="${ant.java.version}" arg2="9"/>
112 <!-- Don't change anything below here unless you know what you are doing! -->
113 <!-- Url path for WebStart in JNLP file -->
114 <property name="WebStartLocation" value="http://www.jalview.org/webstart" />
115 <!-- Webstart Image - looked for in resources/images -->
116 <property name="WebStartImage" value="JalviewLogo_big.png" />
117 <!-- J2SE version needed for webstart launch -->
118 <!-- Anne's version needs 1.7 - should rebuild VARNA to java 1.6 for release -->
119 <property name="j2sev" value="1.7+" />
120 <!-- Java Compilation settings - source and target javac version -->
121 <property name="javac.source" value="1.8" />
122 <property name="javac.target" value="1.8" />
124 <!-- Permissions for running Java applets and applications. -->
125 <!-- Defaults are those suitable for deploying jalview webstart www.jalview.org -->
126 <property name="application.codebase" value="*.jalview.org" />
127 <!-- and allowing the applet to be deployed from any URL -->
128 <!-- note - if you want to make sure LiveConnect works without any warnings, please rebuild and sign your applet jar with your own domain included in the codebase/allowable-codebase properties -->
129 <property name="applet.codebase" value="*.jalview.org *.dundee.ac.uk *" />
130 <property name="applet.caller-codebase" value="${applet.codebase}" />
132 <!-- build directory configuration -->
133 <property name="libDir" value="lib" />
134 <property name="resourceDir" value="resources" />
135 <property name="helpDir" value="help" />
136 <property name="docDir" value="doc" />
137 <property name="sourceDir" value="src" />
138 <property name="schemaDir" value="schemas" />
139 <property name="outputDir" value="classes" unless:set="clover.jar"/>
140 <property name="outputDir" value="cloverclasses" if:set="clover.jar"/>
141 <property name="packageDir" value="dist" />
142 <property name="outputJar" value="jalview.jar" />
143 <!-- Jalview Applet JMol Jar Dependency -->
144 <property name="jmolJar" value="JmolApplet-14.6.4_2016.10.26.jar" />
145 <property name="varnaJar" value="VARNAv3-93.jar" />
146 <property name="jsoup" value="jsoup-1.8.1.jar" />
147 <property name="jsonSimple" value="json_simple-1.1.jar" />
148 <property name="javaJson" value="java-json.jar" />
149 <property name="jalviewLiteJar" value="jalviewApplet.jar" />
150 <property name="reportDir" value="test-reports" />
151 <property name="testDir" value="test" />
152 <property name="testOutputDir" value="tests" />
153 <property name="cloverOutputDir" value="clover" if:set="clover.jar" />
154 <!-- switch to indicate if we should obfuscate jalviewLite -->
155 <!-- <property name="donotobfuscate" value="true"/> -->
156 <!-- switch to exclude associations from generated jnlp files -->
157 <!-- <property name="nojnlpfileassocs" value="true"/> -->
159 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
160 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
161 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
162 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
163 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
164 <property name="WSInterf" value="MsaWS" />
165 <property name="wsdl.Namespace" value="vamsas" />
166 <property name="wsdl.ClientNS" value="ext.vamsas" />
167 <!-- the class path for building the application -->
168 <path id="build.classpath">
169 <fileset dir="utils">
170 <include name="*.jar" />
171 <include name="**/*.jar" />
173 <fileset dir="${libDir}">
174 <include name="*.jar" />
175 <include name="**/*.jar" />
177 <fileset dir="${java.home}/lib">
178 <include name="plugin.jar" />
180 <fileset dir="appletlib">
181 <!-- the JmolApplet includes the JmolApplet console and the application javac seems to always try and build all packages
183 <include name="${jmolJar}" />
184 <include name="${varnaJar}" />
187 <path id="test.classpath">
188 <pathelement path="${outputDir}" />
189 <path refid="build.classpath" />
191 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
192 <!-- The Location of the java 1.1.8 jdk -->
193 <property name="java118.home" value="${java.home}" />
194 <!-- jre for 1.4 version -->
195 <property name="applet.jre.tools" value="${java118.home}/lib/rt.jar" />
197 <!-- the classpath for building the 1.1 applet -->
198 <path id="jalviewlite.deps">
199 <fileset dir="${java118.home}">
200 <include name="lib/rt.jar" />
202 <fileset dir="${java.home}/lib">
203 <include name="plugin.jar" />
205 <pathelement location="appletlib/${jmolJar}" />
206 <pathelement location="lib/${varnaJar}" />
207 <pathelement location="appletlib/${jsoup}" />
208 <pathelement location="appletlib/${jsonSimple}" />
209 <pathelement location="appletlib/${javaJson}" />
212 <!-- default location for outputting javadoc -->
213 <property name="javadocDir" value="${packageDir}/javadoc" />
217 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties" />
218 <target name="buildPropertiesFile" depends="init">
219 <tstamp prefix="build">
220 <format property="date" pattern="dd MMMM yyyy" />
222 <exec executable="/usr/bin/git" outputproperty="git.commit" failifexecutionfails="false">
223 <arg value="rev-parse" />
224 <arg value="--short" />
227 <exec executable="/usr/bin/git" outputproperty="git.branch" failifexecutionfails="false">
228 <arg value="rev-parse" />
229 <arg value="--abbrev-ref" />
232 <properties file="${outputDir}/.build_properties">
234 ---Jalview Build Details---
236 <property name="VERSION" value="${JALVIEW_VERSION}" />
237 <property name="INSTALLATION" value="${INSTALLATION} git-commit:${git.commit} [${git.branch}]" />
238 <property name="BUILD_DATE" value="${build.date}" />
243 <target name="clean" depends="init">
244 <!-- not efficient yet. -->
245 <delete dir="${outputDir}" includes="*,**/*" />
248 <target name="distclean" depends="init, clean">
250 <echo message="REMOVING ALL BACKUP/AUTOSAVES!" />
253 <include name="${outputJar}" />
254 <include name="#*#" />
255 <include name="#*.*#" />
256 <include name="**/#*#" />
257 <include name="**/#*.*#" />
258 <include name="*~" />
259 <include name="*.*~" />
260 <include name="**/*~" />
261 <include name="**/*.*~" />
266 <target name="prepare" depends="init">
267 <mkdir dir="${outputDir}" />
268 <copy todir="${outputDir}">
270 <include name="${docDir}/**/*.*" />
271 <include name="${helpDir}/**/*.*" />
272 <include name="${libDir}/*.jar" />
274 <fileset dir="${resourceDir}">
275 <include name="**/*.*" />
278 <mkdir dir="${cloverOutputDir}" if:set="clover.jar"/>
281 <target name="build" depends="prepare">
282 <!-- not efficient yet. -->
283 <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="build.classpath">
284 <exclude name="jalview/*applet*" />
285 <exclude name="jalview/appletgui/**" />
286 <exclude name="com/stevesoft/**" />
291 <target name="testclean" depends="init">
292 <delete dir="${testOutputDir}" includes="*,**/*" />
295 <target name="prepareTests" depends="init,testclean">
296 <mkdir dir="${testOutputDir}" />
299 <target name="buildTests" depends="build,buildindices,prepareTests">
300 <javac source="${javac.source}" target="${javac.target}" srcdir="${testDir}" destdir="${testOutputDir}" debug="${javac.debug}" classpathref="test.classpath" includeantruntime="false">
304 <taskdef resource="testngtasks" classpath="utils/testnglibs/testng.jar" />
306 <target name="testng" depends="buildTests">
307 <testng workingDir="c:/users/hansonr/git/jalview1" outputDir="${reportDir}" haltOnFailure="true" groups="${testng-groups}" mode="testng"
308 verbose="${testng-verbosity}">
310 <pathelement location="${testOutputDir}" />
311 <pathelement location="${clover.jar}" if:set="clover.jar"/>
312 <path refid="test.classpath" />
314 <jvmarg value="--add-modules=java.se.ee" if:set="java9"/>
315 <jvmarg value="--illegal-access=warn" if:set="java9"/>
316 <classfileset dir="${testOutputDir}" includes="**/*.class" />
320 <target name="buildindices" depends="init, prepare" unless="help.uptodate">
321 <replace value="${JALVIEW_VERSION}">
323 <![CDATA[$$Version-Rel$$]]>
325 <fileset dir="${outputDir}/${helpDir}">
326 <include name="help.jhm" />
330 <java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
335 <target name="preparejnlp" depends="makedist">
336 <copy todir="${packageDir}">
337 <fileset dir="${resourceDir}/images">
338 <include name="${WebStartImage}" />
342 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties" />
344 <!-- create a dummy jar which will eventually contain the jnlp template -->
345 <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
346 <fileset dir="${packageDir}">
347 <include name="jalview.jar" />
351 <mkdir dir="${packageDir}/JNLP-INF" />
352 <antcall target="writejnlpf">
353 <param name="jnlpFile" value="${packageDir}/JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
354 <param name="inih" value="*" />
355 <param name="maxh" value="*" />
358 <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
359 <fileset dir="${packageDir}">
360 <include name="JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
364 <antcall target="writejnlpf">
365 <param name="jnlpFile" value="${packageDir}/jalview_256M.jnlp" />
366 <param name="inih" value="10M" />
367 <param name="maxh" value="256M" />
369 <antcall target="writejnlpf">
370 <param name="jnlpFile" value="${packageDir}/jalview.jnlp" />
371 <param name="inih" value="800M" />
372 <param name="maxh" value="1024M" />
375 <antcall target="writejnlpf">
376 <param name="jnlpFile" value="${packageDir}/jalview_1G.jnlp" />
377 <param name="inih" value="128M" />
378 <param name="maxh" value="512M" />
381 <antcall target="writejnlpf">
382 <param name="jnlpFile" value="${packageDir}/jalview_2G.jnlp" />
383 <param name="inih" value="800M" />
384 <param name="maxh" value="1024M" />
387 <!-- finally, need to postprocess to add in associations at end of 'information' element
389 <xslt in="${packageDir}/jalview_noa_1G.jnlp" out="${packageDir}/jalview_1G.jnlp">
396 <association mime-type="application-x/ext-file" extensions="fa"/>
397 <association mime-type="application-x/ext-file" extensions="fasta"/>
398 <association mime-type="application-x/ext-file" extensions="mfa"/>
399 <association mime-type="application-x/ext-file" extensions="fastq"/>
400 <association mime-type="application-x/ext-file" extensions="blc"/>
401 <association mime-type="application-x/ext-file" extensions="msf"/>
402 <association mime-type="application-x/ext-file" extensions="pfam"/>
403 <association mime-type="application-x/ext-file" extensions="aln"/>
404 <association mime-type="application-x/ext-file" extensions="pir"/>
405 <association mime-type="application-x/ext-file" extensions="amsa"/>
406 <association mime-type="application-x/ext-file" extensions="stk"/>
407 <association mime-type="application-x/ext-file" extensions="jar"/>-->
410 <target name="-jarsignwithtsa" depends="makedist,preparejnlp" if="timestamp" unless="nosign">
411 <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}"
412 tsaproxyhost="${proxyHost}" tsaproxyport="${proxyPort}" tsaurl="${jalview.tsaurl}">
413 <fileset dir="${packageDir}">
414 <include name="*.jar" />
418 <target name="-jarsignnotsa" depends="makedist,preparejnlp" if:blank="timestamp" unless="nosign">
419 <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}">
420 <fileset dir="${packageDir}">
421 <include name="*.jar" />
426 <target name="makefulldist" depends="makedist,preparejnlp,-jarsignwithtsa,-jarsignnotsa">
427 <!-- and sign the jars -->
428 <!-- the default keystore details might need to be edited here -->
431 <target name="runenv" depends="init">
432 <path id="run.classpath">
433 <pathelement location="${outputDir}" />
434 <fileset dir="${outputDir}">
435 <include name="${libDir}/*.jar" />
438 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath" />
440 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
444 <target name="-generatejnlpf">
445 <presetdef name="jnlpf">
446 <jnlp codebase="${WebStartLocation}">
448 <title>Jalview</title>
449 <vendor>The Barton Group</vendor>
450 <homepage href="http://www.jalview.org" />
451 <description>Jalview Multiple Alignment Editor</description>
452 <description kind="short">Jalview</description>
453 <icon href="${WebStartImage}" />
457 <j2se version="1.8+" />
458 <jar main="true" href="jalview.jar"/>
459 <fileset dir="${packageDir}">
460 <exclude name="jalview.jar" />
461 <include name="*.jar" />
462 <include name="*_*.jar" />
463 <exclude name="*quaqua*.jar" />
465 <property name="jalview.version" value="${JALVIEW_VERSION}" />
467 <resources os="Mac OS X">
468 <fileset dir="${packageDir}">
469 <include name="quaqua-filechooser-only-8.0.jar"/>
470 <include name="*quaqua64*.jnilib.jar" />
474 <application_desc main_class="jalview.bin.Jalview">
482 <jnlpf toFile="${jnlpFile}" />
483 <!-- add the add-modules j2se attribute for java 9 -->
484 <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"">
485 <replacetoken>j2se version="1.8+"</replacetoken>
489 <target name="-dofakejnlpfileassoc" depends="-generatejnlpf" if="nojnlpfileassocs">
490 <echo message="Not adding JNLP File Associations" />
493 <target name="-dojnlpfileassoc" depends="-generatejnlpf" unless="nojnlpfileassocs">
494 <replace file="${jnlpFile}">
496 <![CDATA[</information>]]></replacetoken>
499 <association mime-type="application-x/ext-file" extensions="fa" />
500 <association mime-type="application-x/ext-file" extensions="fasta" />
501 <association mime-type="application-x/ext-file" extensions="mfa" />
502 <association mime-type="application-x/ext-file" extensions="fastq" />
503 <association mime-type="application-x/ext-file" extensions="blc" />
504 <association mime-type="application-x/ext-file" extensions="msf" />
505 <association mime-type="application-x/ext-file" extensions="pfam" />
506 <association mime-type="application-x/ext-file" extensions="aln"/>
507 <association mime-type="application-x/ext-file" extensions="pir"/>
508 <association mime-type="application-x/ext-file" extensions="amsa"/>
509 <association mime-type="application-x/ext-file" extensions="stk"/>
510 <association mime-type="application-x/ext-file" extensions="jvp"/>
511 </information>]]></replacevalue>
513 <echo message="Added file associations to JNLP file" />
515 <target name="writejnlpf" depends="-dojnlpfileassoc,-dofakejnlpfileassoc">
518 <target name="buildextclients" depends="init">
519 <input message="Building external client source from WSDLs - Do you really want to do this ? (Yy/Nn)" validargs="Y,y,n,N" defaultvalue="N" addproperty="doextbuild.response" />
520 <condition property="dontextbuild">
521 <equals arg1="n" arg2="${doextbuild.response}" />
523 <condition property="dontextbuild">
524 <equals arg1="N" arg2="${doextbuild.response}" />
526 <fail if="dontextbuild">
527 Build External Client Code process aborted by user. Jalview source is unchanged.
529 <!-- Currently, this doesn't happen automatically.
530 1. Run WSDL2Java as below, which generates an ext.vamsas +
531 vamsas.<datapackages> fileset.
532 2. refactor ext.vamsas.SpecificserviceWS* to
533 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
534 3. Update the jalview.ws.*WServices classes to reflect the
535 interface type, and all locations of this wsdl type that Jalview
539 <path id="axisbuild">
540 <path refid="build.classpath" />
542 <taskdef resource="axis-tasks.properties" classpathref="axisbuild" />
544 <fileset dir="${sourceDir}" id="client">
545 <include name="${wsdl.ClientNS}/*.*" />
549 <axis-wsdl2java output="${sourceDir}" verbose="true" url="${wsdl.MsaWS2}" serverside="false" deployscope="Request" debug="false" helpergen="true" all="true">
551 <mapping namespace="${wsdl.Namespace}" package="${wsdl.ClientNS}" />
552 <mapping namespace="http://dataTypes.vamsas" package="${wsdl.ClientNS}" />
557 <target name="makedist" depends="build, buildPropertiesFile, linkcheck, buildindices">
558 <fail if="clover.jar">
559 Ignoring request to build jalview distribution with clover-instrumented classes
561 <!-- make the package jar if not already existing -->
562 <mkdir dir="${packageDir}" />
563 <!-- clean dir if it already existed -->
565 <fileset dir="${packageDir}">
566 <include name="*.jar" />
569 <jar destfile="${packageDir}/${outputJar}" index="true">
571 <attribute name="Main-Class" value="jalview.bin.Jalview" />
572 <attribute name="Permissions" value="all-permissions" />
573 <attribute name="Application-Name" value="Jalview Desktop" />
574 <attribute name="Codebase" value="${application.codebase}" />
576 <fileset dir="${outputDir}/">
577 <exclude name="cache*/**" />
578 <exclude name="*.jar" />
579 <exclude name="*.jar.*" />
580 <exclude name="**/*.jar" />
581 <exclude name="**/*.jar.*" />
585 <copy toDir="${packageDir}" flatten="true">
586 <fileset dir="${outputDir}">
587 <include name="*.jar" />
588 <include name="**/*.jar" />
594 <!-- jalopy code reformatter -->
595 <target name="sourcescrub" depends="init,build">
596 <jalopy destdir="jsrc" classpathref="run.classpath" convention="jalview-jalopy.xml">
597 <fileset dir="${sourceDir}">
598 <include name="*.java" />
599 <include name="**/*.java" />
600 <include name="**/**/*.java" />
607 <!-- Compile, package and obfuscate Jalview Applet -->
608 <target name="makeApplet" depends="obfuscate" description="assemble the final jalviewLite applet jar with or without obfuscation" />
610 <target name="compileApplet" depends="init,clean">
611 <mkdir dir="${outputDir}" />
612 <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="jalviewlite.deps" includes="jalview/appletgui/**" excludes="ext/**,gui/**,jbgui/**,MCview/**,org/**,vamsas/**,jalview/ext/rbvi/**,jalview/ext/paradise/**,jalview/ext/ensembl/**,jalview/ext/so/**" />
615 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
616 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
617 <copy todir="${outputDir}/lang">
618 <fileset dir="${resourceDir}/lang">
619 <include name="**.*" />
622 <jar destfile="in.jar" index="true">
624 <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
625 <attribute name="Application-Name" value="JalviewLite" />
626 <attribute name="Codebase" value="${applet.codebase}" />
628 <fileset dir="${outputDir}">
629 <include name="com/**" />
630 <include name="MCview/**" />
631 <include name="jalview/**" />
632 <include name=".build_properties" />
633 <include name="images/link.gif" />
634 <include name="lang/**" />
638 <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally">
640 <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
641 <copy file="in.jar" tofile="${jalviewLiteJar}" overwrite="true" />
642 <delete file="in.jar" />
644 <target name="-obfuscatereally" unless="donotobfuscate">
646 <path id="obfuscateDeps.path">
647 <pathelement location="${applet.jre.tools}" />
648 <pathelement location="appletlib/${jmolJar}" />
649 <pathelement location="lib/${varnaJar}" />
650 <pathelement location="appletlib/${jsoup}" />
651 <pathelement location="appletlib/${jsonSimple}" />
652 <pathelement location="appletlib/${javaJson}" />
653 <fileset dir="${java.home}/lib">
654 <include name="plugin.jar" />
657 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard_5.3.3.jar" />
659 <proguard verbose="true" >
660 <injar file="in.jar" />
661 <outjar file="${jalviewLiteJar}" />
662 <libraryjar refid="obfuscateDeps.path" />
664 <keep access="public" type="class" name="jalview.bin.JalviewLite">
665 <field access="public" />
666 <method access="public" />
667 <constructor access="public" />
669 <keep access="public" type="class" name="jalview.appletgui.AlignFrame">
670 <field access="public" />
671 <method access="public" />
672 <constructor access="public" />
675 <keep name="jalview.json.binding**">
680 <keep access="public" type="class" name="MCview.PDBfile">
681 <field access="public" />
682 <method access="public" />
683 <constructor access="public" />
686 <keep access="public" type="class" name="jalview.ws.jws1.Annotate3D">
687 <field access="public" />
688 <method access="public" />
689 <constructor access="public" />
692 <keep access="public" type="class" name="jalview.ext.jmol.JmolParser">
693 <field access="public" />
694 <method access="public" />
695 <constructor access="public" />
699 <!-- -libraryjars "${obfuscateDeps}"
701 -outjars jalviewApplet.jar
702 -keep public class jalview.bin.JalviewLite
705 <delete file="in.jar" />
708 <target name="jaxb-bindings" depends="init" description="Generates JAXB bindings for supported Jalview XML models (needs xjc on the path)">
710 <fileset dir="${sourceDir}/jalview/xml/binding/jalview">
711 <include name="*.java" />
714 <exec executable="xjc">
715 <arg value="${schemaDir}/jalview.xsd"/>
717 <arg value="${sourceDir}"/>
719 <arg value="jalview.xml.binding.jalview"/>
722 <fileset dir="${sourceDir}/jalview/xml/binding/embl">
723 <include name="*.java" />
727 <exec executable="xjc">
728 <arg value="${schemaDir}/embl.xsd"/>
730 <arg value="${sourceDir}"/>
732 <arg value="${schemaDir}/embl_bindings.xml"/>
734 <arg value="jalview.xml.binding.embl"/>
738 <fileset dir="${sourceDir}/jalview/xml/binding/uniprot">
739 <include name="*.java" />
743 <exec executable="xjc">
744 <arg value="${schemaDir}/uniprot.xsd"/>
746 <arg value="${sourceDir}"/>
748 <arg value="jalview.xml.binding.uniprot"/>
752 <target name="sourcedist" description="create jalview source distribution" depends="init">
753 <delete file="${source.dist.name}" />
754 <!-- temporary copy of source to update timestamps -->
755 <copy todir="_sourcedist">
757 <exclude name=".*" />
758 <exclude name="**/.*" />
759 <exclude name="*.class" />
760 <exclude name="**/*.class" />
761 <include name="LICENSE" />
762 <include name="README" />
763 <include name="build.xml" />
764 <include name="jalview-jalopy.xml" />
765 <include name="JalviewApplet.jpx" />
766 <include name="JalviewX.jpx" />
767 <include name="nbbuild.xml" />
768 <include name="nbproject/genfiles.properties" />
769 <include name="nbproject/project.properties" />
770 <include name="nbproject/project.xml" />
771 <include name="${sourceDir}/*.java" />
772 <include name="${sourceDir}/**/*.java" />
773 <include name="${sourceDir}/**/*.cdr" />
774 <include name="${libDir}/**/*" />
775 <include name="${resourceDir}/**/*" />
776 <include name="${helpDir}/**/*" />
777 <include name="appletlib/${jmolJar}" />
778 <include name="appletlib/${jsonSimple}" />
779 <include name="appletlib/${javaJson}" />
780 <exclude name="**/*locales" />
781 <exclude name="*locales/**" />
782 <exclude name="utils/InstallAnywhere/**Build.iap_xml" />
783 <exclude name="utils/InstallAnywhere/**Build*/**" />
784 <exclude name="utils/InstallAnywhere/**Build*/**" />
785 <exclude name="utils/InstallAnywhere/.build*.*/**" />
786 <exclude name="utils/InstallAnywhere/**locale*" />
787 <exclude name="utils/InstallAnywhere/**locale*/**" />
788 <exclude name="utils/InstallAnywhere/**locale*/**" />
789 <include name="${schemaDir}/**/*" />
790 <include name="utils/**/*" />
791 <include name="${docDir}/**/*" />
792 <include name="examples/**/*" />
796 <tstamp prefix="build">
797 <format property="year" pattern="yyyy" />
799 <!-- each replacetoken CDATA body must be on one line -
800 otherwise the pattern doesn't match -->
801 <replace value="${JALVIEW_VERSION}">
803 <![CDATA[$$Version-Rel$$]]>
805 <fileset dir="_sourcedist">
806 <include name="**/*" />
809 <replace dir="_sourcedist" value="${build.year}">
811 <![CDATA[$$Year-Rel$$]]>
813 <fileset dir="_sourcedist">
814 <include name="**/*" />
818 <tar destfile="${source.dist.name}" compression="gzip">
819 <tarfileset dir="_sourcedist/" prefix="jalview" preserveLeadingSlashes="true">
823 <delete dir="_sourcedist" />
825 <target name="prepubapplet_1" depends="makeApplet">
826 <copy todir="${packageDir}/examples">
827 <fileset dir="examples">
828 <include name="**/*" />
829 <include name="javascript/*" />
830 <include name="jmol/*" />
833 <include name="${jalviewLiteJar}" />
835 <fileset dir="appletlib">
836 <include name="**/*" />
839 <jar update="true" index="true" jarfile="${packageDir}/examples/${jalviewLiteJar}" />
840 <jar update="true" index="true" jarfile="${packageDir}/examples/${javaJson}" />
841 <jar update="true" index="true" jarfile="${packageDir}/examples/${jsonSimple}" />
842 <jar update="true" index="true" jarfile="${packageDir}/examples/${jmolJar}">
844 <attribute name="Application-Name" value="Jmol (bundled with JalviewLite)" />
845 <!-- <attribute name="Permissions" value="sandbox" /> -->
846 <!--<attribute name="Trusted-Lib" value="true" /> -->
847 <attribute name="Codebase" value="${applet.codebase}" />
848 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
852 <presetdef name="ap_applet.jar">
853 <!-- build a signed applet with 'all-permissions' -
854 Needs 'param name="permissions' value="all-permissions"' in applet tag
855 JalviewLite+JmolApplet linked sequence/structure fails
856 Mixed code warnings are raised
858 <jar update="true" index="true">
860 <attribute name="Application-Name" value="JalviewLite" />
861 <attribute name="Permissions" value="all-permissions" />
862 <attribute name="Codebase" value="${applet.codebase}" />
863 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
864 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
868 <presetdef name="applet.jar">
869 <!-- build signed applet with sandbox permissions -
870 Needs 'param name="permissions' value="sandbox"' in applet tag
871 Preserves Pre-Java 1.7_u45 behavior once 'permissions' parameter added to applet tag
874 <jar update="true" index="true">
876 <attribute name="Application-Name" value="JalviewLite" />
877 <attribute name="Permissions" value="sandbox" />
878 <attribute name="Codebase" value="${applet.codebase}" />
879 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
880 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
884 <presetdef name="tl_applet.jar">
885 <!-- build signed applet with trusted library/trusted permissions -
886 Needs 'param name="permissions' value="all-permissions"' in applet tag
888 No mixed code warnings raised
889 Jmol/JalviewLite sequence/structure example doesn't link structures
890 Raises dialog asking user to allow page to control applet via LiveConnect javascript
894 <jar update="true" index="true">
896 <attribute name="Application-Name" value="JalviewLite" />
897 <attribute name="Permissions" value="all-permissions" />
898 <attribute name="Codebase" value="${applet.codebase}" />
899 <attribute name="Trusted-Only" value="true" />
900 <attribute name="Trusted-Library" value="true" />
904 <presetdef name="to_applet.jar">
905 <!-- not fully test variant (yet) -->
906 <jar update="true" index="true">
908 <attribute name="Application-Name" value="JalviewLite" />
909 <attribute name="Permissions" value="all-permissions" />
910 <attribute name="Codebase" value="${applet.codebase}" />
911 <attribute name="Trusted-Only" value="true" />
915 <!-- create differently privileged artefacts -->
916 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/u_${jalviewLiteJar}" />
917 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
918 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true" />
919 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true" />
920 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/ap_${jalviewLiteJar}" />
921 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/ap_${jmolJar}" />
922 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/ap_${javaJson}" />
923 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/ap_${jsonSimple}" />
924 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jalviewLiteJar}" />
925 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jmolJar}" />
926 <ap_applet.jar jarfile="${packageDir}/examples/ap_${javaJson}" />
927 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jsonSimple}" />
928 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/tl_${jalviewLiteJar}" />
929 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/tl_${jmolJar}" />
930 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/tl_${javaJson}" />
931 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/tl_${jsonSimple}" />
932 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jalviewLiteJar}" />
933 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jmolJar}" />
934 <tl_applet.jar jarfile="${packageDir}/examples/tl_${javaJson}" />
935 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jsonSimple}" />
936 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/to_${jalviewLiteJar}" />
937 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/to_${jmolJar}" />
938 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/to_${javaJson}" />
939 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/to_${jsonSimple}" />
940 <to_applet.jar jarfile="${packageDir}/examples/to_${jalviewLiteJar}" />
941 <to_applet.jar jarfile="${packageDir}/examples/to_${jmolJar}" />
942 <to_applet.jar jarfile="${packageDir}/examples/to_${javaJson}" />
943 <to_applet.jar jarfile="${packageDir}/examples/to_${jsonSimple}" />
944 <!-- finally, create manifest for original jars -->
945 <applet.jar jarfile="${packageDir}/examples/${jalviewLiteJar}" />
946 <applet.jar jarfile="${packageDir}/examples/${jmolJar}" />
947 <applet.jar jarfile="${packageDir}/examples/${javaJson}" />
948 <applet.jar jarfile="${packageDir}/examples/${jsonSimple}" />
950 <!-- todo - write examples/downloads for alternate versions of the applet
951 probably don't need to do this now since we don't have alternate versions anymore !-->
953 <target name="-signapplet" depends="prepubapplet_1">
954 <fileset id="signappletjarset" dir="${packageDir}/examples">
955 <exclude name="u_*.jar" />
956 <include name="${jalviewLiteJar}" />
957 <include name="${jmolJar}" />
958 <include name="${javaJson}" />
959 <include name="${jsonSimple}" />
960 <include name="to_${jalviewLiteJar}" />
961 <include name="to_${jmolJar}" />
962 <include name="to_${javaJson}" />
963 <include name="to_${jsonSimple}" />
964 <include name="tl_${jalviewLiteJar}" />
965 <include name="tl_${jmolJar}" />
966 <include name="tl_${javaJson}" />
967 <include name="tl_${jsonSimple}" />
968 <include name="ap_${jalviewLiteJar}" />
969 <include name="ap_${jmolJar}" />
970 <include name="ap_${javaJson}" />
971 <include name="ap_${jsonSimple}" />
974 <target name="-signappletnotsa" if:blank="timestamp" depends="-signapplet" unless="nosign">
975 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
976 <fileset refid="signappletjarset" />
980 <target name="-signapplettsa" if="timestamp" depends="-signapplet" unless="nosign">
981 <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}">
982 <fileset refid="signappletjarset" />
986 <target name="signApplet" description="internal target to sign applet" depends="-signappletnotsa,-signapplettsa" />
987 <target name="pubapplet" description="Dummy target to keep legacy Jalview build system happy. We don't actually publish the applet anymore."/>
989 <target name="_pubapplet" description="installs the jalviewLite applet and dependent jars into an applet examples directory built under ${outputDir}" depends="makeApplet, signApplet">
991 <!-- bizarre bug causes JmolApplet to always get signed, even if excluded from above. so copy explicitly -->
992 <copy file="appletlib/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
993 <copy file="appletlib/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true" />
994 <copy file="appletlib/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true" />
995 <!-- finally, replace any launchApp servlet tags with a version specification -->
996 <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}"">
998 <![CDATA[http://www.jalview.org/services/launchApp"]]>
1000 <fileset dir="${packageDir}/examples">
1001 <include name="**/*.html" />
1004 <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}'">
1006 <![CDATA[http://www.jalview.org/services/launchApp']]>
1008 <fileset dir="${packageDir}/examples">
1009 <include name="**/*.html" />
1014 <target name="sourcedoc" description="Create jalview source documentation pages" depends="init">
1015 <javadoc destdir="${javadocDir}">
1016 <packageset dir="${sourceDir}" includes="jalview/*,MCView/*">
1020 <target name="linkcheck" depends="init,prepare">
1021 <javac srcdir="utils" destdir="utils" includes="HelpLinksChecker.java"/>
1022 <java fork="true" dir="${helpDir}" classpath="utils" classname="HelpLinksChecker" failonerror="true">
1023 <arg file="${helpDir}"/>
1024 <arg value="-nointernet" />
1028 <target name="eclipse-install" depends="init,prepare">
1030 <property name="eclipseTempFile" value="eclipse-jee-oxygen-R-linux-gtk-x86_64.tar.gz"/>
1031 <property name="eclipseInstallURL" value="http://mirror.csclub.uwaterloo.ca/eclipse/technology/epp/downloads/release/oxygen/R/eclipse-jee-oxygen-R-linux-gtk-x86_64.tar.gz"/>
1032 <property name="java2scriptURL" value="https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.core/dist/dropins/net.sf.j2s.core.jar?raw=true"/>
1034 <get url="${eclipseInstallURL}" dest="${eclipseTempFile}"/>
1035 <untar compression="gzip" src="${eclipseTempFile}" dest="${eclipse-inst}"/>
1037 <!-- not needed since we ship transpiler with source
1038 <get url="${java2scriptURL}" dest="eclipse-inst/dropins/net.sf.j2s.core.jar" /> -->
1042 <target name="build-site" depends="init,prepare,compile-site,unzip-to-site,make-j2s-cores">
1044 <tar compression="gzip" destfile="site.tar.gz">
1045 <tarfileset dir="site" />
1048 <target name="prepare-site" depends="init,prepare">
1049 <property name="swingjsdir" value="swingjs"/>
1050 <property name="eclipse-inst" value="/home/bamboo/buildtools/eclipse/eclipse-js"/>
1051 <property name="eclipse-exec" value="${eclipse-inst}/eclipse"/>
1052 <property name="site" value="site"/>
1053 <!-- where the eclipse js workspace has been initialised -->
1054 <property name="eclipse-work" value="/home/bamboo/buildtools/eclipse/eclipse-js-workspace"/>
1055 <!-- git repository linked to project in workspace -->
1056 <property name="eclipse-workrepo" value="/home/bamboo/buildtools/eclipse/eclipse-js-workspace/jalview-js"/>
1058 <target name="clean-site" depends="prepare-site">
1059 <delete dir="${eclipse-workrepo}/${site}"/>
1060 <mkdir dir="${eclipse-workrepo}/${site}"/>
1062 <target name="compile-site" depends="prepare-site,clean-site">
1063 <!-- update transpiler -->
1064 <copy file="${swingjsdir}/net.sf.j2s.core.jar" todir="${eclipse-inst}/dropins" overwrite="true" failonerror="true"/>
1065 <!-- update the git repo linked to the eclipse workspace -->
1066 <exec executable="/usr/bin/git" outputproperty="git.commit" failifexecutionfails="true">
1067 <arg value="rev-parse" />
1068 <arg value="--short" />
1069 <arg value="HEAD" />
1071 <!-- update and checkout the same commit in the workspace project -->
1072 <exec executable="/usr/bin/git" failifexecutionfails="true" dir="${eclipse-workrepo}">
1073 <arg value="reset" />
1074 <arg value="--hard" />
1076 <exec executable="/usr/bin/git" failifexecutionfails="true" dir="${eclipse-workrepo}">
1077 <arg value="pull" />
1079 <exec executable="/usr/bin/git" failifexecutionfails="true" dir="${eclipse-workrepo}">
1080 <arg value="checkout" />
1081 <arg value="${git.commit}" />
1083 <!-- custom classpath for .js builds -->
1084 <copy file=".classpath.js" tofile="${eclipse-workrepo}/.classpath" overwrite="true"/>
1085 <!-- clean eclipse log -->
1086 <delete file="${eclipse-work}/.metadata/.log"/>
1088 <!-- execute the eclipse build - the build may fail but valid javascript may still be produced, so we ignore return codes -->
1089 <exec executable="${eclipse-exec}" failonerror="no">
1090 <arg value="-nosplash"/>
1091 <arg value="--launcher.suppressErrors"/>
1092 <arg value="-application"/>
1093 <arg value="org.eclipse.jdt.apt.core.aptBuild"/>
1094 <arg value="-data"/>
1095 <arg value="${eclipse-work}"/>
1098 <exec executable="/bin/cat">
1099 <arg value="${eclipse-work}/.metadata/.log"/>
1101 <!-- TODO: run jslint and something else here to check we have a complete set of .js files for java -->
1102 <!-- possibly compare timestamps between .js files and their mate in source - any newer or not present triggers a new build -->
1103 <!-- <mkdir dir="${packageDir}/${site}" /> -->
1104 <!-- <property name="swingjs.zipurl" value="https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.java.core/dist/SwingJS-site.zip?raw=true" /> -->
1106 <!-- and reset the .classpath -->
1107 <exec executable="/usr/bin/git" failifexecutionfails="true" dir="${eclipse-workrepo}">
1108 <arg value="checkout" />
1109 <arg value="${git.commit}"/>
1111 <arg value=".classpath" />
1114 <!-- finally copy artefacts from eclipse project checkout to the build site -->
1115 <copy todir="${site}">
1116 <fileset dir="${eclipse-workrepo}/site"/>
1119 <target name="unzip-to-site" depends="prepare-site">
1120 <ant antfile="build-site.xml"/>
1123 <target name="make-j2s-cores" depends="">
1124 <ant antfile="buildcore.xml" target="build-all-cores"/>