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" unless:set="clover.jar"/>
138 <property name="outputDir" value="cloverclasses" if:set="clover.jar"/>
139 <property name="packageDir" value="dist" />
140 <property name="outputJar" value="jalview.jar" />
141 <!-- Jalview Applet JMol Jar Dependency -->
142 <property name="jmolJar" value="JmolApplet-14.6.4_2016.10.26.jar" />
143 <property name="varnaJar" value="VARNAv3-93.jar" />
144 <property name="jsoup" value="jsoup-1.8.1.jar" />
145 <property name="jsonSimple" value="json_simple-1.1.jar" />
146 <property name="javaJson" value="java-json.jar" />
147 <property name="jalviewLiteJar" value="jalviewApplet.jar" />
148 <property name="reportDir" value="test-reports" />
149 <property name="testDir" value="test" />
150 <property name="testOutputDir" value="tests" />
151 <property name="cloverOutputDir" value="clover" if:set="clover.jar" />
152 <!-- switch to indicate if we should obfuscate jalviewLite -->
153 <!-- <property name="donotobfuscate" value="true"/> -->
154 <!-- switch to exclude associations from generated jnlp files -->
155 <!-- <property name="nojnlpfileassocs" value="true"/> -->
157 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
158 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
159 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
160 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
161 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
162 <property name="WSInterf" value="MsaWS" />
163 <property name="wsdl.Namespace" value="vamsas" />
164 <property name="wsdl.ClientNS" value="ext.vamsas" />
165 <!-- the class path for building the application -->
166 <path id="build.classpath">
167 <fileset dir="utils">
168 <include name="*.jar" />
169 <include name="**/*.jar" />
171 <fileset dir="${libDir}">
172 <include name="*.jar" />
173 <include name="**/*.jar" />
175 <fileset dir="${java.home}/lib">
176 <include name="plugin.jar" />
178 <fileset dir="appletlib">
179 <!-- the JmolApplet includes the JmolApplet console and the application javac seems to always try and build all packages
181 <include name="${jmolJar}" />
182 <include name="${varnaJar}" />
185 <path id="test.classpath">
186 <pathelement path="${outputDir}" />
187 <path refid="build.classpath" />
189 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
190 <!-- The Location of the java 1.1.8 jdk -->
191 <property name="java118.home" value="${java.home}" />
192 <!-- jre for 1.4 version -->
193 <property name="applet.jre.tools" value="${java118.home}/lib/rt.jar" />
195 <!-- the classpath for building the 1.1 applet -->
196 <path id="jalviewlite.deps">
197 <fileset dir="${java118.home}">
198 <include name="lib/rt.jar" />
200 <fileset dir="${java.home}/lib">
201 <include name="plugin.jar" />
203 <pathelement location="appletlib/${jmolJar}" />
204 <pathelement location="lib/${varnaJar}" />
205 <pathelement location="appletlib/${jsoup}" />
206 <pathelement location="appletlib/${jsonSimple}" />
207 <pathelement location="appletlib/${javaJson}" />
210 <!-- default location for outputting javadoc -->
211 <property name="javadocDir" value="${packageDir}/javadoc" />
215 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties" />
216 <target name="buildPropertiesFile" depends="init">
217 <tstamp prefix="build">
218 <format property="date" pattern="dd MMMM yyyy" />
220 <exec executable="/usr/bin/git" outputproperty="git.commit" failifexecutionfails="false">
221 <arg value="rev-parse" />
222 <arg value="--short" />
225 <exec executable="/usr/bin/git" outputproperty="git.branch" failifexecutionfails="false">
226 <arg value="rev-parse" />
227 <arg value="--abbrev-ref" />
230 <properties file="${outputDir}/.build_properties">
232 ---Jalview Build Details---
234 <property name="VERSION" value="${JALVIEW_VERSION}" />
235 <property name="INSTALLATION" value="${INSTALLATION} git-commit:${git.commit} [${git.branch}]" />
236 <property name="BUILD_DATE" value="${build.date}" />
241 <target name="clean" depends="init">
242 <!-- not efficient yet. -->
243 <delete dir="${outputDir}" includes="*,**/*" />
246 <target name="distclean" depends="init, clean">
248 <echo message="REMOVING ALL BACKUP/AUTOSAVES!" />
251 <include name="${outputJar}" />
252 <include name="#*#" />
253 <include name="#*.*#" />
254 <include name="**/#*#" />
255 <include name="**/#*.*#" />
256 <include name="*~" />
257 <include name="*.*~" />
258 <include name="**/*~" />
259 <include name="**/*.*~" />
264 <target name="prepare" depends="init">
265 <mkdir dir="${outputDir}" />
266 <copy todir="${outputDir}">
268 <include name="${docDir}/**/*.*" />
269 <include name="${helpDir}/**/*.*" />
270 <include name="${libDir}/*.jar" />
272 <fileset dir="${resourceDir}">
273 <include name="**/*.*" />
276 <mkdir dir="${cloverOutputDir}" if:set="clover.jar"/>
279 <target name="build" depends="prepare">
280 <!-- not efficient yet. -->
281 <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="build.classpath">
282 <exclude name="jalview/*applet*" />
283 <exclude name="jalview/appletgui/**" />
284 <exclude name="com/stevesoft/**" />
289 <target name="testclean" depends="init">
290 <delete dir="${testOutputDir}" includes="*,**/*" />
293 <target name="prepareTests" depends="init,testclean">
294 <mkdir dir="${testOutputDir}" />
297 <target name="buildTests" depends="build,buildindices,prepareTests">
298 <javac source="${javac.source}" target="${javac.target}" srcdir="${testDir}" destdir="${testOutputDir}" debug="${javac.debug}" classpathref="test.classpath" includeantruntime="false">
302 <taskdef resource="testngtasks" classpath="utils/testnglibs/testng.jar" />
304 <target name="testng" depends="buildTests">
305 <testng outputDir="${reportDir}" haltOnFailure="false" groups="${testng-groups}" mode="testng"
308 <pathelement location="${testOutputDir}" />
309 <pathelement location="${clover.jar}" if:set="clover.jar"/>
310 <path refid="test.classpath" />
312 <jvmarg value="--add-modules=java.se.ee" if:set="java9"/>
313 <jvmarg value="--illegal-access=warn" if:set="java9"/>
314 <classfileset dir="${testOutputDir}" includes="**/*.class" />
318 <target name="buildindices" depends="init, prepare" unless="help.uptodate">
319 <replace value="${JALVIEW_VERSION}">
321 <![CDATA[$$Version-Rel$$]]>
323 <fileset dir="${outputDir}/${helpDir}">
324 <include name="help.jhm" />
328 <java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
333 <target name="preparejnlp" depends="makedist">
334 <copy todir="${packageDir}">
335 <fileset dir="${resourceDir}/images">
336 <include name="${WebStartImage}" />
340 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties" />
342 <!-- create a dummy jar which will eventually contain the jnlp template -->
343 <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
344 <fileset dir="${packageDir}">
345 <include name="jalview.jar" />
349 <mkdir dir="${packageDir}/JNLP-INF" />
350 <antcall target="writejnlpf">
351 <param name="jnlpFile" value="${packageDir}/JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
352 <param name="inih" value="*" />
353 <param name="maxh" value="*" />
356 <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
357 <fileset dir="${packageDir}">
358 <include name="JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
362 <antcall target="writejnlpf">
363 <param name="jnlpFile" value="${packageDir}/jalview_256M.jnlp" />
364 <param name="inih" value="10M" />
365 <param name="maxh" value="256M" />
367 <antcall target="writejnlpf">
368 <param name="jnlpFile" value="${packageDir}/jalview.jnlp" />
369 <param name="inih" value="800M" />
370 <param name="maxh" value="1024M" />
373 <antcall target="writejnlpf">
374 <param name="jnlpFile" value="${packageDir}/jalview_1G.jnlp" />
375 <param name="inih" value="128M" />
376 <param name="maxh" value="512M" />
379 <antcall target="writejnlpf">
380 <param name="jnlpFile" value="${packageDir}/jalview_2G.jnlp" />
381 <param name="inih" value="800M" />
382 <param name="maxh" value="1024M" />
385 <!-- finally, need to postprocess to add in associations at end of 'information' element
387 <xslt in="${packageDir}/jalview_noa_1G.jnlp" out="${packageDir}/jalview_1G.jnlp">
394 <association mime-type="application-x/ext-file" extensions="fa"/>
395 <association mime-type="application-x/ext-file" extensions="fasta"/>
396 <association mime-type="application-x/ext-file" extensions="mfa"/>
397 <association mime-type="application-x/ext-file" extensions="fastq"/>
398 <association mime-type="application-x/ext-file" extensions="blc"/>
399 <association mime-type="application-x/ext-file" extensions="msf"/>
400 <association mime-type="application-x/ext-file" extensions="pfam"/>
401 <association mime-type="application-x/ext-file" extensions="aln"/>
402 <association mime-type="application-x/ext-file" extensions="pir"/>
403 <association mime-type="application-x/ext-file" extensions="amsa"/>
404 <association mime-type="application-x/ext-file" extensions="stk"/>
405 <association mime-type="application-x/ext-file" extensions="jar"/>-->
408 <target name="-jarsignwithtsa" depends="makedist,preparejnlp" if="timestamp" unless="nosign">
409 <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}"
410 tsaproxyhost="${proxyHost}" tsaproxyport="${proxyPort}" tsaurl="${jalview.tsaurl}">
411 <fileset dir="${packageDir}">
412 <include name="*.jar" />
416 <target name="-jarsignnotsa" depends="makedist,preparejnlp" if:blank="timestamp" unless="nosign">
417 <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}">
418 <fileset dir="${packageDir}">
419 <include name="*.jar" />
424 <target name="makefulldist" depends="makedist,preparejnlp,-jarsignwithtsa,-jarsignnotsa">
425 <!-- and sign the jars -->
426 <!-- the default keystore details might need to be edited here -->
429 <target name="runenv" depends="init">
430 <path id="run.classpath">
431 <pathelement location="${outputDir}" />
432 <fileset dir="${outputDir}">
433 <include name="${libDir}/*.jar" />
436 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath" />
438 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
442 <target name="-generatejnlpf">
443 <presetdef name="jnlpf">
444 <jnlp codebase="${WebStartLocation}">
446 <title>Jalview</title>
447 <vendor>The Barton Group</vendor>
448 <homepage href="http://www.jalview.org" />
449 <description>Jalview Multiple Alignment Editor</description>
450 <description kind="short">Jalview</description>
451 <icon href="${WebStartImage}" />
455 <j2se version="1.8+" />
456 <jar main="true" href="jalview.jar"/>
457 <fileset dir="${packageDir}">
458 <exclude name="jalview.jar" />
459 <include name="*.jar" />
460 <include name="*_*.jar" />
461 <exclude name="*quaqua*.jar" />
463 <property name="jalview.version" value="${JALVIEW_VERSION}" />
465 <resources os="Mac OS X">
466 <fileset dir="${packageDir}">
467 <include name="quaqua-filechooser-only-8.0.jar"/>
468 <include name="*quaqua64*.jnilib.jar" />
472 <application_desc main_class="jalview.bin.Jalview">
480 <jnlpf toFile="${jnlpFile}" />
481 <!-- add the add-modules j2se attribute for java 9 -->
482 <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"">
483 <replacetoken>j2se version="1.8+"</replacetoken>
487 <target name="-dofakejnlpfileassoc" depends="-generatejnlpf" if="nojnlpfileassocs">
488 <echo message="Not adding JNLP File Associations" />
491 <target name="-dojnlpfileassoc" depends="-generatejnlpf" unless="nojnlpfileassocs">
492 <replace file="${jnlpFile}">
494 <![CDATA[</information>]]></replacetoken>
497 <association mime-type="application-x/ext-file" extensions="fa" />
498 <association mime-type="application-x/ext-file" extensions="fasta" />
499 <association mime-type="application-x/ext-file" extensions="mfa" />
500 <association mime-type="application-x/ext-file" extensions="fastq" />
501 <association mime-type="application-x/ext-file" extensions="blc" />
502 <association mime-type="application-x/ext-file" extensions="msf" />
503 <association mime-type="application-x/ext-file" extensions="pfam" />
504 <association mime-type="application-x/ext-file" extensions="aln"/>
505 <association mime-type="application-x/ext-file" extensions="pir"/>
506 <association mime-type="application-x/ext-file" extensions="amsa"/>
507 <association mime-type="application-x/ext-file" extensions="stk"/>
508 <association mime-type="application-x/ext-file" extensions="jvp"/>
509 </information>]]></replacevalue>
511 <echo message="Added file associations to JNLP file" />
513 <target name="writejnlpf" depends="-dojnlpfileassoc,-dofakejnlpfileassoc">
516 <target name="buildextclients" depends="init">
517 <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" />
518 <condition property="dontextbuild">
519 <equals arg1="n" arg2="${doextbuild.response}" />
521 <condition property="dontextbuild">
522 <equals arg1="N" arg2="${doextbuild.response}" />
524 <fail if="dontextbuild">
525 Build External Client Code process aborted by user. Jalview source is unchanged.
527 <!-- Currently, this doesn't happen automatically.
528 1. Run WSDL2Java as below, which generates an ext.vamsas +
529 vamsas.<datapackages> fileset.
530 2. refactor ext.vamsas.SpecificserviceWS* to
531 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
532 3. Update the jalview.ws.*WServices classes to reflect the
533 interface type, and all locations of this wsdl type that Jalview
537 <path id="axisbuild">
538 <path refid="build.classpath" />
540 <taskdef resource="axis-tasks.properties" classpathref="axisbuild" />
542 <fileset dir="${sourceDir}" id="client">
543 <include name="${wsdl.ClientNS}/*.*" />
547 <axis-wsdl2java output="${sourceDir}" verbose="true" url="${wsdl.MsaWS2}" serverside="false" deployscope="Request" debug="false" helpergen="true" all="true">
549 <mapping namespace="${wsdl.Namespace}" package="${wsdl.ClientNS}" />
550 <mapping namespace="http://dataTypes.vamsas" package="${wsdl.ClientNS}" />
555 <target name="makedist" depends="build, buildPropertiesFile, linkcheck, buildindices">
556 <fail if="clover.jar">
557 Ignoring request to build jalview distribution with clover-instrumented classes
559 <!-- make the package jar if not already existing -->
560 <mkdir dir="${packageDir}" />
561 <!-- clean dir if it already existed -->
563 <fileset dir="${packageDir}">
564 <include name="*.jar" />
567 <jar destfile="${packageDir}/${outputJar}" index="true">
569 <attribute name="Main-Class" value="jalview.bin.Jalview" />
570 <attribute name="Permissions" value="all-permissions" />
571 <attribute name="Application-Name" value="Jalview Desktop" />
572 <attribute name="Codebase" value="${application.codebase}" />
574 <fileset dir="${outputDir}/">
575 <exclude name="cache*/**" />
576 <exclude name="*.jar" />
577 <exclude name="*.jar.*" />
578 <exclude name="**/*.jar" />
579 <exclude name="**/*.jar.*" />
583 <copy toDir="${packageDir}" flatten="true">
584 <fileset dir="${outputDir}">
585 <include name="*.jar" />
586 <include name="**/*.jar" />
592 <!-- jalopy code reformatter -->
593 <target name="sourcescrub" depends="init,build">
594 <jalopy destdir="jsrc" classpathref="run.classpath" convention="jalview-jalopy.xml">
595 <fileset dir="${sourceDir}">
596 <include name="*.java" />
597 <include name="**/*.java" />
598 <include name="**/**/*.java" />
605 <!-- Compile, package and obfuscate Jalview Applet -->
606 <target name="makeApplet" depends="obfuscate" description="assemble the final jalviewLite applet jar with or without obfuscation" />
608 <target name="compileApplet" depends="init,clean">
609 <mkdir dir="${outputDir}" />
610 <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/**" />
613 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
614 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
615 <copy todir="${outputDir}/lang">
616 <fileset dir="${resourceDir}/lang">
617 <include name="**.*" />
620 <jar destfile="in.jar" index="true">
622 <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
623 <attribute name="Application-Name" value="JalviewLite" />
624 <attribute name="Codebase" value="${applet.codebase}" />
626 <fileset dir="${outputDir}">
627 <include name="com/**" />
628 <include name="MCview/**" />
629 <include name="jalview/**" />
630 <include name=".build_properties" />
631 <include name="images/link.gif" />
632 <include name="lang/**" />
636 <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally">
638 <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
639 <copy file="in.jar" tofile="${jalviewLiteJar}" overwrite="true" />
640 <delete file="in.jar" />
642 <target name="-obfuscatereally" unless="donotobfuscate">
644 <path id="obfuscateDeps.path">
645 <pathelement location="${applet.jre.tools}" />
646 <pathelement location="appletlib/${jmolJar}" />
647 <pathelement location="lib/${varnaJar}" />
648 <pathelement location="appletlib/${jsoup}" />
649 <pathelement location="appletlib/${jsonSimple}" />
650 <pathelement location="appletlib/${javaJson}" />
651 <fileset dir="${java.home}/lib">
652 <include name="plugin.jar" />
655 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard_5.3.3.jar" />
657 <proguard verbose="true" >
658 <injar file="in.jar" />
659 <outjar file="${jalviewLiteJar}" />
660 <libraryjar refid="obfuscateDeps.path" />
662 <keep access="public" type="class" name="jalview.bin.JalviewLite">
663 <field access="public" />
664 <method access="public" />
665 <constructor access="public" />
667 <keep access="public" type="class" name="jalview.appletgui.AlignFrame">
668 <field access="public" />
669 <method access="public" />
670 <constructor access="public" />
673 <keep name="jalview.json.binding**">
678 <keep access="public" type="class" name="MCview.PDBfile">
679 <field access="public" />
680 <method access="public" />
681 <constructor access="public" />
684 <keep access="public" type="class" name="jalview.ws.jws1.Annotate3D">
685 <field access="public" />
686 <method access="public" />
687 <constructor access="public" />
690 <keep access="public" type="class" name="jalview.ext.jmol.JmolParser">
691 <field access="public" />
692 <method access="public" />
693 <constructor access="public" />
697 <!-- -libraryjars "${obfuscateDeps}"
699 -outjars jalviewApplet.jar
700 -keep public class jalview.bin.JalviewLite
703 <delete file="in.jar" />
706 <target name="jaxb-bindings" depends="init" description="Generates JAXB bindings for supported Jalview XML models (needs xjc on the path)">
708 <fileset dir="${sourceDir}/jalview/xml/binding/jalview">
709 <include name="*.java" />
712 <exec executable="xjc">
713 <arg value="${schemaDir}/jalview.xsd"/>
715 <arg value="${sourceDir}"/>
717 <arg value="jalview.xml.binding.jalview"/>
720 <fileset dir="${sourceDir}/jalview/xml/binding/embl">
721 <include name="*.java" />
725 <exec executable="xjc">
726 <arg value="${schemaDir}/embl.xsd"/>
728 <arg value="${sourceDir}"/>
730 <arg value="${schemaDir}/embl_bindings.xml"/>
732 <arg value="jalview.xml.binding.embl"/>
736 <fileset dir="${sourceDir}/jalview/xml/binding/uniprot">
737 <include name="*.java" />
741 <exec executable="xjc">
742 <arg value="${schemaDir}/uniprot.xsd"/>
744 <arg value="${sourceDir}"/>
746 <arg value="jalview.xml.binding.uniprot"/>
750 <target name="sourcedist" description="create jalview source distribution" depends="init">
751 <delete file="${source.dist.name}" />
752 <!-- temporary copy of source to update timestamps -->
753 <copy todir="_sourcedist">
755 <exclude name=".*" />
756 <exclude name="**/.*" />
757 <exclude name="*.class" />
758 <exclude name="**/*.class" />
759 <include name="LICENSE" />
760 <include name="README" />
761 <include name="build.xml" />
762 <include name="jalview-jalopy.xml" />
763 <include name="JalviewApplet.jpx" />
764 <include name="JalviewX.jpx" />
765 <include name="nbbuild.xml" />
766 <include name="nbproject/genfiles.properties" />
767 <include name="nbproject/project.properties" />
768 <include name="nbproject/project.xml" />
769 <include name="${sourceDir}/*.java" />
770 <include name="${sourceDir}/**/*.java" />
771 <include name="${sourceDir}/**/*.cdr" />
772 <include name="${libDir}/**/*" />
773 <include name="${resourceDir}/**/*" />
774 <include name="${helpDir}/**/*" />
775 <include name="appletlib/${jmolJar}" />
776 <include name="appletlib/${jsonSimple}" />
777 <include name="appletlib/${javaJson}" />
778 <exclude name="**/*locales" />
779 <exclude name="*locales/**" />
780 <exclude name="utils/InstallAnywhere/**Build.iap_xml" />
781 <exclude name="utils/InstallAnywhere/**Build*/**" />
782 <exclude name="utils/InstallAnywhere/**Build*/**" />
783 <exclude name="utils/InstallAnywhere/.build*.*/**" />
784 <exclude name="utils/InstallAnywhere/**locale*" />
785 <exclude name="utils/InstallAnywhere/**locale*/**" />
786 <exclude name="utils/InstallAnywhere/**locale*/**" />
787 <include name="${schemaDir}/**/*" />
788 <include name="utils/**/*" />
789 <include name="${docDir}/**/*" />
790 <include name="examples/**/*" />
794 <tstamp prefix="build">
795 <format property="year" pattern="yyyy" />
797 <!-- each replacetoken CDATA body must be on one line -
798 otherwise the pattern doesn't match -->
799 <replace value="${JALVIEW_VERSION}">
801 <![CDATA[$$Version-Rel$$]]>
803 <fileset dir="_sourcedist">
804 <include name="**/*" />
807 <replace dir="_sourcedist" value="${build.year}">
809 <![CDATA[$$Year-Rel$$]]>
811 <fileset dir="_sourcedist">
812 <include name="**/*" />
816 <tar destfile="${source.dist.name}" compression="gzip">
817 <tarfileset dir="_sourcedist/" prefix="jalview" preserveLeadingSlashes="true">
821 <delete dir="_sourcedist" />
823 <target name="prepubapplet_1" depends="makeApplet">
824 <copy todir="${packageDir}/examples">
825 <fileset dir="examples">
826 <include name="**/*" />
827 <include name="javascript/*" />
828 <include name="jmol/*" />
831 <include name="${jalviewLiteJar}" />
833 <fileset dir="appletlib">
834 <include name="**/*" />
837 <jar update="true" index="true" jarfile="${packageDir}/examples/${jalviewLiteJar}" />
838 <jar update="true" index="true" jarfile="${packageDir}/examples/${javaJson}" />
839 <jar update="true" index="true" jarfile="${packageDir}/examples/${jsonSimple}" />
840 <jar update="true" index="true" jarfile="${packageDir}/examples/${jmolJar}">
842 <attribute name="Application-Name" value="Jmol (bundled with JalviewLite)" />
843 <!-- <attribute name="Permissions" value="sandbox" /> -->
844 <!--<attribute name="Trusted-Lib" value="true" /> -->
845 <attribute name="Codebase" value="${applet.codebase}" />
846 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
850 <presetdef name="ap_applet.jar">
851 <!-- build a signed applet with 'all-permissions' -
852 Needs 'param name="permissions' value="all-permissions"' in applet tag
853 JalviewLite+JmolApplet linked sequence/structure fails
854 Mixed code warnings are raised
856 <jar update="true" index="true">
858 <attribute name="Application-Name" value="JalviewLite" />
859 <attribute name="Permissions" value="all-permissions" />
860 <attribute name="Codebase" value="${applet.codebase}" />
861 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
862 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
866 <presetdef name="applet.jar">
867 <!-- build signed applet with sandbox permissions -
868 Needs 'param name="permissions' value="sandbox"' in applet tag
869 Preserves Pre-Java 1.7_u45 behavior once 'permissions' parameter added to applet tag
872 <jar update="true" index="true">
874 <attribute name="Application-Name" value="JalviewLite" />
875 <attribute name="Permissions" value="sandbox" />
876 <attribute name="Codebase" value="${applet.codebase}" />
877 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
878 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
882 <presetdef name="tl_applet.jar">
883 <!-- build signed applet with trusted library/trusted permissions -
884 Needs 'param name="permissions' value="all-permissions"' in applet tag
886 No mixed code warnings raised
887 Jmol/JalviewLite sequence/structure example doesn't link structures
888 Raises dialog asking user to allow page to control applet via LiveConnect javascript
892 <jar update="true" index="true">
894 <attribute name="Application-Name" value="JalviewLite" />
895 <attribute name="Permissions" value="all-permissions" />
896 <attribute name="Codebase" value="${applet.codebase}" />
897 <attribute name="Trusted-Only" value="true" />
898 <attribute name="Trusted-Library" value="true" />
902 <presetdef name="to_applet.jar">
903 <!-- not fully test variant (yet) -->
904 <jar update="true" index="true">
906 <attribute name="Application-Name" value="JalviewLite" />
907 <attribute name="Permissions" value="all-permissions" />
908 <attribute name="Codebase" value="${applet.codebase}" />
909 <attribute name="Trusted-Only" value="true" />
913 <!-- create differently privileged artefacts -->
914 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/u_${jalviewLiteJar}" />
915 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
916 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true" />
917 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true" />
918 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/ap_${jalviewLiteJar}" />
919 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/ap_${jmolJar}" />
920 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/ap_${javaJson}" />
921 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/ap_${jsonSimple}" />
922 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jalviewLiteJar}" />
923 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jmolJar}" />
924 <ap_applet.jar jarfile="${packageDir}/examples/ap_${javaJson}" />
925 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jsonSimple}" />
926 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/tl_${jalviewLiteJar}" />
927 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/tl_${jmolJar}" />
928 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/tl_${javaJson}" />
929 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/tl_${jsonSimple}" />
930 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jalviewLiteJar}" />
931 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jmolJar}" />
932 <tl_applet.jar jarfile="${packageDir}/examples/tl_${javaJson}" />
933 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jsonSimple}" />
934 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/to_${jalviewLiteJar}" />
935 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/to_${jmolJar}" />
936 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/to_${javaJson}" />
937 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/to_${jsonSimple}" />
938 <to_applet.jar jarfile="${packageDir}/examples/to_${jalviewLiteJar}" />
939 <to_applet.jar jarfile="${packageDir}/examples/to_${jmolJar}" />
940 <to_applet.jar jarfile="${packageDir}/examples/to_${javaJson}" />
941 <to_applet.jar jarfile="${packageDir}/examples/to_${jsonSimple}" />
942 <!-- finally, create manifest for original jars -->
943 <applet.jar jarfile="${packageDir}/examples/${jalviewLiteJar}" />
944 <applet.jar jarfile="${packageDir}/examples/${jmolJar}" />
945 <applet.jar jarfile="${packageDir}/examples/${javaJson}" />
946 <applet.jar jarfile="${packageDir}/examples/${jsonSimple}" />
948 <!-- todo - write examples/downloads for alternate versions of the applet
949 probably don't need to do this now since we don't have alternate versions anymore !-->
951 <target name="-signapplet" depends="prepubapplet_1">
952 <fileset id="signappletjarset" dir="${packageDir}/examples">
953 <exclude name="u_*.jar" />
954 <include name="${jalviewLiteJar}" />
955 <include name="${jmolJar}" />
956 <include name="${javaJson}" />
957 <include name="${jsonSimple}" />
958 <include name="to_${jalviewLiteJar}" />
959 <include name="to_${jmolJar}" />
960 <include name="to_${javaJson}" />
961 <include name="to_${jsonSimple}" />
962 <include name="tl_${jalviewLiteJar}" />
963 <include name="tl_${jmolJar}" />
964 <include name="tl_${javaJson}" />
965 <include name="tl_${jsonSimple}" />
966 <include name="ap_${jalviewLiteJar}" />
967 <include name="ap_${jmolJar}" />
968 <include name="ap_${javaJson}" />
969 <include name="ap_${jsonSimple}" />
972 <target name="-signappletnotsa" if:blank="timestamp" depends="-signapplet" unless="nosign">
973 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
974 <fileset refid="signappletjarset" />
978 <target name="-signapplettsa" if="timestamp" depends="-signapplet" unless="nosign">
979 <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}">
980 <fileset refid="signappletjarset" />
984 <target name="signApplet" description="internal target to sign applet" depends="-signappletnotsa,-signapplettsa" />
985 <target name="pubapplet" description="Dummy target to keep legacy Jalview build system happy. We don't actually publish the applet anymore."/>
987 <target name="_pubapplet" description="installs the jalviewLite applet and dependent jars into an applet examples directory built under ${outputDir}" depends="makeApplet, signApplet">
989 <!-- bizarre bug causes JmolApplet to always get signed, even if excluded from above. so copy explicitly -->
990 <copy file="appletlib/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
991 <copy file="appletlib/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true" />
992 <copy file="appletlib/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true" />
993 <!-- finally, replace any launchApp servlet tags with a version specification -->
994 <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}"">
996 <![CDATA[http://www.jalview.org/services/launchApp"]]>
998 <fileset dir="${packageDir}/examples">
999 <include name="**/*.html" />
1002 <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}'">
1004 <![CDATA[http://www.jalview.org/services/launchApp']]>
1006 <fileset dir="${packageDir}/examples">
1007 <include name="**/*.html" />
1012 <target name="sourcedoc" description="Create jalview source documentation pages" depends="init">
1013 <javadoc destdir="${javadocDir}">
1014 <packageset dir="${sourceDir}" includes="jalview/*,MCView/*">
1018 <target name="linkcheck" depends="init,prepare">
1019 <javac srcdir="utils" destdir="utils" includes="HelpLinksChecker.java"/>
1020 <java fork="true" dir="${helpDir}" classpath="utils" classname="HelpLinksChecker" failonerror="true">
1021 <arg file="${helpDir}"/>
1022 <arg value="-nointernet" />
1026 <target name="eclipse-install" depends="init,prepare">
1028 <property name="eclipseTempFile" value="eclipse-jee-oxygen-R-linux-gtk-x86_64.tar.gz"/>
1029 <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"/>
1030 <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"/>
1032 <get url="${eclipseInstallURL}" dest="${eclipseTempFile}"/>
1033 <untar compression="gzip" src="${eclipseTempFile}" dest="${eclipse-inst}"/>
1035 <!-- not needed since we ship transpiler with source
1036 <get url="${java2scriptURL}" dest="eclipse-inst/dropins/net.sf.j2s.core.jar" /> -->
1040 <target name="build-site" depends="init,prepare,compile-site,unzip-to-site,make-j2s-cores">
1042 <tar compression="gzip" destfile="site.tar.gz">
1043 <tarfileset dir="site" />
1046 <target name="prepare-site" depends="init,prepare">
1047 <property name="swingjsdir" value="swingjs"/>
1048 <property name="eclipse-inst" value="/home/bamboo/buildtools/eclipse/eclipse-js"/>
1049 <property name="eclipse-exec" value="${eclipse-inst}/eclipse"/>
1050 <property name="site" value="site"/>
1051 <!-- where the eclipse js workspace has been initialised -->
1052 <property name="eclipse-work" value="/home/bamboo/buildtools/eclipse/eclipse-js-workspace"/>
1053 <!-- git repository linked to project in workspace -->
1054 <property name="eclipse-workrepo" value="/home/bamboo/buildtools/eclipse/eclipse-js-workspace/jalview-js"/>
1056 <target name="clean-site" depends="prepare-site">
1057 <delete dir="${eclipse-workrepo}/${site}"/>
1058 <mkdir dir="${eclipse-workrepo}/${site}"/>
1060 <target name="compile-site" depends="prepare-site,clean-site">
1061 <!-- update transpiler -->
1062 <copy file="${swingjsdir}/net.sf.j2s.core.jar" todir="${eclipse-inst}/dropins" overwrite="true" failonerror="true"/>
1063 <!-- update the git repo linked to the eclipse workspace -->
1064 <exec executable="/usr/bin/git" outputproperty="git.commit" failifexecutionfails="true">
1065 <arg value="rev-parse" />
1066 <arg value="--short" />
1067 <arg value="HEAD" />
1069 <!-- update and checkout the same commit in the workspace project -->
1070 <exec executable="/usr/bin/git" failifexecutionfails="true" dir="${eclipse-workrepo}">
1071 <arg value="reset" />
1072 <arg value="--hard" />
1074 <exec executable="/usr/bin/git" failifexecutionfails="true" dir="${eclipse-workrepo}">
1075 <arg value="pull" />
1077 <exec executable="/usr/bin/git" failifexecutionfails="true" dir="${eclipse-workrepo}">
1078 <arg value="checkout" />
1079 <arg value="${git.commit}" />
1081 <!-- custom classpath for .js builds -->
1082 <copy file=".classpath.js" tofile="${eclipse-workrepo}/.classpath" overwrite="true"/>
1083 <!-- clean eclipse log -->
1084 <delete file="${eclipse-work}/.metadata/.log"/>
1086 <!-- execute the eclipse build - the build may fail but valid javascript may still be produced, so we ignore return codes -->
1087 <exec executable="${eclipse-exec}" failonerror="no">
1088 <arg value="-nosplash"/>
1089 <arg value="--launcher.suppressErrors"/>
1090 <arg value="-application"/>
1091 <arg value="org.eclipse.jdt.apt.core.aptBuild"/>
1092 <arg value="-data"/>
1093 <arg value="${eclipse-work}"/>
1096 <exec executable="/bin/cat">
1097 <arg value="${eclipse-work}/.metadata/.log"/>
1099 <!-- TODO: run jslint and something else here to check we have a complete set of .js files for java -->
1100 <!-- possibly compare timestamps between .js files and their mate in source - any newer or not present triggers a new build -->
1101 <!-- <mkdir dir="${packageDir}/${site}" /> -->
1102 <!-- <property name="swingjs.zipurl" value="https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.java.core/dist/SwingJS-site.zip?raw=true" /> -->
1104 <!-- and reset the .classpath -->
1105 <exec executable="/usr/bin/git" failifexecutionfails="true" dir="${eclipse-workrepo}">
1106 <arg value="checkout" />
1107 <arg value="${git.commit}"/>
1109 <arg value=".classpath" />
1112 <!-- finally copy artefacts from eclipse project checkout to the build site -->
1113 <copy todir="${site}">
1114 <fileset dir="${eclipse-workrepo}/site"/>
1117 <target name="unzip-to-site" depends="prepare-site">
1118 <ant antfile="build-site.xml"/>
1121 <target name="make-j2s-cores" depends="">
1122 <ant antfile="buildcore.xml" target="build-all-cores"/>