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 <!-- Java 9 JVM args -->
106 <condition property="java9">
107 <equals arg1="${ant.java.version}" arg2="9"/>
110 <!-- Don't change anything below here unless you know what you are doing! -->
111 <!-- Url path for WebStart in JNLP file -->
112 <property name="WebStartLocation" value="http://www.jalview.org/webstart" />
113 <!-- Webstart Image - looked for in resources/images -->
114 <property name="WebStartImage" value="JalviewLogo_big.png" />
115 <!-- J2SE version needed for webstart launch -->
116 <!-- Anne's version needs 1.7 - should rebuild VARNA to java 1.6 for release -->
117 <property name="j2sev" value="1.7+" />
118 <!-- Java Compilation settings - source and target javac version -->
119 <property name="javac.source" value="1.8" />
120 <property name="javac.target" value="1.8" />
122 <!-- Permissions for running Java applets and applications. -->
123 <!-- Defaults are those suitable for deploying jalview webstart www.jalview.org -->
124 <property name="application.codebase" value="*.jalview.org" />
125 <!-- and allowing the applet to be deployed from any URL -->
126 <!-- 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 -->
127 <property name="applet.codebase" value="*.jalview.org *.dundee.ac.uk *" />
128 <property name="applet.caller-codebase" value="${applet.codebase}" />
130 <!-- build directory configuration -->
131 <property name="libDir" value="lib" />
132 <property name="resourceDir" value="resources" />
133 <property name="helpDir" value="help" />
134 <property name="docDir" value="doc" />
135 <property name="sourceDir" value="src" />
136 <property name="schemaDir" value="schemas" />
137 <property name="outputDir" value="classes" />
138 <property name="packageDir" value="dist" />
139 <property name="outputJar" value="jalview.jar" />
140 <!-- Jalview Applet JMol Jar Dependency -->
141 <property name="jmolJar" value="JmolApplet-14.6.4_2016.10.26.jar" />
142 <property name="varnaJar" value="VARNAv3-93.jar" />
143 <property name="jsoup" value="jsoup-1.8.1.jar" />
144 <property name="jsonSimple" value="json_simple-1.1.jar" />
145 <property name="javaJson" value="java-json.jar" />
146 <property name="jalviewLiteJar" value="jalviewApplet.jar" />
147 <property name="reportDir" value="test-reports" />
148 <property name="testDir" value="test" />
149 <property name="testOutputDir" value="tests" />
150 <!-- switch to indicate if we should obfuscate jalviewLite -->
151 <!-- <property name="donotobfuscate" value="true"/> -->
152 <!-- switch to exclude associations from generated jnlp files -->
153 <!-- <property name="nojnlpfileassocs" value="true"/> -->
155 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
156 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
157 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
158 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
159 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
160 <property name="WSInterf" value="MsaWS" />
161 <property name="wsdl.Namespace" value="vamsas" />
162 <property name="wsdl.ClientNS" value="ext.vamsas" />
163 <!-- the class path for building the application -->
164 <path id="build.classpath">
165 <fileset dir="utils">
166 <include name="*.jar" />
167 <include name="**/*.jar" />
169 <fileset dir="${libDir}">
170 <include name="*.jar" />
171 <include name="**/*.jar" />
173 <fileset dir="${java.home}/lib">
174 <include name="plugin.jar" />
176 <fileset dir="appletlib">
177 <!-- the JmolApplet includes the JmolApplet console and the application javac seems to always try and build all packages
179 <include name="${jmolJar}" />
180 <include name="${varnaJar}" />
183 <path id="test.classpath">
184 <pathelement path="${outputDir}" />
185 <path refid="build.classpath" />
187 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
188 <!-- The Location of the java 1.1.8 jdk -->
189 <property name="java118.home" value="${java.home}" />
190 <!-- jre for 1.4 version -->
191 <property name="applet.jre.tools" value="${java118.home}/lib/rt.jar" />
193 <!-- the classpath for building the 1.1 applet -->
194 <path id="jalviewlite.deps">
195 <fileset dir="${java118.home}">
196 <include name="lib/rt.jar" />
198 <fileset dir="${java.home}/lib">
199 <include name="plugin.jar" />
201 <pathelement location="appletlib/${jmolJar}" />
202 <pathelement location="lib/${varnaJar}" />
203 <pathelement location="appletlib/${jsoup}" />
204 <pathelement location="appletlib/${jsonSimple}" />
205 <pathelement location="appletlib/${javaJson}" />
208 <!-- default location for outputting javadoc -->
209 <property name="javadocDir" value="${packageDir}/javadoc" />
213 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties" />
214 <target name="buildPropertiesFile" depends="init">
215 <tstamp prefix="build">
216 <format property="date" pattern="dd MMMM yyyy" />
218 <exec executable="/usr/bin/git" outputproperty="git.commit" failifexecutionfails="false">
219 <arg value="rev-parse" />
220 <arg value="--short" />
223 <exec executable="/usr/bin/git" outputproperty="git.branch" failifexecutionfails="false">
224 <arg value="rev-parse" />
225 <arg value="--abbrev-ref" />
228 <properties file="${outputDir}/.build_properties">
230 ---Jalview Build Details---
232 <property name="VERSION" value="${JALVIEW_VERSION}" />
233 <property name="INSTALLATION" value="${INSTALLATION} git-commit:${git.commit} [${git.branch}]" />
234 <property name="BUILD_DATE" value="${build.date}" />
239 <target name="clean" depends="init">
240 <!-- not efficient yet. -->
241 <delete dir="${outputDir}" includes="*,**/*" />
244 <target name="distclean" depends="init, clean">
246 <echo message="REMOVING ALL BACKUP/AUTOSAVES!" />
249 <include name="${outputJar}" />
250 <include name="#*#" />
251 <include name="#*.*#" />
252 <include name="**/#*#" />
253 <include name="**/#*.*#" />
254 <include name="*~" />
255 <include name="*.*~" />
256 <include name="**/*~" />
257 <include name="**/*.*~" />
262 <target name="prepare" depends="init">
263 <mkdir dir="${outputDir}" />
264 <copy todir="${outputDir}">
266 <include name="${docDir}/**/*.*" />
267 <include name="${helpDir}/**/*.*" />
268 <include name="${libDir}/*.jar" />
270 <fileset dir="${resourceDir}">
271 <include name="**/*.*" />
276 <target name="build" depends="prepare">
277 <!-- not efficient yet. -->
278 <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="build.classpath">
279 <exclude name="jalview/*applet*" />
280 <exclude name="jalview/appletgui/**" />
281 <exclude name="com/stevesoft/**" />
286 <target name="testclean" depends="init">
287 <delete dir="${testOutputDir}" includes="*,**/*" />
290 <target name="prepareTests" depends="init,testclean">
291 <mkdir dir="${testOutputDir}" />
294 <target name="buildTests" depends="build,buildindices,prepareTests">
295 <javac source="${javac.source}" target="${javac.target}" srcdir="${testDir}" destdir="${testOutputDir}" debug="${javac.debug}" classpathref="test.classpath" includeantruntime="false">
299 <taskdef resource="testngtasks" classpath="utils/testnglibs/testng.jar" />
301 <target name="testng" depends="buildTests">
302 <testng outputDir="${reportDir}" haltOnFailure="false" groups="${testng-groups}" mode="testng"
305 <pathelement location="${testOutputDir}" />
306 <pathelement location="${clover.jar}" if:set="clover.jar"/>
307 <path refid="test.classpath" />
309 <jvmarg value="--add-modules=java.se.ee" if:set="java9"/>
310 <jvmarg value="--illegal-access=warn" if:set="java9"/>
311 <classfileset dir="${testOutputDir}" includes="**/*.class" />
315 <target name="buildindices" depends="init, prepare" unless="help.uptodate">
316 <replace value="${JALVIEW_VERSION}">
317 <replacetoken><![CDATA[$$Version-Rel$$]]></replacetoken>
318 <fileset dir="${outputDir}/${helpDir}">
319 <include name="help.jhm" />
323 <java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
328 <target name="preparejnlp" depends="makedist">
329 <copy todir="${packageDir}">
330 <fileset dir="${resourceDir}/images">
331 <include name="${WebStartImage}" />
335 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties" />
337 <!-- create a dummy jar which will eventually contain the jnlp template -->
338 <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
339 <fileset dir="${packageDir}">
340 <include name="jalview.jar" />
344 <mkdir dir="${packageDir}/JNLP-INF" />
345 <antcall target="writejnlpf">
346 <param name="jnlpFile" value="${packageDir}/JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
347 <param name="inih" value="*" />
348 <param name="maxh" value="*" />
351 <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
352 <fileset dir="${packageDir}">
353 <include name="JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
357 <antcall target="writejnlpf">
358 <param name="jnlpFile" value="${packageDir}/jalview.jnlp" />
359 <param name="inih" value="10M" />
360 <param name="maxh" value="256M" />
363 <antcall target="writejnlpf">
364 <param name="jnlpFile" value="${packageDir}/jalview_1G.jnlp" />
365 <param name="inih" value="128M" />
366 <param name="maxh" value="512M" />
369 <antcall target="writejnlpf">
370 <param name="jnlpFile" value="${packageDir}/jalview_2G.jnlp" />
371 <param name="inih" value="256M" />
372 <param name="maxh" value="1024M" />
375 <!-- finally, need to postprocess to add in associations at end of 'information' element
377 <xslt in="${packageDir}/jalview_noa_1G.jnlp" out="${packageDir}/jalview_1G.jnlp">
384 <association mime-type="application-x/ext-file" extensions="fa"/>
385 <association mime-type="application-x/ext-file" extensions="fasta"/>
386 <association mime-type="application-x/ext-file" extensions="mfa"/>
387 <association mime-type="application-x/ext-file" extensions="fastq"/>
388 <association mime-type="application-x/ext-file" extensions="blc"/>
389 <association mime-type="application-x/ext-file" extensions="msf"/>
390 <association mime-type="application-x/ext-file" extensions="pfam"/>
391 <association mime-type="application-x/ext-file" extensions="aln"/>
392 <association mime-type="application-x/ext-file" extensions="pir"/>
393 <association mime-type="application-x/ext-file" extensions="amsa"/>
394 <association mime-type="application-x/ext-file" extensions="stk"/>
395 <association mime-type="application-x/ext-file" extensions="jar"/>-->
398 <target name="-jarsignwithtsa" depends="makedist,preparejnlp" if="timestamp">
399 <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}"
400 tsaproxyhost="${proxyHost}" tsaproxyport="${proxyPort}" tsaurl="${jalview.tsaurl}">
401 <fileset dir="${packageDir}">
402 <include name="*.jar" />
406 <target name="-jarsignnotsa" depends="makedist,preparejnlp" unless="timestamp">
407 <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}">
408 <fileset dir="${packageDir}">
409 <include name="*.jar" />
414 <target name="makefulldist" depends="makedist,preparejnlp,-jarsignwithtsa,-jarsignnotsa">
415 <!-- and sign the jars -->
416 <!-- the default keystore details might need to be edited here -->
419 <target name="runenv" depends="init">
420 <path id="run.classpath">
421 <pathelement location="${outputDir}" />
422 <fileset dir="${outputDir}">
423 <include name="${libDir}/*.jar" />
426 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath" />
428 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
432 <target name="-generatejnlpf">
433 <presetdef name="jnlpf">
434 <jnlp codebase="${WebStartLocation}">
436 <title>Jalview</title>
437 <vendor>The Barton Group</vendor>
438 <homepage href="http://www.jalview.org" />
439 <description>Jalview Multiple Alignment Editor</description>
440 <description kind="short">Jalview</description>
441 <icon href="${WebStartImage}" />
445 <j2se version="1.8+" />
446 <jar main="true" href="jalview.jar"/>
447 <fileset dir="${packageDir}">
448 <exclude name="jalview.jar" />
449 <include name="*.jar" />
450 <include name="*_*.jar" />
451 <exclude name="*quaqua*.jar" />
453 <property name="jalview.version" value="${JALVIEW_VERSION}" />
455 <resources os="Mac OS X">
456 <fileset dir="${packageDir}">
457 <include name="quaqua-filechooser-only-8.0.jar"/>
458 <include name="*quaqua64*.jnilib.jar" />
462 <application_desc main_class="jalview.bin.Jalview">
470 <jnlpf toFile="${jnlpFile}" />
471 <!-- add the add-modules j2se attribute for java 9 -->
472 <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"">
473 <replacetoken>j2se version="1.8+"</replacetoken>
477 <target name="-dofakejnlpfileassoc" depends="-generatejnlpf" if="nojnlpfileassocs">
478 <echo message="Not adding JNLP File Associations" />
481 <target name="-dojnlpfileassoc" depends="-generatejnlpf" unless="nojnlpfileassocs">
482 <replace file="${jnlpFile}">
484 <![CDATA[</information>]]></replacetoken>
487 <association mime-type="application-x/ext-file" extensions="fa" />
488 <association mime-type="application-x/ext-file" extensions="fasta" />
489 <association mime-type="application-x/ext-file" extensions="mfa" />
490 <association mime-type="application-x/ext-file" extensions="fastq" />
491 <association mime-type="application-x/ext-file" extensions="blc" />
492 <association mime-type="application-x/ext-file" extensions="msf" />
493 <association mime-type="application-x/ext-file" extensions="pfam" />
494 <association mime-type="application-x/ext-file" extensions="aln"/>
495 <association mime-type="application-x/ext-file" extensions="pir"/>
496 <association mime-type="application-x/ext-file" extensions="amsa"/>
497 <association mime-type="application-x/ext-file" extensions="stk"/>
498 <association mime-type="application-x/ext-file" extensions="jvp"/>
499 </information>]]></replacevalue>
501 <echo message="Added file associations to JNLP file" />
503 <target name="writejnlpf" depends="-dojnlpfileassoc,-dofakejnlpfileassoc">
506 <target name="buildextclients" depends="init">
507 <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" />
508 <condition property="dontextbuild">
509 <equals arg1="n" arg2="${doextbuild.response}" />
511 <condition property="dontextbuild">
512 <equals arg1="N" arg2="${doextbuild.response}" />
514 <fail if="dontextbuild">
515 Build External Client Code process aborted by user. Jalview source is unchanged.
517 <!-- Currently, this doesn't happen automatically.
518 1. Run WSDL2Java as below, which generates an ext.vamsas +
519 vamsas.<datapackages> fileset.
520 2. refactor ext.vamsas.SpecificserviceWS* to
521 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
522 3. Update the jalview.ws.*WServices classes to reflect the
523 interface type, and all locations of this wsdl type that Jalview
527 <path id="axisbuild">
528 <path refid="build.classpath" />
530 <taskdef resource="axis-tasks.properties" classpathref="axisbuild" />
532 <fileset dir="${sourceDir}" id="client">
533 <include name="${wsdl.ClientNS}/*.*" />
537 <axis-wsdl2java output="${sourceDir}" verbose="true" url="${wsdl.MsaWS2}" serverside="false" deployscope="Request" debug="false" helpergen="true" all="true">
539 <mapping namespace="${wsdl.Namespace}" package="${wsdl.ClientNS}" />
540 <mapping namespace="http://dataTypes.vamsas" package="${wsdl.ClientNS}" />
545 <target name="makedist" depends="build, buildPropertiesFile, linkcheck, buildindices">
546 <!-- make the package jar if not already existing -->
547 <mkdir dir="${packageDir}" />
548 <!-- clean dir if it already existed -->
550 <fileset dir="${packageDir}">
551 <include name="*.jar" />
554 <jar destfile="${packageDir}/${outputJar}" index="true">
556 <attribute name="Main-Class" value="jalview.bin.Jalview" />
557 <attribute name="Permissions" value="all-permissions" />
558 <attribute name="Application-Name" value="Jalview Desktop" />
559 <attribute name="Codebase" value="${application.codebase}" />
561 <fileset dir="${outputDir}/">
562 <exclude name="cache*/**" />
563 <exclude name="*.jar" />
564 <exclude name="*.jar.*" />
565 <exclude name="**/*.jar" />
566 <exclude name="**/*.jar.*" />
570 <copy toDir="${packageDir}" flatten="true">
571 <fileset dir="${outputDir}">
572 <include name="*.jar" />
573 <include name="**/*.jar" />
579 <!-- jalopy code reformatter -->
580 <target name="sourcescrub" depends="init,build">
581 <jalopy destdir="jsrc" classpathref="run.classpath" convention="jalview-jalopy.xml">
582 <fileset dir="${sourceDir}">
583 <include name="*.java" />
584 <include name="**/*.java" />
585 <include name="**/**/*.java" />
592 <!-- Compile, package and obfuscate Jalview Applet -->
593 <target name="makeApplet" depends="obfuscate" description="assemble the final jalviewLite applet jar with or without obfuscation" />
595 <target name="compileApplet" depends="init,clean">
596 <mkdir dir="${outputDir}" />
597 <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/**" />
600 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
601 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
602 <copy todir="${outputDir}/lang">
603 <fileset dir="${resourceDir}/lang">
604 <include name="**.*" />
607 <jar destfile="in.jar" index="true">
609 <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
610 <attribute name="Application-Name" value="JalviewLite" />
611 <attribute name="Codebase" value="${applet.codebase}" />
613 <fileset dir="${outputDir}">
614 <include name="com/**" />
615 <include name="MCview/**" />
616 <include name="jalview/**" />
617 <include name=".build_properties" />
618 <include name="images/link.gif" />
619 <include name="lang/**" />
623 <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally">
625 <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
626 <copy file="in.jar" tofile="${jalviewLiteJar}" overwrite="true" />
627 <delete file="in.jar" />
629 <target name="-obfuscatereally" unless="donotobfuscate">
631 <path id="obfuscateDeps.path">
632 <pathelement location="${applet.jre.tools}" />
633 <pathelement location="appletlib/${jmolJar}" />
634 <pathelement location="lib/${varnaJar}" />
635 <pathelement location="appletlib/${jsoup}" />
636 <pathelement location="appletlib/${jsonSimple}" />
637 <pathelement location="appletlib/${javaJson}" />
638 <fileset dir="${java.home}/lib">
639 <include name="plugin.jar" />
642 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard_5.3.3.jar" />
644 <proguard verbose="true" >
645 <injar file="in.jar" />
646 <outjar file="${jalviewLiteJar}" />
647 <libraryjar refid="obfuscateDeps.path" />
649 <keep access="public" type="class" name="jalview.bin.JalviewLite">
650 <field access="public" />
651 <method access="public" />
652 <constructor access="public" />
654 <keep access="public" type="class" name="jalview.appletgui.AlignFrame">
655 <field access="public" />
656 <method access="public" />
657 <constructor access="public" />
660 <keep name="jalview.json.binding**">
665 <keep access="public" type="class" name="MCview.PDBfile">
666 <field access="public" />
667 <method access="public" />
668 <constructor access="public" />
671 <keep access="public" type="class" name="jalview.ws.jws1.Annotate3D">
672 <field access="public" />
673 <method access="public" />
674 <constructor access="public" />
677 <keep access="public" type="class" name="jalview.ext.jmol.JmolParser">
678 <field access="public" />
679 <method access="public" />
680 <constructor access="public" />
684 <!-- -libraryjars "${obfuscateDeps}"
686 -outjars jalviewApplet.jar
687 -keep public class jalview.bin.JalviewLite
690 <delete file="in.jar" />
693 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
694 <taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask" classpathref="build.classpath" />
696 <fileset dir="${sourceDir}/jalview/schemabinding/version2">
697 <include name="*.java" />
698 <include name="descriptors/*.java" />
701 <castor-srcgen file="${schemaDir}/vamsas.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
702 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
703 <castor-srcgen file="${schemaDir}/JalviewWsParamSet.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
704 <castor-srcgen file="${schemaDir}/jalview.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
706 now build the jalview.binding package with the old schema set
709 <fileset dir="${sourceDir}/jalview/binding/">
710 <include name="**" />
713 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
714 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
715 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
717 <target name="sourcedist" description="create jalview source distribution" depends="init">
718 <delete file="${source.dist.name}" />
719 <!-- temporary copy of source to update timestamps -->
720 <copy todir="_sourcedist">
722 <exclude name=".*" />
723 <exclude name="**/.*" />
724 <exclude name="*.class" />
725 <exclude name="**/*.class" />
726 <include name="LICENSE" />
727 <include name="README" />
728 <include name="build.xml" />
729 <include name="jalview-jalopy.xml" />
730 <include name="JalviewApplet.jpx" />
731 <include name="JalviewX.jpx" />
732 <include name="nbbuild.xml" />
733 <include name="nbproject/genfiles.properties" />
734 <include name="nbproject/project.properties" />
735 <include name="nbproject/project.xml" />
736 <include name="${sourceDir}/*.java" />
737 <include name="${sourceDir}/**/*.java" />
738 <include name="${sourceDir}/**/*.cdr" />
739 <include name="${libDir}/**/*" />
740 <include name="${resourceDir}/**/*" />
741 <include name="${helpDir}/**/*" />
742 <include name="appletlib/${jmolJar}" />
743 <include name="appletlib/${jsonSimple}" />
744 <include name="appletlib/${javaJson}" />
745 <exclude name="**/*locales" />
746 <exclude name="*locales/**" />
747 <exclude name="utils/InstallAnywhere/**Build.iap_xml" />
748 <exclude name="utils/InstallAnywhere/**Build*/**" />
749 <exclude name="utils/InstallAnywhere/**Build*/**" />
750 <exclude name="utils/InstallAnywhere/.build*.*/**" />
751 <exclude name="utils/InstallAnywhere/**locale*" />
752 <exclude name="utils/InstallAnywhere/**locale*/**" />
753 <exclude name="utils/InstallAnywhere/**locale*/**" />
754 <include name="${schemaDir}/**/*" />
755 <include name="utils/**/*" />
756 <include name="${docDir}/**/*" />
757 <include name="examples/**/*" />
761 <tstamp prefix="build">
762 <format property="year" pattern="yyyy" />
764 <!-- each replacetoken CDATA body must be on one line -
765 otherwise the pattern doesn't match -->
766 <replace value="${JALVIEW_VERSION}">
767 <replacetoken><![CDATA[$$Version-Rel$$]]></replacetoken>
768 <fileset dir="_sourcedist">
769 <include name="**/*" />
772 <replace dir="_sourcedist" value="${build.year}">
773 <replacetoken><![CDATA[$$Year-Rel$$]]></replacetoken>
774 <fileset dir="_sourcedist">
775 <include name="**/*" />
779 <tar destfile="${source.dist.name}" compression="gzip">
780 <tarfileset dir="_sourcedist/" prefix="jalview" preserveLeadingSlashes="true">
784 <delete dir="_sourcedist" />
786 <target name="prepubapplet_1" depends="makeApplet">
787 <copy todir="${packageDir}/examples">
788 <fileset dir="examples">
789 <include name="**/*" />
790 <include name="javascript/*" />
791 <include name="jmol/*" />
794 <include name="${jalviewLiteJar}" />
796 <fileset dir="appletlib">
797 <include name="**/*" />
800 <jar update="true" index="true" jarfile="${packageDir}/examples/${jalviewLiteJar}" />
801 <jar update="true" index="true" jarfile="${packageDir}/examples/${javaJson}" />
802 <jar update="true" index="true" jarfile="${packageDir}/examples/${jsonSimple}" />
803 <jar update="true" index="true" jarfile="${packageDir}/examples/${jmolJar}">
805 <attribute name="Application-Name" value="Jmol (bundled with JalviewLite)" />
806 <!-- <attribute name="Permissions" value="sandbox" /> -->
807 <!--<attribute name="Trusted-Lib" value="true" /> -->
808 <attribute name="Codebase" value="${applet.codebase}" />
809 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
813 <presetdef name="ap_applet.jar">
814 <!-- build a signed applet with 'all-permissions' -
815 Needs 'param name="permissions' value="all-permissions"' in applet tag
816 JalviewLite+JmolApplet linked sequence/structure fails
817 Mixed code warnings are raised
819 <jar update="true" index="true">
821 <attribute name="Application-Name" value="JalviewLite" />
822 <attribute name="Permissions" value="all-permissions" />
823 <attribute name="Codebase" value="${applet.codebase}" />
824 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
825 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
829 <presetdef name="applet.jar">
830 <!-- build signed applet with sandbox permissions -
831 Needs 'param name="permissions' value="sandbox"' in applet tag
832 Preserves Pre-Java 1.7_u45 behavior once 'permissions' parameter added to applet tag
835 <jar update="true" index="true">
837 <attribute name="Application-Name" value="JalviewLite" />
838 <attribute name="Permissions" value="sandbox" />
839 <attribute name="Codebase" value="${applet.codebase}" />
840 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
841 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
845 <presetdef name="tl_applet.jar">
846 <!-- build signed applet with trusted library/trusted permissions -
847 Needs 'param name="permissions' value="all-permissions"' in applet tag
849 No mixed code warnings raised
850 Jmol/JalviewLite sequence/structure example doesn't link structures
851 Raises dialog asking user to allow page to control applet via LiveConnect javascript
855 <jar update="true" index="true">
857 <attribute name="Application-Name" value="JalviewLite" />
858 <attribute name="Permissions" value="all-permissions" />
859 <attribute name="Codebase" value="${applet.codebase}" />
860 <attribute name="Trusted-Only" value="true" />
861 <attribute name="Trusted-Library" value="true" />
865 <presetdef name="to_applet.jar">
866 <!-- not fully test variant (yet) -->
867 <jar update="true" index="true">
869 <attribute name="Application-Name" value="JalviewLite" />
870 <attribute name="Permissions" value="all-permissions" />
871 <attribute name="Codebase" value="${applet.codebase}" />
872 <attribute name="Trusted-Only" value="true" />
876 <!-- create differently privileged artefacts -->
877 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/u_${jalviewLiteJar}" />
878 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
879 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true" />
880 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true" />
881 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/ap_${jalviewLiteJar}" />
882 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/ap_${jmolJar}" />
883 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/ap_${javaJson}" />
884 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/ap_${jsonSimple}" />
885 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jalviewLiteJar}" />
886 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jmolJar}" />
887 <ap_applet.jar jarfile="${packageDir}/examples/ap_${javaJson}" />
888 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jsonSimple}" />
889 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/tl_${jalviewLiteJar}" />
890 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/tl_${jmolJar}" />
891 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/tl_${javaJson}" />
892 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/tl_${jsonSimple}" />
893 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jalviewLiteJar}" />
894 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jmolJar}" />
895 <tl_applet.jar jarfile="${packageDir}/examples/tl_${javaJson}" />
896 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jsonSimple}" />
897 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/to_${jalviewLiteJar}" />
898 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/to_${jmolJar}" />
899 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/to_${javaJson}" />
900 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/to_${jsonSimple}" />
901 <to_applet.jar jarfile="${packageDir}/examples/to_${jalviewLiteJar}" />
902 <to_applet.jar jarfile="${packageDir}/examples/to_${jmolJar}" />
903 <to_applet.jar jarfile="${packageDir}/examples/to_${javaJson}" />
904 <to_applet.jar jarfile="${packageDir}/examples/to_${jsonSimple}" />
905 <!-- finally, create manifest for original jars -->
906 <applet.jar jarfile="${packageDir}/examples/${jalviewLiteJar}" />
907 <applet.jar jarfile="${packageDir}/examples/${jmolJar}" />
908 <applet.jar jarfile="${packageDir}/examples/${javaJson}" />
909 <applet.jar jarfile="${packageDir}/examples/${jsonSimple}" />
911 <!-- todo - write examples/downloads for alternate versions of the applet
912 probably don't need to do this now since we don't have alternate versions anymore !-->
914 <target name="-signapplet" depends="prepubapplet_1">
915 <fileset id="signappletjarset" dir="${packageDir}/examples">
916 <exclude name="u_*.jar" />
917 <include name="${jalviewLiteJar}" />
918 <include name="${jmolJar}" />
919 <include name="${javaJson}" />
920 <include name="${jsonSimple}" />
921 <include name="to_${jalviewLiteJar}" />
922 <include name="to_${jmolJar}" />
923 <include name="to_${javaJson}" />
924 <include name="to_${jsonSimple}" />
925 <include name="tl_${jalviewLiteJar}" />
926 <include name="tl_${jmolJar}" />
927 <include name="tl_${javaJson}" />
928 <include name="tl_${jsonSimple}" />
929 <include name="ap_${jalviewLiteJar}" />
930 <include name="ap_${jmolJar}" />
931 <include name="ap_${javaJson}" />
932 <include name="ap_${jsonSimple}" />
935 <target name="-signappletnotsa" unless="timestamp" depends="-signapplet">
936 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
937 <fileset refid="signappletjarset" />
941 <target name="-signapplettsa" if="timestamp" depends="-signapplet">
942 <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}">
943 <fileset refid="signappletjarset" />
947 <target name="signApplet" description="internal target to sign applet" depends="-signappletnotsa,-signapplettsa" />
949 <target name="pubapplet" description="installs the jalviewLite applet and dependent jars into an applet examples directory built under ${outputDir}" depends="makeApplet, signApplet">
951 <!-- bizarre bug causes JmolApplet to always get signed, even if excluded from above. so copy explicitly -->
952 <copy file="appletlib/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
953 <copy file="appletlib/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true" />
954 <copy file="appletlib/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true" />
955 <!-- finally, replace any launchApp servlet tags with a version specification -->
956 <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}"">
958 <![CDATA[http://www.jalview.org/services/launchApp"]]>
960 <fileset dir="${packageDir}/examples">
961 <include name="**/*.html" />
964 <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}'">
966 <![CDATA[http://www.jalview.org/services/launchApp']]>
968 <fileset dir="${packageDir}/examples">
969 <include name="**/*.html" />
974 <target name="sourcedoc" description="Create jalview source documentation pages" depends="init">
975 <javadoc destdir="${javadocDir}">
976 <packageset dir="${sourceDir}" includes="jalview/*,MCView/*">
980 <target name="linkcheck" depends="init,prepare">
981 <javac srcdir="utils" destdir="utils" includes="HelpLinksChecker.java"/>
982 <java fork="true" dir="${helpDir}" classpath="utils" classname="HelpLinksChecker" failonerror="true">
983 <arg file="${helpDir}"/>
984 <arg value="-nointernet"/>