3 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
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"
22 classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
24 <fileset dir="utils/jalopy/lib">
25 <include name="*.jar" />
30 <target name="help" depends="usage"/>
32 <echo message="~~~Jalview Ant build.xml Usage~~~~"/>
33 <echo message="Targets include:"/>
34 <echo message="usage - default target, displays this message"/>
35 <echo message="buildindices - generates JavaHelpSearch from the help files"/>
36 <echo message="build - compiles all necessary files for Application"/>
37 <echo message="makedist - compiles and places all necessary jar files into directory dist"/>
38 <echo message="makefulldist - signs all jar files and builds jnlp file for full distribution"/>
39 <echo message=" this needs a keystore and key. See docs/building.html for more information."/>
40 <echo message="compileApplet - compiles all necessary files for Applet"/>
41 <echo message="makeApplet - compiles, then packages and obfuscates the Applet"/>
42 <echo message="See docs/building.html and the comments in build file for other targets."/>
43 <echo message="note: compile and makeApplet require the property java118.home to be set to point to a java 1.1.8 jdk."/>
44 <echo message="Useful -D flags: -Ddonotobfuscate will prevent applet obfuscation"/>
48 <!-- utils is a class path to additional utilities needed for
49 building docs, jars and webstart stuff -->
51 Userdefined build property defaults
53 wsdl.server list (plus namespace mapping info ???) - also want
54 ... to make this a dynamically generatable property
56 Build location - provide a temporary root for speed
57 jarsigner keystore and info
58 Jakarta and axis classpath ?
59 Default argument for starting Jalview (if it exists).
64 <path id="axis.classpath">
66 <fileset dir="/usr/local/axis/lib">
67 <include name="**/*.jar" />
69 <fileset dir="/usr/local/jakarta-tomcat-5/webapps/axis/WEB-INF/lib">
70 <include name="**/*.jar"/>
71 <include name="*.jar"/>
74 <!-- Jalview Version String displayed by application on startup and used to check for updates -->
75 <property name="JALVIEW_VERSION" value="DEVELOPMENT"/>
76 <!-- 2.4 (VAMSAS)" -->
77 <!-- Include debugging information in javac true or false -->
78 <property name="javac.debug" value="true"/>
80 <!-- JarSigner Key Store for Webstart Distribution -->
81 <property name="jalview.keystore" value="./keys/.keystore"/>
82 <!-- Keystore Password -->
83 <property name="jalview.keystore.pass" value="alignmentisfun"/>
85 <property name="jalview.key" value="jalview"/>
87 <property name="jalview.key.pass" value="alignmentisfun"/>
89 <!-- Don't change anything below here unless you know what you are doing! -->
90 <!-- Url path for WebStart in JNLP file -->
91 <property name="WebStartLocation" value="http://www.jalview.org/webstart"/>
92 <!-- build directory configuration -->
93 <property name="libDir" value="lib"/>
94 <property name="resourceDir" value="resources"/>
95 <property name="helpDir" value="help"/>
96 <property name="docDir" value="doc"/>
97 <property name="sourceDir" value="src" />
98 <property name="schemaDir" value="schemas" />
99 <property name="outputDir" value="classes" />
100 <property name="packageDir" value="dist" />
101 <property name="outputJar" value="jalview.jar" />
102 <!-- Jalview Applet JMol Jar Dependency -->
103 <property name="jmolJar" value="JmolApplet-12.0.6.jar" />
104 <property name="jalviewLiteJar" value="jalviewApplet.jar"/>
105 <!-- switch to indicate if we should obfuscate jalviewLite -->
106 <!--<property name="donotobfuscate" value="true"/> -->
108 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
109 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
110 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
111 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
112 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
113 <property name="WSInterf" value="MsaWS" />
114 <property name="wsdl.Namespace" value="vamsas" />
115 <property name="wsdl.ClientNS" value="ext.vamsas" />
116 <!-- the class path for building the application -->
117 <path id="build.classpath">
118 <fileset dir="utils">
119 <include name="*.jar"/>
120 <include name="**/*.jar"/>
122 <fileset dir="${libDir}">
123 <include name="*.jar"/>
124 <include name="**/*.jar"/>
128 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz"/>
129 <!-- The Location of the java 1.1.8 jdk -->
130 <property name="java118.home" value="C:\Sun\jdk1.1.8" />
131 <property name="applet.jre.tools" value="${java118.home}/lib/classes.zip"/>
132 <!-- jre for 1.4 version
133 <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
135 <!-- the classpath for building the 1.1 applet -->
136 <path id="jalviewlite.deps">
137 <fileset dir="${java118.home}">
138 <include name="lib/classes.zip"/>
140 <pathelement location="appletlib/${jmolJar}"/>
145 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties"/>
146 <target name="buildPropertiesFile" depends="init">
147 <tstamp prefix="build">
148 <format property="date" pattern="dd MMMM yyyy"/>
150 <properties file="${outputDir}/.build_properties">
152 ---Jalview Build Details---
154 <property name="VERSION" value="${JALVIEW_VERSION}"/>
155 <property name="BUILD_DATE" value="${build.date}"/>
160 <target name="clean" depends="init">
161 <!-- not efficient yet. -->
162 <delete dir="${outputDir}"/>
165 <target name="distclean" depends="init, clean">
167 <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
170 <include name="${outputJar}"/>
171 <include name="#*#"/>
172 <include name="#*.*#"/>
173 <include name="**/#*#"/>
174 <include name="**/#*.*#"/>
176 <include name="*.*~"/>
177 <include name="**/*~"/>
178 <include name="**/*.*~"/>
183 <target name="prepare" depends="init">
184 <mkdir dir="${outputDir}"/>
185 <copy todir="${outputDir}">
187 <include name="${docDir}/**/*.*"/>
188 <include name="${helpDir}/**/*.*"/>
189 <include name="${libDir}/*.jar"/>
191 <fileset dir="${resourceDir}">
192 <include name="**/*.*"/>
197 <target name="build" depends="prepare">
198 <!-- not efficient yet. -->
199 <javac source="1.5" target="1.5"
200 srcdir ="${sourceDir}"
201 destdir="${outputDir}"
202 debug="${javac.debug}"
203 classpathref="build.classpath">
204 <exclude name="jalview/*applet*"/>
205 <exclude name="com/stevesoft/**"/>
208 <target name="buildindices" depends="init, prepare"
209 unless="help.uptodate">
211 classname="com.sun.java.help.search.Indexer"
212 classpathref="build.classpath"
214 dir="${outputDir}/${helpDir}"
220 <target name="makefulldist" depends="makedist">
221 <!-- the default keystore details might need to be edited here -->
222 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
224 <fileset dir="${packageDir}">
225 <include name="*.jar" />
228 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties" />
230 <!-- codebase="http://www.jalview.org/jalview/webstart" -->
231 <!-- href="jalview.jnlp" prevent hard-wired pickup of jnlp in certain javaws versions -->
232 <jnlp toFile="${packageDir}/jalview.jnlp" codebase="${WebStartLocation}">
234 <title>Jalview</title>
235 <vendor>The Barton Group</vendor>
236 <homepage href="http://www.jalview.org" />
237 <description>Jalview Multiple Alignment Editor</description>
238 <description kind="short">Jalview</description>
239 <icon href="logo_big.gif" />
242 <association mime-type="application-x/ext-file" extensions="fa"/>
243 <association mime-type="application-x/ext-file" extensions="fasta"/>
244 <association mime-type="application-x/ext-file" extensions="fastq"/>
245 <association mime-type="application-x/ext-file" extensions="blc"/>
246 <association mime-type="application-x/ext-file" extensions="msf"/>
247 <association mime-type="application-x/ext-file" extensions="pfam"/>
248 <association mime-type="application-x/ext-file" extensions="aln"/>
249 <association mime-type="application-x/ext-file" extensions="pir"/>
250 <association mime-type="application-x/ext-file" extensions="amsa"/>
254 <j2se version="1.5+" initial_heap_size="10M"/>
255 <fileset dir="${packageDir}">
256 <include name="jalview.jar" />
258 <fileset dir="${packageDir}">
259 <include name="*.jar" />
260 <include name="*_*.jar" />
261 <exclude name="jalview.jar" />
263 <property name="jalview.version" value="${JALVIEW_VERSION}" />
265 <application_desc main_class="jalview.bin.Jalview">
271 <!-- the rest of these jnlp tasks are copy and pastes of the above but with different Vm args -->
272 <jnlp toFile="${packageDir}/jalview_1G.jnlp" codebase="${WebStartLocation}">
274 <title>Jalview</title>
275 <vendor>The Barton Group</vendor>
276 <homepage href="http://www.jalview.org" />
277 <description>Jalview Multiple Alignment Editor</description>
278 <description kind="short">Jalview</description>
279 <icon href="logo_big.gif" />
282 <association mime-type="application-x/ext-file" extensions="fa"/>
283 <association mime-type="application-x/ext-file" extensions="fasta"/>
284 <association mime-type="application-x/ext-file" extensions="fastq"/>
285 <association mime-type="application-x/ext-file" extensions="blc"/>
286 <association mime-type="application-x/ext-file" extensions="msf"/>
287 <association mime-type="application-x/ext-file" extensions="pfam"/>
288 <association mime-type="application-x/ext-file" extensions="aln"/>
289 <association mime-type="application-x/ext-file" extensions="pir"/>
290 <association mime-type="application-x/ext-file" extensions="amsa"/>
294 <j2se version="1.4+" initial_heap_size="64M" max_heap_size="512M"/>
295 <fileset dir="${packageDir}">
296 <include name="jalview.jar" />
298 <fileset dir="${packageDir}">
299 <include name="*.jar" />
300 <include name="*_*.jar" />
301 <exclude name="jalview.jar" />
303 <property name="jalview.version" value="${JALVIEW_VERSION}" />
305 <application_desc main_class="jalview.bin.Jalview">
311 <jnlp toFile="${packageDir}/jalview_2G.jnlp" codebase="${WebStartLocation}">
313 <title>Jalview</title>
314 <vendor>The Barton Group</vendor>
315 <homepage href="http://www.jalview.org" />
316 <description>Jalview Multiple Alignment Editor</description>
317 <description kind="short">Jalview</description>
318 <icon href="logo_big.gif" />
321 <association mime-type="application-x/ext-file" extensions="fa"/>
322 <association mime-type="application-x/ext-file" extensions="fasta"/>
323 <association mime-type="application-x/ext-file" extensions="fastq"/>
324 <association mime-type="application-x/ext-file" extensions="blc"/>
325 <association mime-type="application-x/ext-file" extensions="msf"/>
326 <association mime-type="application-x/ext-file" extensions="pfam"/>
327 <association mime-type="application-x/ext-file" extensions="aln"/>
328 <association mime-type="application-x/ext-file" extensions="pir"/>
329 <association mime-type="application-x/ext-file" extensions="amsa"/>
333 <j2se version="1.4+" initial_heap_size="256M" max_heap_size="1024M"/>
334 <fileset dir="${packageDir}">
335 <include name="jalview.jar" />
337 <fileset dir="${packageDir}">
338 <include name="*.jar" />
339 <include name="*_*.jar" />
340 <exclude name="jalview.jar" />
342 <property name="jalview.version" value="${JALVIEW_VERSION}" />
344 <application_desc main_class="jalview.bin.Jalview">
353 <target name="runenv" depends="init">
354 <path id="run.classpath">
355 <pathelement location="${outputDir}"/>
356 <fileset dir="${outputDir}">
357 <include name="${libDir}/*.jar"/>
360 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath"/>
362 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
366 <target name="buildextclients" depends="init">
367 <input message="Building external client source from WSDLs - Do you really want to do this ? (Yy/Nn)"
368 validargs="Y,y,n,N" defaultvalue="N"
369 addproperty="doextbuild.response"/>
370 <condition property="dontextbuild">
371 <equals arg1="n" arg2="${doextbuild.response}"/>
373 <condition property="dontextbuild">
374 <equals arg1="N" arg2="${doextbuild.response}"/>
376 <fail if="dontextbuild">
377 Build External Client Code process aborted by user. Jalview source is unchanged.
379 <!-- Currently, this doesn't happen automatically.
380 1. Run WSDL2Java as below, which generates an ext.vamsas +
381 vamsas.<datapackages> fileset.
382 2. refactor ext.vamsas.SpecificserviceWS* to
383 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
384 3. Update the jalview.ws.*WServices classes to reflect the
385 interface type, and all locations of this wsdl type that Jalview
389 <path id="axisbuild">
390 <path refid="build.classpath"/>
392 <taskdef resource="axis-tasks.properties" classpathref="axisbuild"/>
394 <fileset dir="${sourceDir}" id="client">
395 <include name="${wsdl.ClientNS}/*.*"/>
400 output="${sourceDir}"
404 deployscope="Request"
411 namespace="${wsdl.Namespace}"
412 package="${wsdl.ClientNS}"
414 <mapping namespace="http://dataTypes.vamsas"
415 package="${wsdl.ClientNS}"/>
420 <target name="makedist" depends="build, buildPropertiesFile, buildindices">
421 <!-- make the package jar -->
422 <mkdir dir="${packageDir}"/>
424 <jar destfile="${packageDir}/${outputJar}">
426 <attribute name="Main-Class" value="jalview.bin.Jalview"/>
428 <fileset dir="${outputDir}/">
429 <exclude name="cache*/**"/>
430 <exclude name="*.jar" />
431 <exclude name="*.jar.*" />
432 <exclude name="**/*.jar" />
433 <exclude name="**/*.jar.*" />
437 <copy toDir="${packageDir}" flatten="true">
438 <fileset dir="${outputDir}">
439 <include name="*.jar"/>
440 <include name="**/*.jar"/>
446 <!-- jalopy code reformatter -->
447 <target name="sourcescrub" depends="init,build">
448 <jalopy destdir="jsrc" classpathref="run.classpath"
449 convention="jalview-jalopy.xml">
450 <fileset dir="${sourceDir}">
451 <include name="*.java"/>
452 <include name="**/*.java"/>
453 <include name="**/**/*.java"/>
460 <!-- Compile, package and obfuscate Jalview Applet -->
461 <target name="makeApplet" depends="obfuscate"/>
463 <target name="compileApplet" depends="init,clean">
464 <mkdir dir="${outputDir}"/>
467 srcdir="${sourceDir}"
468 destdir="${outputDir}"
469 debug="${javac.debug}"
470 classpath="lib/${jmolJar}"
471 includes="jalview/appletgui/**"
472 excludes="ext/**,MCview/**,org/**,vamsas/**"
476 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
477 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif"/>
478 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif"/>
479 <jar destfile="in.jar">
481 <attribute name="Main-Class" value="jalview.bin.JalviewLite"/>
483 <fileset dir="${outputDir}">
484 <include name="com/**"/>
485 <include name="MCview/**"/>
486 <include name="jalview/**"/>
487 <include name=".build_properties"/>
488 <include name="images/idwidth.gif"/>
489 <include name="images/link.gif"/>
493 <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally" description="construct the final jalviewLite applet jar with or without obfuscation">
495 <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
496 <copy file="in.jar" tofile="${jalviewLiteJar}" />
497 <delete file="in.jar"/>
499 <target name="-obfuscatereally" unless="donotobfuscate">
501 <path id="obfuscateDeps.path">
502 <pathelement location="${applet.jre.tools}"/>
503 <pathelement location="lib/${jmolJar}"/>
505 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
508 <injar file="in.jar"/>
509 <outjar file="${jalviewLiteJar}"/>
510 <libraryjar refid="obfuscateDeps.path"/>
511 <keep access="public" type="class"
512 name="jalview.bin.JalviewLite">
513 <field access="public"/>
514 <method access="public"/>
515 <constructor access="public"/>
517 <!-- -libraryjars "${obfuscateDeps}"
519 -outjars jalviewApplet.jar
520 -keep public class jalview.bin.JalviewLite
523 <delete file="in.jar"/>
526 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
527 <taskdef name="castor-srcgen"
528 classname="org.castor.anttask.CastorCodeGenTask"
529 classpathref="build.classpath" />
531 <fileset dir="${sourceDir}/jalview/schemabinding/version2">
532 <include name="*.java"/>
533 <include name="descriptors/*.java"/>
536 <castor-srcgen file="${schemaDir}/vamsas.xsd"
538 package="jalview.schemabinding.version2"
542 properties="${schemaDir}/jalview.properties"
544 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
546 package="jalview.schemabinding.version2"
550 properties="${schemaDir}/jalview.properties"
552 <castor-srcgen file="${schemaDir}/jalview.xsd"
554 package="jalview.schemabinding.version2"
558 properties="${schemaDir}/jalview.properties"
562 now build the jalview.binding package with the old schema set
565 <fileset dir="${sourceDir}/jalview/binding/">
569 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd"
571 package="jalview.binding"
575 properties="${schemaDir}/jalview.nodesc.properties"
577 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
579 package="jalview.binding"
583 properties="${schemaDir}/jalview.nodesc.properties"
585 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd"
587 package="jalview.binding"
591 properties="${schemaDir}/jalview.nodesc.properties"
594 <target name="sourcedist" description="create jalview source distribution" depends="init">
595 <delete file="${source.dist.name}"/>
596 <tar destfile="${source.dist.name}" compression="gzip">
597 <tarfileset dir="./" prefix="jalview" preserveLeadingSlashes="true">
598 <include name="LICENSE"/>
599 <include name="README"/>
600 <include name="build.xml"/>
601 <include name="jalview-jalopy.xml"/>
602 <include name="JalviewApplet.jpx"/>
603 <include name="JalviewX.jpx"/>
604 <include name="${sourceDir}/*.java"/>
605 <include name="${sourceDir}/**/*.java"/>
606 <include name="${sourceDir}/**/*.cdr"/>
607 <include name="${libDir}/**/*"/>
608 <include name="${resourceDir}/**/*"/>
609 <include name="${helpDir}/**/*"/>
610 <exclude name="**/*locales"/>
611 <exclude name="*locales/**"/>
612 <exclude name="utils/InstallAnywhere/**Build.iap_xml"/>
613 <exclude name="utils/InstallAnywhere/**Build*/**"/>
614 <exclude name="utils/InstallAnywhere/**Build*/**"/>
615 <exclude name="utils/InstallAnywhere/**locale*"/>
616 <exclude name="utils/InstallAnywhere/**locale*/**"/>
617 <include name="${schemaDir}/**/*"/>
618 <include name="utils/**/*"/>
619 <include name="${docDir}/**/*"/>