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 <target name="help" depends="usage" />
24 <target name="usage" depends="init">
25 <echo message="~~~Jalview Ant build.xml Usage~~~~" />
26 <echo message="Targets include:" />
27 <echo message="usage - default target, displays this message" />
28 <echo message="buildindices - generates JavaHelpSearch from the help files" />
29 <echo message="build - compiles all necessary files for Application" />
30 <echo message="makedist - compiles and places all necessary jar files into directory dist" />
31 <echo message="makefulldist - signs all jar files and builds jnlp file for full distribution" />
32 <echo message=" this needs a keystore and key."/>
33 <echo message=" Add -Dtimestamp to timestamp signed jars"/>
34 <echo message=" -Djalview.keyalg and -Djalview.keydig are SHA1/SHA1withRSA"/>
35 <echo message=" See docs/building.html for more information." />
36 <echo message="compileApplet - compiles all necessary files for Applet" />
37 <echo message="makeApplet - compiles, then packages and obfuscates the Applet" />
38 <echo message="testng - run jalview's tests via testNG. Default group is '${testng-groups}'" />
39 <echo message=" you can specify particular test groups as a list via -Dtestng-groups=" />
40 <echo message="See docs/building.html and the comments in build file for other targets." />
41 <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 " />
42 <echo message="Useful -D flags: -Ddonotobfuscate will prevent applet obfuscation" />
46 <!-- utils is a class path to additional utilities needed for
47 building docs, jars and webstart stuff -->
49 Userdefined build property defaults
51 wsdl.server list (plus namespace mapping info ???) - also want
52 ... to make this a dynamically generatable property
54 Build location - provide a temporary root for speed
55 jarsigner keystore and info
56 Jakarta and axis classpath ?
57 Default argument for starting Jalview (if it exists).
62 <path id="axis.classpath">
64 <fileset dir="/usr/local/axis/lib">
65 <include name="**/*.jar" />
67 <fileset dir="/usr/local/jakarta-tomcat-5/webapps/axis/WEB-INF/lib">
68 <include name="**/*.jar"/>
69 <include name="*.jar"/>
73 <!-- Jalview Version String displayed by application on startup and used to check for updates -->
74 <property name="JALVIEW_VERSION" value="DEVELOPMENT" />
76 <property name="INSTALLATION" value="Source" />
78 <!-- 2.4 (VAMSAS)" -->
79 <!-- Include debugging information in javac true or false -->
80 <property name="javac.debug" value="true" />
82 <!-- JarSigner Key Store for Webstart Distribution -->
83 <property name="jalview.keystore" value="./keys/.keystore" />
84 <!-- Keystore Password -->
85 <property name="jalview.keystore.pass" value="alignmentisfun" />
87 <property name="jalview.key" value="jalview" />
89 <property name="jalview.key.pass" value="alignmentisfun" />
90 <!-- time stamp server URL -->
91 <property name="jalview.tsaurl" value="" />
92 <!-- locally valid proxy for signing with external time server -->
93 <property name="proxyPort" value="80"/>
94 <property name="proxyHost" value="sqid"/>
95 <!-- key sign/digest algorithms -->
96 <property name="jalview.keyalg" value="SHA1withRSA" description="key algorithm for signing"/>
97 <property name="jalview.keydig" value="SHA1" description="algorithm for jar digest"/>
99 <!-- default TestNG groups to run -->
100 <property name="testng-groups" value="Functional" />
101 <!-- Java 9 JVM args -->
102 <condition property="java9">
103 <equals arg1="${ant.java.version}" arg2="9"/>
106 <!-- Don't change anything below here unless you know what you are doing! -->
107 <!-- Url path for WebStart in JNLP file -->
108 <property name="WebStartLocation" value="http://www.jalview.org/webstart" />
109 <!-- Webstart Image - looked for in resources/images -->
110 <property name="WebStartImage" value="JalviewLogo_big.png" />
111 <!-- J2SE version needed for webstart launch -->
112 <!-- Anne's version needs 1.7 - should rebuild VARNA to java 1.6 for release -->
113 <property name="j2sev" value="1.7+" />
114 <!-- Java Compilation settings - source and target javac version -->
115 <property name="javac.source" value="1.8" />
116 <property name="javac.target" value="1.8" />
118 <!-- Permissions for running Java applets and applications. -->
119 <!-- Defaults are those suitable for deploying jalview webstart www.jalview.org -->
120 <property name="application.codebase" value="*.jalview.org" />
121 <!-- and allowing the applet to be deployed from any URL -->
122 <!-- 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 -->
123 <property name="applet.codebase" value="*.jalview.org *.dundee.ac.uk *" />
124 <property name="applet.caller-codebase" value="${applet.codebase}" />
126 <!-- build directory configuration -->
127 <property name="libDir" value="lib" />
128 <property name="resourceDir" value="resources" />
129 <property name="helpDir" value="help" />
130 <property name="docDir" value="doc" />
131 <property name="sourceDir" value="src" />
132 <property name="schemaDir" value="schemas" />
133 <property name="outputDir" value="classes" />
134 <property name="packageDir" value="dist" />
135 <property name="outputJar" value="jalview.jar" />
136 <!-- Jalview Applet JMol Jar Dependency -->
137 <property name="jmolJar" value="JmolApplet-14.6.4_2016.10.26.jar" />
138 <property name="varnaJar" value="VARNAv3-93.jar" />
139 <property name="jsoup" value="jsoup-1.8.1.jar" />
140 <property name="jsonSimple" value="json_simple-1.1.jar" />
141 <property name="javaJson" value="java-json.jar" />
142 <property name="jalviewLiteJar" value="jalviewApplet.jar" />
143 <property name="reportDir" value="test-reports" />
144 <property name="testDir" value="test" />
145 <property name="testOutputDir" value="tests" />
146 <!-- switch to indicate if we should obfuscate jalviewLite -->
147 <!-- <property name="donotobfuscate" value="true"/> -->
148 <!-- switch to exclude associations from generated jnlp files -->
149 <!-- <property name="nojnlpfileassocs" value="true"/> -->
151 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
152 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
153 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
154 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
155 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
156 <property name="WSInterf" value="MsaWS" />
157 <property name="wsdl.Namespace" value="vamsas" />
158 <property name="wsdl.ClientNS" value="ext.vamsas" />
159 <!-- the class path for building the application -->
160 <path id="build.classpath">
161 <fileset dir="utils">
162 <include name="*.jar" />
163 <include name="**/*.jar" />
165 <fileset dir="${libDir}">
166 <include name="*.jar" />
167 <include name="**/*.jar" />
169 <fileset dir="${java.home}/lib">
170 <include name="plugin.jar" />
172 <fileset dir="appletlib">
173 <!-- the JmolApplet includes the JmolApplet console and the application javac seems to always try and build all packages
175 <include name="${jmolJar}" />
176 <include name="${varnaJar}" />
179 <path id="test.classpath">
180 <pathelement path="${outputDir}" />
181 <path refid="build.classpath" />
183 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
184 <!-- The Location of the java 1.1.8 jdk -->
185 <property name="java118.home" value="${java.home}" />
186 <!-- jre for 1.4 version -->
187 <property name="applet.jre.tools" value="${java118.home}/lib/rt.jar" />
189 <!-- the classpath for building the 1.1 applet -->
190 <path id="jalviewlite.deps">
191 <fileset dir="${java118.home}">
192 <include name="lib/rt.jar" />
194 <fileset dir="${java.home}/lib">
195 <include name="plugin.jar" />
197 <pathelement location="appletlib/${jmolJar}" />
198 <pathelement location="lib/${varnaJar}" />
199 <pathelement location="appletlib/${jsoup}" />
200 <pathelement location="appletlib/${jsonSimple}" />
201 <pathelement location="appletlib/${javaJson}" />
204 <!-- default location for outputting javadoc -->
205 <property name="javadocDir" value="${packageDir}/javadoc" />
209 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties" />
210 <target name="buildPropertiesFile" depends="init">
211 <tstamp prefix="build">
212 <format property="date" pattern="dd MMMM yyyy" />
214 <exec executable="/usr/bin/git" outputproperty="git.commit" failifexecutionfails="false">
215 <arg value="rev-parse" />
216 <arg value="--short" />
219 <exec executable="/usr/bin/git" outputproperty="git.branch" failifexecutionfails="false">
220 <arg value="rev-parse" />
221 <arg value="--abbrev-ref" />
224 <properties file="${outputDir}/.build_properties">
226 ---Jalview Build Details---
228 <property name="VERSION" value="${JALVIEW_VERSION}" />
229 <property name="INSTALLATION" value="${INSTALLATION} git-commit:${git.commit} [${git.branch}]" />
230 <property name="BUILD_DATE" value="${build.date}" />
235 <target name="clean" depends="init">
236 <!-- not efficient yet. -->
237 <delete dir="${outputDir}" includes="*,**/*" />
240 <target name="distclean" depends="init, clean">
242 <echo message="REMOVING ALL BACKUP/AUTOSAVES!" />
245 <include name="${outputJar}" />
246 <include name="#*#" />
247 <include name="#*.*#" />
248 <include name="**/#*#" />
249 <include name="**/#*.*#" />
250 <include name="*~" />
251 <include name="*.*~" />
252 <include name="**/*~" />
253 <include name="**/*.*~" />
258 <target name="prepare" depends="init">
259 <mkdir dir="${outputDir}" />
260 <copy todir="${outputDir}">
262 <include name="${docDir}/**/*.*" />
263 <include name="${helpDir}/**/*.*" />
264 <include name="${libDir}/*.jar" />
266 <fileset dir="${resourceDir}">
267 <include name="**/*.*" />
272 <target name="build" depends="prepare">
273 <!-- not efficient yet. -->
274 <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="build.classpath">
275 <exclude name="jalview/*applet*" />
276 <exclude name="jalview/appletgui/**" />
277 <exclude name="com/stevesoft/**" />
282 <target name="testclean" depends="init">
283 <delete dir="${testOutputDir}" includes="*,**/*" />
286 <target name="prepareTests" depends="init,testclean">
287 <mkdir dir="${testOutputDir}" />
290 <target name="buildTests" depends="build,buildindices,prepareTests">
291 <javac source="${javac.source}" target="${javac.target}" srcdir="${testDir}" destdir="${testOutputDir}" debug="${javac.debug}" classpathref="test.classpath" includeantruntime="false">
295 <taskdef resource="testngtasks" classpath="utils/testnglibs/testng.jar" />
297 <target name="testng" depends="buildTests">
298 <testng outputDir="${reportDir}" haltOnFailure="false" groups="${testng-groups}" mode="testng"
301 <pathelement location="${testOutputDir}" />
302 <path refid="test.classpath" />
304 <jvmarg value="--add-modules=java.se.ee" if:set="java9"/>
305 <jvmarg value="--illegal-access=warn" if:set="java9"/>
306 <classfileset dir="${testOutputDir}" includes="**/*.class" />
310 <target name="buildindices" depends="init, prepare" unless="help.uptodate">
311 <replace value="${JALVIEW_VERSION}">
312 <replacetoken><![CDATA[$$Version-Rel$$]]></replacetoken>
313 <fileset dir="${outputDir}/${helpDir}">
314 <include name="help.jhm" />
318 <java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
323 <target name="preparejnlp" depends="makedist">
324 <copy todir="${packageDir}">
325 <fileset dir="${resourceDir}/images">
326 <include name="${WebStartImage}" />
330 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties" />
332 <!-- create a dummy jar which will eventually contain the jnlp template -->
333 <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
334 <fileset dir="${packageDir}">
335 <include name="jalview.jar" />
339 <mkdir dir="${packageDir}/JNLP-INF" />
340 <antcall target="writejnlpf">
341 <param name="jnlpFile" value="${packageDir}/JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
342 <param name="inih" value="*" />
343 <param name="maxh" value="*" />
346 <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
347 <fileset dir="${packageDir}">
348 <include name="JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
352 <antcall target="writejnlpf">
353 <param name="jnlpFile" value="${packageDir}/jalview.jnlp" />
354 <param name="inih" value="10M" />
355 <param name="maxh" value="256M" />
358 <antcall target="writejnlpf">
359 <param name="jnlpFile" value="${packageDir}/jalview_1G.jnlp" />
360 <param name="inih" value="128M" />
361 <param name="maxh" value="512M" />
364 <antcall target="writejnlpf">
365 <param name="jnlpFile" value="${packageDir}/jalview_2G.jnlp" />
366 <param name="inih" value="256M" />
367 <param name="maxh" value="1024M" />
370 <!-- finally, need to postprocess to add in associations at end of 'information' element
372 <xslt in="${packageDir}/jalview_noa_1G.jnlp" out="${packageDir}/jalview_1G.jnlp">
379 <association mime-type="application-x/ext-file" extensions="fa"/>
380 <association mime-type="application-x/ext-file" extensions="fasta"/>
381 <association mime-type="application-x/ext-file" extensions="mfa"/>
382 <association mime-type="application-x/ext-file" extensions="fastq"/>
383 <association mime-type="application-x/ext-file" extensions="blc"/>
384 <association mime-type="application-x/ext-file" extensions="msf"/>
385 <association mime-type="application-x/ext-file" extensions="pfam"/>
386 <association mime-type="application-x/ext-file" extensions="aln"/>
387 <association mime-type="application-x/ext-file" extensions="pir"/>
388 <association mime-type="application-x/ext-file" extensions="amsa"/>
389 <association mime-type="application-x/ext-file" extensions="stk"/>
390 <association mime-type="application-x/ext-file" extensions="jar"/>-->
393 <target name="-jarsignwithtsa" depends="makedist,preparejnlp" if="timestamp">
394 <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}"
395 tsaproxyhost="${proxyHost}" tsaproxyport="${proxyPort}" tsaurl="${jalview.tsaurl}">
396 <fileset dir="${packageDir}">
397 <include name="*.jar" />
401 <target name="-jarsignnotsa" depends="makedist,preparejnlp" unless="timestamp">
402 <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}">
403 <fileset dir="${packageDir}">
404 <include name="*.jar" />
409 <target name="makefulldist" depends="makedist,preparejnlp,-jarsignwithtsa,-jarsignnotsa">
410 <!-- and sign the jars -->
411 <!-- the default keystore details might need to be edited here -->
414 <target name="runenv" depends="init">
415 <path id="run.classpath">
416 <pathelement location="${outputDir}" />
417 <fileset dir="${outputDir}">
418 <include name="${libDir}/*.jar" />
421 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath" />
423 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
427 <target name="-generatejnlpf">
428 <presetdef name="jnlpf">
429 <jnlp codebase="${WebStartLocation}">
431 <title>Jalview</title>
432 <vendor>The Barton Group</vendor>
433 <homepage href="http://www.jalview.org" />
434 <description>Jalview Multiple Alignment Editor</description>
435 <description kind="short">Jalview</description>
436 <icon href="${WebStartImage}" />
440 <j2se version="1.8+" />
441 <jar main="true" href="jalview.jar"/>
442 <fileset dir="${packageDir}">
443 <exclude name="jalview.jar" />
444 <include name="*.jar" />
445 <include name="*_*.jar" />
446 <exclude name="*quaqua*.jar" />
448 <property name="jalview.version" value="${JALVIEW_VERSION}" />
450 <resources os="Mac OS X">
451 <fileset dir="${packageDir}">
452 <include name="quaqua-filechooser-only-8.0.jar"/>
453 <include name="*quaqua64*.jnilib.jar" />
457 <application_desc main_class="jalview.bin.Jalview">
465 <jnlpf toFile="${jnlpFile}" />
466 <!-- add the add-modules j2se attribute for java 9 -->
467 <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"">
468 <replacetoken>j2se version="1.8+"</replacetoken>
472 <target name="-dofakejnlpfileassoc" depends="-generatejnlpf" if="nojnlpfileassocs">
473 <echo message="Not adding JNLP File Associations" />
476 <target name="-dojnlpfileassoc" depends="-generatejnlpf" unless="nojnlpfileassocs">
477 <replace file="${jnlpFile}">
479 <![CDATA[</information>]]></replacetoken>
482 <association mime-type="application-x/ext-file" extensions="fa" />
483 <association mime-type="application-x/ext-file" extensions="fasta" />
484 <association mime-type="application-x/ext-file" extensions="mfa" />
485 <association mime-type="application-x/ext-file" extensions="fastq" />
486 <association mime-type="application-x/ext-file" extensions="blc" />
487 <association mime-type="application-x/ext-file" extensions="msf" />
488 <association mime-type="application-x/ext-file" extensions="pfam" />
489 <association mime-type="application-x/ext-file" extensions="aln"/>
490 <association mime-type="application-x/ext-file" extensions="pir"/>
491 <association mime-type="application-x/ext-file" extensions="amsa"/>
492 <association mime-type="application-x/ext-file" extensions="stk"/>
493 <association mime-type="application-x/ext-file" extensions="jvp"/>
494 </information>]]></replacevalue>
496 <echo message="Added file associations to JNLP file" />
498 <target name="writejnlpf" depends="-dojnlpfileassoc,-dofakejnlpfileassoc">
501 <target name="buildextclients" depends="init">
502 <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" />
503 <condition property="dontextbuild">
504 <equals arg1="n" arg2="${doextbuild.response}" />
506 <condition property="dontextbuild">
507 <equals arg1="N" arg2="${doextbuild.response}" />
509 <fail if="dontextbuild">
510 Build External Client Code process aborted by user. Jalview source is unchanged.
512 <!-- Currently, this doesn't happen automatically.
513 1. Run WSDL2Java as below, which generates an ext.vamsas +
514 vamsas.<datapackages> fileset.
515 2. refactor ext.vamsas.SpecificserviceWS* to
516 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
517 3. Update the jalview.ws.*WServices classes to reflect the
518 interface type, and all locations of this wsdl type that Jalview
522 <path id="axisbuild">
523 <path refid="build.classpath" />
525 <taskdef resource="axis-tasks.properties" classpathref="axisbuild" />
527 <fileset dir="${sourceDir}" id="client">
528 <include name="${wsdl.ClientNS}/*.*" />
532 <axis-wsdl2java output="${sourceDir}" verbose="true" url="${wsdl.MsaWS2}" serverside="false" deployscope="Request" debug="false" helpergen="true" all="true">
534 <mapping namespace="${wsdl.Namespace}" package="${wsdl.ClientNS}" />
535 <mapping namespace="http://dataTypes.vamsas" package="${wsdl.ClientNS}" />
540 <target name="makedist" depends="build, buildPropertiesFile, linkcheck, buildindices">
541 <!-- make the package jar if not already existing -->
542 <mkdir dir="${packageDir}" />
543 <!-- clean dir if it already existed -->
545 <fileset dir="${packageDir}">
546 <include name="*.jar" />
549 <jar destfile="${packageDir}/${outputJar}" index="true">
551 <attribute name="Main-Class" value="jalview.bin.Jalview" />
552 <attribute name="Permissions" value="all-permissions" />
553 <attribute name="Application-Name" value="Jalview Desktop" />
554 <attribute name="Codebase" value="${application.codebase}" />
556 <fileset dir="${outputDir}/">
557 <exclude name="cache*/**" />
558 <exclude name="*.jar" />
559 <exclude name="*.jar.*" />
560 <exclude name="**/*.jar" />
561 <exclude name="**/*.jar.*" />
565 <copy toDir="${packageDir}" flatten="true">
566 <fileset dir="${outputDir}">
567 <include name="*.jar" />
568 <include name="**/*.jar" />
574 <!-- jalopy code reformatter -->
575 <target name="sourcescrub" depends="init,build">
576 <jalopy destdir="jsrc" classpathref="run.classpath" convention="jalview-jalopy.xml">
577 <fileset dir="${sourceDir}">
578 <include name="*.java" />
579 <include name="**/*.java" />
580 <include name="**/**/*.java" />
587 <!-- Compile, package and obfuscate Jalview Applet -->
588 <target name="makeApplet" depends="obfuscate" description="assemble the final jalviewLite applet jar with or without obfuscation" />
590 <target name="compileApplet" depends="init,clean">
591 <mkdir dir="${outputDir}" />
592 <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/**" />
595 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
596 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
597 <copy todir="${outputDir}/lang">
598 <fileset dir="${resourceDir}/lang">
599 <include name="**.*" />
602 <jar destfile="in.jar" index="true">
604 <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
605 <attribute name="Application-Name" value="JalviewLite" />
606 <attribute name="Codebase" value="${applet.codebase}" />
608 <fileset dir="${outputDir}">
609 <include name="com/**" />
610 <include name="MCview/**" />
611 <include name="jalview/**" />
612 <include name=".build_properties" />
613 <include name="images/link.gif" />
614 <include name="lang/**" />
618 <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally">
620 <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
621 <copy file="in.jar" tofile="${jalviewLiteJar}" overwrite="true" />
622 <delete file="in.jar" />
624 <target name="-obfuscatereally" unless="donotobfuscate">
626 <path id="obfuscateDeps.path">
627 <pathelement location="${applet.jre.tools}" />
628 <pathelement location="appletlib/${jmolJar}" />
629 <pathelement location="lib/${varnaJar}" />
630 <pathelement location="appletlib/${jsoup}" />
631 <pathelement location="appletlib/${jsonSimple}" />
632 <pathelement location="appletlib/${javaJson}" />
633 <fileset dir="${java.home}/lib">
634 <include name="plugin.jar" />
637 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard_5.3.3.jar" />
639 <proguard verbose="true" >
640 <injar file="in.jar" />
641 <outjar file="${jalviewLiteJar}" />
642 <libraryjar refid="obfuscateDeps.path" />
644 <keep access="public" type="class" name="jalview.bin.JalviewLite">
645 <field access="public" />
646 <method access="public" />
647 <constructor access="public" />
649 <keep access="public" type="class" name="jalview.appletgui.AlignFrame">
650 <field access="public" />
651 <method access="public" />
652 <constructor access="public" />
655 <keep name="jalview.json.binding**">
660 <keep access="public" type="class" name="MCview.PDBfile">
661 <field access="public" />
662 <method access="public" />
663 <constructor access="public" />
666 <keep access="public" type="class" name="jalview.ws.jws1.Annotate3D">
667 <field access="public" />
668 <method access="public" />
669 <constructor access="public" />
672 <keep access="public" type="class" name="jalview.ext.jmol.JmolParser">
673 <field access="public" />
674 <method access="public" />
675 <constructor access="public" />
679 <!-- -libraryjars "${obfuscateDeps}"
681 -outjars jalviewApplet.jar
682 -keep public class jalview.bin.JalviewLite
685 <delete file="in.jar" />
688 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
689 <taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask" classpathref="build.classpath" />
691 <fileset dir="${sourceDir}/jalview/schemabinding/version2">
692 <include name="*.java" />
693 <include name="descriptors/*.java" />
696 <castor-srcgen file="${schemaDir}/vamsas.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
697 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
698 <castor-srcgen file="${schemaDir}/JalviewWsParamSet.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
699 <castor-srcgen file="${schemaDir}/jalview.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
701 now build the jalview.binding package with the old schema set
704 <fileset dir="${sourceDir}/jalview/binding/">
705 <include name="**" />
708 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
709 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
710 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
712 <target name="sourcedist" description="create jalview source distribution" depends="init">
713 <delete file="${source.dist.name}" />
714 <!-- temporary copy of source to update timestamps -->
715 <copy todir="_sourcedist">
717 <exclude name=".*" />
718 <exclude name="**/.*" />
719 <exclude name="*.class" />
720 <exclude name="**/*.class" />
721 <include name="LICENSE" />
722 <include name="README" />
723 <include name="build.xml" />
724 <include name="jalview-jalopy.xml" />
725 <include name="JalviewApplet.jpx" />
726 <include name="JalviewX.jpx" />
727 <include name="nbbuild.xml" />
728 <include name="nbproject/genfiles.properties" />
729 <include name="nbproject/project.properties" />
730 <include name="nbproject/project.xml" />
731 <include name="${sourceDir}/*.java" />
732 <include name="${sourceDir}/**/*.java" />
733 <include name="${sourceDir}/**/*.cdr" />
734 <include name="${libDir}/**/*" />
735 <include name="${resourceDir}/**/*" />
736 <include name="${helpDir}/**/*" />
737 <include name="appletlib/${jmolJar}" />
738 <include name="appletlib/${jsonSimple}" />
739 <include name="appletlib/${javaJson}" />
740 <exclude name="**/*locales" />
741 <exclude name="*locales/**" />
742 <exclude name="utils/InstallAnywhere/**Build.iap_xml" />
743 <exclude name="utils/InstallAnywhere/**Build*/**" />
744 <exclude name="utils/InstallAnywhere/**Build*/**" />
745 <exclude name="utils/InstallAnywhere/.build*.*/**" />
746 <exclude name="utils/InstallAnywhere/**locale*" />
747 <exclude name="utils/InstallAnywhere/**locale*/**" />
748 <exclude name="utils/InstallAnywhere/**locale*/**" />
749 <include name="${schemaDir}/**/*" />
750 <include name="utils/**/*" />
751 <include name="${docDir}/**/*" />
752 <include name="examples/**/*" />
756 <tstamp prefix="build">
757 <format property="year" pattern="yyyy" />
759 <!-- each replacetoken CDATA body must be on one line -
760 otherwise the pattern doesn't match -->
761 <replace value="${JALVIEW_VERSION}">
762 <replacetoken><![CDATA[$$Version-Rel$$]]></replacetoken>
763 <fileset dir="_sourcedist">
764 <include name="**/*" />
767 <replace dir="_sourcedist" value="${build.year}">
768 <replacetoken><![CDATA[$$Year-Rel$$]]></replacetoken>
769 <fileset dir="_sourcedist">
770 <include name="**/*" />
774 <tar destfile="${source.dist.name}" compression="gzip">
775 <tarfileset dir="_sourcedist/" prefix="jalview" preserveLeadingSlashes="true">
779 <delete dir="_sourcedist" />
781 <target name="prepubapplet_1" depends="makeApplet">
782 <copy todir="${packageDir}/examples">
783 <fileset dir="examples">
784 <include name="**/*" />
785 <include name="javascript/*" />
786 <include name="jmol/*" />
789 <include name="${jalviewLiteJar}" />
791 <fileset dir="appletlib">
792 <include name="**/*" />
795 <jar update="true" index="true" jarfile="${packageDir}/examples/${jalviewLiteJar}" />
796 <jar update="true" index="true" jarfile="${packageDir}/examples/${javaJson}" />
797 <jar update="true" index="true" jarfile="${packageDir}/examples/${jsonSimple}" />
798 <jar update="true" index="true" jarfile="${packageDir}/examples/${jmolJar}">
800 <attribute name="Application-Name" value="Jmol (bundled with JalviewLite)" />
801 <!-- <attribute name="Permissions" value="sandbox" /> -->
802 <!--<attribute name="Trusted-Lib" value="true" /> -->
803 <attribute name="Codebase" value="${applet.codebase}" />
804 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
808 <presetdef name="ap_applet.jar">
809 <!-- build a signed applet with 'all-permissions' -
810 Needs 'param name="permissions' value="all-permissions"' in applet tag
811 JalviewLite+JmolApplet linked sequence/structure fails
812 Mixed code warnings are raised
814 <jar update="true" index="true">
816 <attribute name="Application-Name" value="JalviewLite" />
817 <attribute name="Permissions" value="all-permissions" />
818 <attribute name="Codebase" value="${applet.codebase}" />
819 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
820 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
824 <presetdef name="applet.jar">
825 <!-- build signed applet with sandbox permissions -
826 Needs 'param name="permissions' value="sandbox"' in applet tag
827 Preserves Pre-Java 1.7_u45 behavior once 'permissions' parameter added to applet tag
830 <jar update="true" index="true">
832 <attribute name="Application-Name" value="JalviewLite" />
833 <attribute name="Permissions" value="sandbox" />
834 <attribute name="Codebase" value="${applet.codebase}" />
835 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
836 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
840 <presetdef name="tl_applet.jar">
841 <!-- build signed applet with trusted library/trusted permissions -
842 Needs 'param name="permissions' value="all-permissions"' in applet tag
844 No mixed code warnings raised
845 Jmol/JalviewLite sequence/structure example doesn't link structures
846 Raises dialog asking user to allow page to control applet via LiveConnect javascript
850 <jar update="true" index="true">
852 <attribute name="Application-Name" value="JalviewLite" />
853 <attribute name="Permissions" value="all-permissions" />
854 <attribute name="Codebase" value="${applet.codebase}" />
855 <attribute name="Trusted-Only" value="true" />
856 <attribute name="Trusted-Library" value="true" />
860 <presetdef name="to_applet.jar">
861 <!-- not fully test variant (yet) -->
862 <jar update="true" index="true">
864 <attribute name="Application-Name" value="JalviewLite" />
865 <attribute name="Permissions" value="all-permissions" />
866 <attribute name="Codebase" value="${applet.codebase}" />
867 <attribute name="Trusted-Only" value="true" />
871 <!-- create differently privileged artefacts -->
872 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/u_${jalviewLiteJar}" />
873 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
874 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true" />
875 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true" />
876 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/ap_${jalviewLiteJar}" />
877 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/ap_${jmolJar}" />
878 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/ap_${javaJson}" />
879 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/ap_${jsonSimple}" />
880 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jalviewLiteJar}" />
881 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jmolJar}" />
882 <ap_applet.jar jarfile="${packageDir}/examples/ap_${javaJson}" />
883 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jsonSimple}" />
884 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/tl_${jalviewLiteJar}" />
885 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/tl_${jmolJar}" />
886 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/tl_${javaJson}" />
887 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/tl_${jsonSimple}" />
888 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jalviewLiteJar}" />
889 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jmolJar}" />
890 <tl_applet.jar jarfile="${packageDir}/examples/tl_${javaJson}" />
891 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jsonSimple}" />
892 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/to_${jalviewLiteJar}" />
893 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/to_${jmolJar}" />
894 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/to_${javaJson}" />
895 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/to_${jsonSimple}" />
896 <to_applet.jar jarfile="${packageDir}/examples/to_${jalviewLiteJar}" />
897 <to_applet.jar jarfile="${packageDir}/examples/to_${jmolJar}" />
898 <to_applet.jar jarfile="${packageDir}/examples/to_${javaJson}" />
899 <to_applet.jar jarfile="${packageDir}/examples/to_${jsonSimple}" />
900 <!-- finally, create manifest for original jars -->
901 <applet.jar jarfile="${packageDir}/examples/${jalviewLiteJar}" />
902 <applet.jar jarfile="${packageDir}/examples/${jmolJar}" />
903 <applet.jar jarfile="${packageDir}/examples/${javaJson}" />
904 <applet.jar jarfile="${packageDir}/examples/${jsonSimple}" />
906 <!-- todo - write examples/downloads for alternate versions of the applet
907 probably don't need to do this now since we don't have alternate versions anymore !-->
909 <target name="-signapplet" depends="prepubapplet_1">
910 <fileset id="signappletjarset" dir="${packageDir}/examples">
911 <exclude name="u_*.jar" />
912 <include name="${jalviewLiteJar}" />
913 <include name="${jmolJar}" />
914 <include name="${javaJson}" />
915 <include name="${jsonSimple}" />
916 <include name="to_${jalviewLiteJar}" />
917 <include name="to_${jmolJar}" />
918 <include name="to_${javaJson}" />
919 <include name="to_${jsonSimple}" />
920 <include name="tl_${jalviewLiteJar}" />
921 <include name="tl_${jmolJar}" />
922 <include name="tl_${javaJson}" />
923 <include name="tl_${jsonSimple}" />
924 <include name="ap_${jalviewLiteJar}" />
925 <include name="ap_${jmolJar}" />
926 <include name="ap_${javaJson}" />
927 <include name="ap_${jsonSimple}" />
930 <target name="-signappletnotsa" unless="timestamp" depends="-signapplet">
931 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
932 <fileset refid="signappletjarset" />
936 <target name="-signapplettsa" if="timestamp" depends="-signapplet">
937 <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}">
938 <fileset refid="signappletjarset" />
942 <target name="signApplet" description="internal target to sign applet" depends="-signappletnotsa,-signapplettsa" />
944 <target name="pubapplet" description="installs the jalviewLite applet and dependent jars into an applet examples directory built under ${outputDir}" depends="makeApplet, signApplet">
946 <!-- bizarre bug causes JmolApplet to always get signed, even if excluded from above. so copy explicitly -->
947 <copy file="appletlib/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
948 <copy file="appletlib/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true" />
949 <copy file="appletlib/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true" />
950 <!-- finally, replace any launchApp servlet tags with a version specification -->
951 <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}"">
953 <![CDATA[http://www.jalview.org/services/launchApp"]]>
955 <fileset dir="${packageDir}/examples">
956 <include name="**/*.html" />
959 <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}'">
961 <![CDATA[http://www.jalview.org/services/launchApp']]>
963 <fileset dir="${packageDir}/examples">
964 <include name="**/*.html" />
969 <target name="sourcedoc" description="Create jalview source documentation pages" depends="init">
970 <javadoc destdir="${javadocDir}">
971 <packageset dir="${sourceDir}" includes="jalview/*,MCView/*">
975 <target name="linkcheck" depends="init,prepare">
976 <javac srcdir="utils" destdir="utils" includes="HelpLinksChecker.java"/>
977 <java fork="true" dir="${helpDir}" classpath="utils" classname="HelpLinksChecker" failonerror="true">
978 <arg file="${helpDir}"/>
979 <arg value="-nointernet"/>