3 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
4 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
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/>.
19 <project name="jalviewX" default="usage" basedir=".">
20 <!-- we use jalopy to format our sources -->
21 <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
23 <fileset dir="utils/jalopy/lib">
24 <include name="*.jar" />
29 <target name="help" depends="usage" />
31 <echo message="~~~Jalview Ant build.xml Usage~~~~" />
32 <echo message="Targets include:" />
33 <echo message="usage - default target, displays this message" />
34 <echo message="buildindices - generates JavaHelpSearch from the help files" />
35 <echo message="build - compiles all necessary files for Application" />
36 <echo message="makedist - compiles and places all necessary jar files into directory dist" />
37 <echo message="makefulldist - signs all jar files and builds jnlp file for full distribution" />
38 <echo message=" this needs a keystore and key. 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="See docs/building.html and the comments in build file for other targets." />
42 <echo message="note: compile and makeApplet require the property java118.home to be set to point to a java 1.1.8 jdk." />
43 <echo message="Useful -D flags: -Ddonotobfuscate will prevent applet obfuscation" />
47 <!-- utils is a class path to additional utilities needed for
48 building docs, jars and webstart stuff -->
50 Userdefined build property defaults
52 wsdl.server list (plus namespace mapping info ???) - also want
53 ... to make this a dynamically generatable property
55 Build location - provide a temporary root for speed
56 jarsigner keystore and info
57 Jakarta and axis classpath ?
58 Default argument for starting Jalview (if it exists).
63 <path id="axis.classpath">
65 <fileset dir="/usr/local/axis/lib">
66 <include name="**/*.jar" />
68 <fileset dir="/usr/local/jakarta-tomcat-5/webapps/axis/WEB-INF/lib">
69 <include name="**/*.jar"/>
70 <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" />
75 <!-- 2.4 (VAMSAS)" -->
76 <!-- Include debugging information in javac true or false -->
77 <property name="javac.debug" value="true" />
79 <!-- JarSigner Key Store for Webstart Distribution -->
80 <property name="jalview.keystore" value="./keys/.keystore" />
81 <!-- Keystore Password -->
82 <property name="jalview.keystore.pass" value="alignmentisfun" />
84 <property name="jalview.key" value="jalview" />
86 <property name="jalview.key.pass" value="alignmentisfun" />
88 <!-- Don't change anything below here unless you know what you are doing! -->
89 <!-- Url path for WebStart in JNLP file -->
90 <property name="WebStartLocation" value="http://www.jalview.org/webstart" />
91 <!-- build directory configuration -->
92 <property name="libDir" value="lib" />
93 <property name="resourceDir" value="resources" />
94 <property name="helpDir" value="help" />
95 <property name="docDir" value="doc" />
96 <property name="sourceDir" value="src" />
97 <property name="schemaDir" value="schemas" />
98 <property name="outputDir" value="classes" />
99 <property name="packageDir" value="dist" />
100 <property name="outputJar" value="jalview.jar" />
101 <!-- Jalview Applet JMol Jar Dependency -->
102 <property name="jmolJar" value="JmolApplet-12.1.13.jar" />
103 <property name="jalviewLiteJar" value="jalviewApplet.jar" />
104 <!-- switch to indicate if we should obfuscate jalviewLite -->
105 <!--<property name="donotobfuscate" value="true"/> -->
107 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
108 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
109 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
110 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
111 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
112 <property name="WSInterf" value="MsaWS" />
113 <property name="wsdl.Namespace" value="vamsas" />
114 <property name="wsdl.ClientNS" value="ext.vamsas" />
115 <!-- the class path for building the application -->
116 <path id="build.classpath">
117 <fileset dir="utils">
118 <include name="*.jar" />
119 <include name="**/*.jar" />
121 <fileset dir="${libDir}">
122 <include name="*.jar" />
123 <include name="**/*.jar" />
125 <fileset dir="appletlib">
126 <!-- the JmolApplet includes the JmolApplet console and the application javac seems to always try and build all packages
128 <include name="${jmolJar}" />
132 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
133 <!-- The Location of the java 1.1.8 jdk -->
134 <property name="java118.home" value="C:\Sun\jdk1.1.8" />
135 <property name="applet.jre.tools" value="${java118.home}/lib/classes.zip" />
136 <!-- jre for 1.4 version
137 <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
139 <!-- the classpath for building the 1.1 applet -->
140 <path id="jalviewlite.deps">
141 <fileset dir="${java118.home}">
142 <include name="lib/classes.zip" />
144 <pathelement location="appletlib/${jmolJar}" />
149 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties" />
150 <target name="buildPropertiesFile" depends="init">
151 <tstamp prefix="build">
152 <format property="date" pattern="dd MMMM yyyy" />
154 <properties file="${outputDir}/.build_properties">
156 ---Jalview Build Details---
158 <property name="VERSION" value="${JALVIEW_VERSION}" />
159 <property name="BUILD_DATE" value="${build.date}" />
164 <target name="clean" depends="init">
165 <!-- not efficient yet. -->
166 <delete dir="${outputDir}" />
169 <target name="distclean" depends="init, clean">
171 <echo message="REMOVING ALL BACKUP/AUTOSAVES!" />
174 <include name="${outputJar}" />
175 <include name="#*#" />
176 <include name="#*.*#" />
177 <include name="**/#*#" />
178 <include name="**/#*.*#" />
179 <include name="*~" />
180 <include name="*.*~" />
181 <include name="**/*~" />
182 <include name="**/*.*~" />
187 <target name="prepare" depends="init">
188 <mkdir dir="${outputDir}" />
189 <copy todir="${outputDir}">
191 <include name="${docDir}/**/*.*" />
192 <include name="${helpDir}/**/*.*" />
193 <include name="${libDir}/*.jar" />
195 <fileset dir="${resourceDir}">
196 <include name="**/*.*" />
201 <target name="build" depends="prepare">
202 <!-- not efficient yet. -->
203 <javac source="1.5" target="1.5" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="build.classpath">
204 <exclude name="jalview/*applet*" />
205 <exclude name="jalview/appletgui/**" />
206 <exclude name="com/stevesoft/**" />
209 <target name="buildindices" depends="init, prepare" unless="help.uptodate">
210 <java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
215 <target name="makefulldist" depends="makedist">
216 <!-- the default keystore details might need to be edited here -->
217 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
219 <fileset dir="${packageDir}">
220 <include name="*.jar" />
223 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties" />
225 <!-- codebase="http://www.jalview.org/jalview/webstart" -->
226 <!-- href="jalview.jnlp" prevent hard-wired pickup of jnlp in certain javaws versions -->
227 <jnlp toFile="${packageDir}/jalview.jnlp" codebase="${WebStartLocation}">
229 <title>Jalview</title>
230 <vendor>The Barton Group</vendor>
231 <homepage href="http://www.jalview.org" />
232 <description>Jalview Multiple Alignment Editor</description>
233 <description kind="short">Jalview</description>
234 <icon href="logo_big.gif" />
237 <association mime-type="application-x/ext-file" extensions="fa"/>
238 <association mime-type="application-x/ext-file" extensions="fasta"/>
239 <association mime-type="application-x/ext-file" extensions="fastq"/>
240 <association mime-type="application-x/ext-file" extensions="blc"/>
241 <association mime-type="application-x/ext-file" extensions="msf"/>
242 <association mime-type="application-x/ext-file" extensions="pfam"/>
243 <association mime-type="application-x/ext-file" extensions="aln"/>
244 <association mime-type="application-x/ext-file" extensions="pir"/>
245 <association mime-type="application-x/ext-file" extensions="amsa"/>
249 <j2se version="1.5+" initial_heap_size="10M" />
250 <fileset dir="${packageDir}">
251 <include name="jalview.jar" />
253 <fileset dir="${packageDir}">
254 <include name="*.jar" />
255 <include name="*_*.jar" />
256 <exclude name="jalview.jar" />
258 <property name="jalview.version" value="${JALVIEW_VERSION}" />
260 <application_desc main_class="jalview.bin.Jalview">
266 <!-- the rest of these jnlp tasks are copy and pastes of the above but with different Vm args -->
267 <jnlp toFile="${packageDir}/jalview_1G.jnlp" codebase="${WebStartLocation}">
269 <title>Jalview</title>
270 <vendor>The Barton Group</vendor>
271 <homepage href="http://www.jalview.org" />
272 <description>Jalview Multiple Alignment Editor</description>
273 <description kind="short">Jalview</description>
274 <icon href="logo_big.gif" />
277 <association mime-type="application-x/ext-file" extensions="fa"/>
278 <association mime-type="application-x/ext-file" extensions="fasta"/>
279 <association mime-type="application-x/ext-file" extensions="fastq"/>
280 <association mime-type="application-x/ext-file" extensions="blc"/>
281 <association mime-type="application-x/ext-file" extensions="msf"/>
282 <association mime-type="application-x/ext-file" extensions="pfam"/>
283 <association mime-type="application-x/ext-file" extensions="aln"/>
284 <association mime-type="application-x/ext-file" extensions="pir"/>
285 <association mime-type="application-x/ext-file" extensions="amsa"/>
289 <j2se version="1.5+" initial_heap_size="64M" max_heap_size="512M" />
290 <fileset dir="${packageDir}">
291 <include name="jalview.jar" />
293 <fileset dir="${packageDir}">
294 <include name="*.jar" />
295 <include name="*_*.jar" />
296 <exclude name="jalview.jar" />
298 <property name="jalview.version" value="${JALVIEW_VERSION}" />
300 <application_desc main_class="jalview.bin.Jalview">
306 <jnlp toFile="${packageDir}/jalview_2G.jnlp" codebase="${WebStartLocation}">
308 <title>Jalview</title>
309 <vendor>The Barton Group</vendor>
310 <homepage href="http://www.jalview.org" />
311 <description>Jalview Multiple Alignment Editor</description>
312 <description kind="short">Jalview</description>
313 <icon href="logo_big.gif" />
316 <association mime-type="application-x/ext-file" extensions="fa"/>
317 <association mime-type="application-x/ext-file" extensions="fasta"/>
318 <association mime-type="application-x/ext-file" extensions="fastq"/>
319 <association mime-type="application-x/ext-file" extensions="blc"/>
320 <association mime-type="application-x/ext-file" extensions="msf"/>
321 <association mime-type="application-x/ext-file" extensions="pfam"/>
322 <association mime-type="application-x/ext-file" extensions="aln"/>
323 <association mime-type="application-x/ext-file" extensions="pir"/>
324 <association mime-type="application-x/ext-file" extensions="amsa"/>
328 <j2se version="1.5+" initial_heap_size="256M" max_heap_size="1024M" />
329 <fileset dir="${packageDir}">
330 <include name="jalview.jar" />
332 <fileset dir="${packageDir}">
333 <include name="*.jar" />
334 <include name="*_*.jar" />
335 <exclude name="jalview.jar" />
337 <property name="jalview.version" value="${JALVIEW_VERSION}" />
339 <application_desc main_class="jalview.bin.Jalview">
348 <target name="runenv" depends="init">
349 <path id="run.classpath">
350 <pathelement location="${outputDir}" />
351 <fileset dir="${outputDir}">
352 <include name="${libDir}/*.jar" />
355 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath" />
357 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
361 <target name="buildextclients" depends="init">
362 <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" />
363 <condition property="dontextbuild">
364 <equals arg1="n" arg2="${doextbuild.response}" />
366 <condition property="dontextbuild">
367 <equals arg1="N" arg2="${doextbuild.response}" />
369 <fail if="dontextbuild">
370 Build External Client Code process aborted by user. Jalview source is unchanged.
372 <!-- Currently, this doesn't happen automatically.
373 1. Run WSDL2Java as below, which generates an ext.vamsas +
374 vamsas.<datapackages> fileset.
375 2. refactor ext.vamsas.SpecificserviceWS* to
376 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
377 3. Update the jalview.ws.*WServices classes to reflect the
378 interface type, and all locations of this wsdl type that Jalview
382 <path id="axisbuild">
383 <path refid="build.classpath" />
385 <taskdef resource="axis-tasks.properties" classpathref="axisbuild" />
387 <fileset dir="${sourceDir}" id="client">
388 <include name="${wsdl.ClientNS}/*.*" />
392 <axis-wsdl2java output="${sourceDir}" verbose="true" url="${wsdl.MsaWS2}" serverside="false" deployscope="Request" debug="false" helpergen="true" all="true">
394 <mapping namespace="${wsdl.Namespace}" package="${wsdl.ClientNS}" />
395 <mapping namespace="http://dataTypes.vamsas" package="${wsdl.ClientNS}" />
400 <target name="makedist" depends="build, buildPropertiesFile, buildindices">
401 <!-- make the package jar if not already existing -->
402 <mkdir dir="${packageDir}" />
403 <!-- clean dir if it already existed -->
405 <fileset dir="${packageDir}">
406 <include name="*.jar"/>
409 <jar destfile="${packageDir}/${outputJar}">
411 <attribute name="Main-Class" value="jalview.bin.Jalview" />
413 <fileset dir="${outputDir}/">
414 <exclude name="cache*/**" />
415 <exclude name="*.jar" />
416 <exclude name="*.jar.*" />
417 <exclude name="**/*.jar" />
418 <exclude name="**/*.jar.*" />
422 <copy toDir="${packageDir}" flatten="true">
423 <fileset dir="${outputDir}">
424 <include name="*.jar" />
425 <include name="**/*.jar" />
431 <!-- jalopy code reformatter -->
432 <target name="sourcescrub" depends="init,build">
433 <jalopy destdir="jsrc" classpathref="run.classpath" convention="jalview-jalopy.xml">
434 <fileset dir="${sourceDir}">
435 <include name="*.java" />
436 <include name="**/*.java" />
437 <include name="**/**/*.java" />
444 <!-- Compile, package and obfuscate Jalview Applet -->
445 <target name="makeApplet" depends="obfuscate" />
447 <target name="compileApplet" depends="init,clean">
448 <mkdir dir="${outputDir}" />
449 <javac source="1.5" target="1.5" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpath="appletlib/${jmolJar}" includes="jalview/appletgui/**" excludes="ext/**,MCview/**,org/**,vamsas/**" />
452 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
453 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif" />
454 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
455 <jar destfile="in.jar">
457 <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
459 <fileset dir="${outputDir}">
460 <include name="com/**" />
461 <include name="MCview/**" />
462 <include name="jalview/**" />
463 <include name=".build_properties" />
464 <include name="images/idwidth.gif" />
465 <include name="images/link.gif" />
469 <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally" description="construct the final jalviewLite applet jar with or without obfuscation">
471 <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
472 <copy file="in.jar" tofile="${jalviewLiteJar}" overwrite="true" />
473 <delete file="in.jar" />
475 <target name="-obfuscatereally" unless="donotobfuscate">
477 <path id="obfuscateDeps.path">
478 <pathelement location="${applet.jre.tools}" />
479 <pathelement location="appletlib/${jmolJar}" />
481 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
484 <injar file="in.jar" />
485 <outjar file="${jalviewLiteJar}" />
486 <libraryjar refid="obfuscateDeps.path" />
487 <keep access="public" type="class" name="jalview.bin.JalviewLite">
488 <field access="public" />
489 <method access="public" />
490 <constructor access="public" />
492 <!-- -libraryjars "${obfuscateDeps}"
494 -outjars jalviewApplet.jar
495 -keep public class jalview.bin.JalviewLite
498 <delete file="in.jar" />
501 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
502 <taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask" classpathref="build.classpath" />
504 <fileset dir="${sourceDir}/jalview/schemabinding/version2">
505 <include name="*.java" />
506 <include name="descriptors/*.java" />
509 <castor-srcgen file="${schemaDir}/vamsas.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
510 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
511 <castor-srcgen file="${schemaDir}/JalviewWsParamSet.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
512 <castor-srcgen file="${schemaDir}/jalview.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
514 now build the jalview.binding package with the old schema set
517 <fileset dir="${sourceDir}/jalview/binding/">
518 <include name="**" />
521 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
522 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
523 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
525 <target name="sourcedist" description="create jalview source distribution" depends="init">
526 <delete file="${source.dist.name}" />
527 <tar destfile="${source.dist.name}" compression="gzip">
528 <tarfileset dir="./" prefix="jalview" preserveLeadingSlashes="true">
529 <include name="LICENSE" />
530 <include name="README" />
531 <include name="build.xml" />
532 <include name="jalview-jalopy.xml" />
533 <include name="JalviewApplet.jpx" />
534 <include name="JalviewX.jpx" />
535 <include name="${sourceDir}/*.java" />
536 <include name="${sourceDir}/**/*.java" />
537 <include name="${sourceDir}/**/*.cdr" />
538 <include name="${libDir}/**/*" />
539 <include name="${resourceDir}/**/*" />
540 <include name="${helpDir}/**/*" />
541 <include name="appletlib/${jmolJar}" />
542 <exclude name="**/*locales" />
543 <exclude name="*locales/**" />
544 <exclude name="utils/InstallAnywhere/**Build.iap_xml" />
545 <exclude name="utils/InstallAnywhere/**Build*/**" />
546 <exclude name="utils/InstallAnywhere/**Build*/**" />
547 <exclude name="utils/InstallAnywhere/**locale*" />
548 <exclude name="utils/InstallAnywhere/**locale*/**" />
549 <include name="${schemaDir}/**/*" />
550 <include name="utils/**/*" />
551 <include name="${docDir}/**/*" />