2 <project name="jalviewX" default="usage" basedir=".">
3 <!-- we use jalopy to format our sources -->
5 classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
7 <fileset dir="utils/jalopy/lib">
8 <include name="*.jar" />
13 <target name="help" depends="usage"/>
15 <echo message="~~~Jalview Ant build.xml Usage~~~~"/>
16 <echo message="Targets include:"/>
17 <echo message="usage - default target, displays this message"/>
18 <echo message="buildindices - generates JavaHelpSearch from the help files"/>
19 <echo message="build - compiles all necessary files for Application"/>
20 <echo message="makedist - compiles and places all necessary jar files into directory dist"/>
21 <echo message="makefulldist - signs all jar files and builds jnlp file for full distribution"/>
22 <echo message=" this needs a keystore and key. See docs/building.html for more information."/>
23 <echo message="compileApplet - compiles all necessary files for Applet"/>
24 <echo message="makeApplet - compiles, then packages and obfuscates the Applet"/>
25 <echo message="See docs/building.html and the comments in build file for other targets."/>
26 <echo message="note: compile and makeApplet require the property java118.home to be set to point to a java 1.1.8 jdk."/>
30 <!-- utils is a class path to additional utilities needed for
31 building docs, jars and webstart stuff -->
33 Userdefined build property defaults
35 wsdl.server list (plus namespace mapping info ???) - also want
36 ... to make this a dynamically generatable property
38 Build location - provide a temporary root for speed
39 jarsigner keystore and info
40 Jakarta and axis classpath ?
41 Default argument for starting Jalview (if it exists).
46 <path id="axis.classpath">
48 <fileset dir="/usr/local/axis/lib">
49 <include name="**/*.jar" />
51 <fileset dir="/usr/local/jakarta-tomcat-5/webapps/axis/WEB-INF/lib">
52 <include name="**/*.jar"/>
53 <include name="*.jar"/>
56 <!-- Jalview Version String displayed by application on startup and used to check for updates -->
57 <property name="JALVIEW_VERSION" value="DEVELOPMENT"/> <!-- 2.4 (VAMSAS)" -->
58 <!-- Include debugging information in javac true or false -->
59 <property name="javac.debug" value="true"/>
61 <!-- JarSigner Key Store for Webstart Distribution -->
62 <property name="jalview.keystore" value="./keys/.keystore"/>
63 <!-- Keystore Password -->
64 <property name="jalview.keystore.pass" value="alignmentisfun"/>
66 <property name="jalview.key" value="jalview"/>
68 <property name="jalview.key.pass" value="alignmentisfun"/>
70 <!-- Don't change anything below here unless you know what you are doing! -->
71 <!-- Url path for WebStart in JNLP file -->
72 <property name="WebStartLocation" value="http://www.jalview.org/webstart"/>
73 <!-- build directory configuration -->
74 <property name="libDir" value="lib"/>
75 <property name="resourceDir" value="resources"/>
76 <property name="helpDir" value="help"/>
77 <property name="docDir" value="doc"/>
78 <property name="sourceDir" value="src" />
79 <property name="schemaDir" value="schemas" />
80 <property name="outputDir" value="classes" />
81 <property name="packageDir" value="dist" />
82 <property name="outputJar" value="jalview.jar" />
83 <!-- Jalview Applet JMol Jar Dependency -->
84 <property name="jmolJar" value="Jmol-11.0.2.jar" />
85 <property name="jalviewLiteJar" value="jalviewApplet.jar"/>
86 <!-- switch to indicate if we should obfuscate jalviewLite -->
87 <!--<property name="donotobfuscate" value="true"/> -->
89 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
90 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
91 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
92 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
93 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
94 <property name="WSInterf" value="MsaWS" />
95 <property name="wsdl.Namespace" value="vamsas" />
96 <property name="wsdl.ClientNS" value="ext.vamsas" />
97 <!-- the class path for building the application -->
98 <path id="build.classpath">
100 <include name="*.jar"/>
101 <include name="**/*.jar"/>
103 <fileset dir="${libDir}">
104 <include name="*.jar"/>
105 <include name="**/*.jar"/>
109 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz"/>
110 <!-- The Location of the java 1.1.8 jdk -->
111 <property name="java118.home" value="C:\Sun\jdk1.1.8" />
112 <property name="applet.jre.tools" value="${java118.home}/lib/classes.zip"/>
113 <!-- jre for 1.4 version
114 <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
116 <!-- the classpath for building the 1.1 applet -->
117 <path id="jalviewlite.deps">
118 <fileset dir="${java118.home}">
119 <include name="lib/classes.zip"/>
121 <pathelement location="lib/${jmolJar}"/>
126 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties"/>
127 <target name="buildPropertiesFile" depends="init">
128 <tstamp prefix="build">
129 <format property="date" pattern="dd MMMM yyyy"/>
131 <properties file="${outputDir}/.build_properties">
133 ---Jalview Build Details---
135 <property name="VERSION" value="${JALVIEW_VERSION}"/>
136 <property name="BUILD_DATE" value="${build.date}"/>
141 <target name="clean" depends="init">
142 <!-- not efficient yet. -->
143 <delete dir="${outputDir}"/>
146 <target name="distclean" depends="init, clean">
148 <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
151 <include name="${outputJar}"/>
152 <include name="#*#"/>
153 <include name="#*.*#"/>
154 <include name="**/#*#"/>
155 <include name="**/#*.*#"/>
157 <include name="*.*~"/>
158 <include name="**/*~"/>
159 <include name="**/*.*~"/>
164 <target name="prepare" depends="init">
165 <mkdir dir="${outputDir}"/>
166 <copy todir="${outputDir}">
168 <include name="${docDir}/**/*.*"/>
169 <include name="${helpDir}/**/*.*"/>
170 <include name="${libDir}/*.jar"/>
172 <fileset dir="${resourceDir}">
173 <include name="**/*.*"/>
178 <target name="build" depends="prepare">
179 <!-- not efficient yet. -->
180 <javac source="1.4" target="1.4"
181 srcdir ="${sourceDir}"
182 destdir="${outputDir}"
183 debug="${javac.debug}"
184 classpathref="build.classpath">
185 <exclude name="jalview/*applet*"/>
186 <exclude name="com/stevesoft/**"/>
189 <target name="buildindices" depends="init, prepare"
190 unless="help.uptodate">
192 classname="com.sun.java.help.search.Indexer"
193 classpathref="build.classpath"
195 dir="${outputDir}/${helpDir}"
201 <target name="makefulldist" depends="makedist">
202 <!-- the default keystore details might need to be edited here -->
204 storepass="${jalview.keystore.pass}"
205 keypass="${jalview.key.pass}"
206 keystore="${jalview.keystore}"
207 alias="${jalview.key}"
212 <fileset dir="${packageDir}">
213 <include name="*.jar"/>
216 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties"/>
218 <!-- codebase="http://www.jalview.org/jalview/webstart" -->
219 <!-- href="jalview.jnlp" prevent hard-wired pickup of jnlp in certain javaws versions -->
220 <jnlp toFile="${packageDir}/jalview.jnlp"
221 codebase="${WebStartLocation}">
223 <title>Jalview</title>
224 <vendor>The Barton Group</vendor>
225 <homepage href="http://www.jalview.org"/>
226 <description>Jalview Multiple Alignment Editor</description>
227 <description kind="short">Jalview</description>
228 <icon href="logo_big.gif"/>
231 <association mime-type="application-x/ext-file" extensions="fa"/>
232 <association mime-type="application-x/ext-file" extensions="fasta"/>
233 <association mime-type="application-x/ext-file" extensions="fastq"/>
234 <association mime-type="application-x/ext-file" extensions="blc"/>
235 <association mime-type="application-x/ext-file" extensions="msf"/>
236 <association mime-type="application-x/ext-file" extensions="pfam"/>
237 <association mime-type="application-x/ext-file" extensions="aln"/>
238 <association mime-type="application-x/ext-file" extensions="pir"/>
239 <association mime-type="application-x/ext-file" extensions="amsa"/>
243 <j2se version="1.4+"/>
244 <fileset dir="${packageDir}">
245 <include name="jalview.jar"/>
247 <fileset dir="${packageDir}">
248 <include name="*.jar"/>
249 <exclude name="jalview.jar"/>
251 <property name="jalview.version" value="${JALVIEW_VERSION}"/>
253 <application_desc main_class="jalview.bin.Jalview">
260 <target name="runenv" depends="init">
261 <path id="run.classpath">
262 <pathelement location="${outputDir}"/>
263 <fileset dir="${outputDir}">
264 <include name="${libDir}/*.jar"/>
267 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath"/>
269 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
273 <target name="buildextclients" depends="init">
274 <input message="Building external client source from WSDLs - Do you really want to do this ? (Yy/Nn)"
275 validargs="Y,y,n,N" defaultvalue="N"
276 addproperty="doextbuild.response"/>
277 <condition property="dontextbuild">
278 <equals arg1="n" arg2="${doextbuild.response}"/>
280 <condition property="dontextbuild">
281 <equals arg1="N" arg2="${doextbuild.response}"/>
283 <fail if="dontextbuild">
284 Build External Client Code process aborted by user. Jalview source is unchanged.
286 <!-- Currently, this doesn't happen automatically.
287 1. Run WSDL2Java as below, which generates an ext.vamsas +
288 vamsas.<datapackages> fileset.
289 2. refactor ext.vamsas.SpecificserviceWS* to
290 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
291 3. Update the jalview.ws.*WServices classes to reflect the
292 interface type, and all locations of this wsdl type that Jalview
296 <path id="axisbuild">
297 <path refid="build.classpath"/>
299 <taskdef resource="axis-tasks.properties" classpathref="axisbuild"/>
301 <fileset dir="${sourceDir}" id="client">
302 <include name="${wsdl.ClientNS}/*.*"/>
307 output="${sourceDir}"
311 deployscope="Request"
318 namespace="${wsdl.Namespace}"
319 package="${wsdl.ClientNS}"
321 <mapping namespace="http://dataTypes.vamsas"
322 package="${wsdl.ClientNS}"/>
327 <target name="makedist" depends="build, buildPropertiesFile, buildindices">
328 <!-- make the package jar -->
329 <mkdir dir="${packageDir}"/>
331 <jar destfile="${packageDir}/${outputJar}">
333 <attribute name="Main-Class" value="jalview.bin.Jalview"/>
335 <fileset dir="${outputDir}/">
336 <exclude name="cache*/**"/>
337 <exclude name="*.jar" />
338 <exclude name="*.jar.*" />
339 <exclude name="**/*.jar" />
340 <exclude name="**/*.jar.*" />
344 <copy toDir="${packageDir}" flatten="true">
345 <fileset dir="${outputDir}">
346 <include name="*.jar"/>
347 <include name="**/*.jar"/>
353 <!-- jalopy code reformatter -->
354 <target name="sourcescrub" depends="init,build">
355 <jalopy destdir="jsrc" classpathref="run.classpath"
356 convention="jalview-jalopy.xml">
357 <fileset dir="${sourceDir}">
358 <include name="*.java"/>
359 <include name="**/*.java"/>
360 <include name="**/**/*.java"/>
367 <!-- Compile, package and obfuscate Jalview Applet -->
368 <target name="makeApplet" depends="obfuscate"/>
370 <target name="compileApplet" depends="init,clean">
371 <mkdir dir="${outputDir}"/>
374 srcdir="${sourceDir}"
375 destdir="${outputDir}"
376 debug="${javac.debug}"
377 classpath="lib/${jmolJar}"
378 includes="jalview/appletgui/**"
379 excludes="ext/**,MCview/**,org/**,vamsas/**"
383 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
384 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif"/>
385 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif"/>
386 <jar destfile="in.jar">
388 <attribute name="Main-Class" value="jalview.bin.JalviewLite"/>
390 <fileset dir="${outputDir}">
391 <include name="com/**"/>
392 <include name="MCview/**"/>
393 <include name="jalview/**"/>
394 <include name=".build_properties"/>
395 <include name="images/idwidth.gif"/>
396 <include name="images/link.gif"/>
400 <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally" description="construct the final jalviewLite applet jar with or without obfuscation">
402 <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
403 <copy file="in.jar" tofile="${jalviewLiteJar}" />
404 <delete file="in.jar"/>
406 <target name="-obfuscatereally" unless="donotobfuscate">
408 <path id="obfuscateDeps.path">
409 <pathelement location="${applet.jre.tools}"/>
410 <pathelement location="lib/${jmolJar}"/>
412 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
415 <injar file="in.jar"/>
416 <outjar file="${jalviewLiteJar}"/>
417 <libraryjar refid="obfuscateDeps.path"/>
418 <keep access="public" type="class"
419 name="jalview.bin.JalviewLite">
420 <field access="public"/>
421 <method access="public"/>
422 <constructor access="public"/>
424 <!-- -libraryjars "${obfuscateDeps}"
426 -outjars jalviewApplet.jar
427 -keep public class jalview.bin.JalviewLite
430 <delete file="in.jar"/>
433 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
434 <taskdef name="castor-srcgen"
435 classname="org.castor.anttask.CastorCodeGenTask"
436 classpathref="build.classpath" />
438 <fileset dir="${sourceDir}/jalview/schemabinding/version2">
439 <include name="*.java"/>
440 <include name="descriptors/*.java"/>
443 <castor-srcgen file="${schemaDir}/vamsas.xsd"
445 package="jalview.schemabinding.version2"
449 properties="${schemaDir}/jalview.properties"
451 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
453 package="jalview.schemabinding.version2"
457 properties="${schemaDir}/jalview.properties"
459 <castor-srcgen file="${schemaDir}/jalview.xsd"
461 package="jalview.schemabinding.version2"
465 properties="${schemaDir}/jalview.properties"
469 now build the jalview.binding package with the old schema set
472 <fileset dir="${sourceDir}/jalview/binding/">
476 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd"
478 package="jalview.binding"
482 properties="${schemaDir}/jalview.nodesc.properties"
484 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
486 package="jalview.binding"
490 properties="${schemaDir}/jalview.nodesc.properties"
492 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd"
494 package="jalview.binding"
498 properties="${schemaDir}/jalview.nodesc.properties"
501 <target name="sourcedist" description="create jalview source distribution" depends="init">
502 <delete file="${source.dist.name}"/>
503 <tar destfile="${source.dist.name}" compression="gzip">
504 <tarfileset dir="./" prefix="jalview" preserveLeadingSlashes="true">
505 <include name="LICENSE"/>
506 <include name="README"/>
507 <include name="build.xml"/>
508 <include name="jalview-jalopy.xml"/>
509 <include name="JalviewApplet.jpx"/>
510 <include name="JalviewX.jpx"/>
511 <include name="${sourceDir}/*.java"/>
512 <include name="${sourceDir}/**/*.java"/>
513 <include name="${sourceDir}/**/*.cdr"/>
514 <include name="${libDir}/**/*"/>
515 <include name="${resourceDir}/**/*"/>
516 <include name="${helpDir}/**/*"/>
517 <exclude name="**/*locales"/>
518 <exclude name="*locales/**"/>
519 <exclude name="utils/InstallAnywhere/**Build.iap_xml"/>
520 <exclude name="utils/InstallAnywhere/**Build*/**"/>
521 <exclude name="utils/InstallAnywhere/**Build*/**"/>
522 <exclude name="utils/InstallAnywhere/**locale*"/>
523 <exclude name="utils/InstallAnywhere/**locale*/**"/>
524 <include name="${schemaDir}/**/*"/>
525 <include name="utils/**/*"/>
526 <include name="${docDir}/**/*"/>