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"/>
60 <!-- Don't change anything below here unless you know what you are doing! -->
61 <!-- Url path for WebStart in JNLP file -->
62 <property name="WebStartLocation" value="http://www.jalview.org/webstart"/>
63 <!-- build directory configuration -->
64 <property name="libDir" value="lib"/>
65 <property name="resourceDir" value="resources"/>
66 <property name="helpDir" value="help"/>
67 <property name="docDir" value="doc"/>
68 <property name="sourceDir" value="src" />
69 <property name="schemaDir" value="schemas" />
70 <property name="outputDir" value="classes" />
71 <property name="packageDir" value="dist" />
72 <property name="outputJar" value="jalview.jar" />
73 <!-- Jalview Applet JMol Jar Dependency -->
74 <property name="jmolJar" value="Jmol-11.0.2.jar" />
75 <property name="jalviewLiteJar" value="jalviewApplet.jar"/>
76 <!-- switch to indicate if we should obfuscate jalviewLite -->
77 <!--<property name="donotobfuscate" value="true"/> -->
79 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
80 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
81 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
82 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
83 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
84 <property name="WSInterf" value="MsaWS" />
85 <property name="wsdl.Namespace" value="vamsas" />
86 <property name="wsdl.ClientNS" value="ext.vamsas" />
87 <!-- the class path for building the application -->
88 <path id="build.classpath">
90 <include name="*.jar"/>
91 <include name="**/*.jar"/>
93 <fileset dir="${libDir}">
94 <include name="*.jar"/>
95 <include name="**/*.jar"/>
99 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz"/>
100 <!-- The Location of the java 1.1.8 jdk -->
101 <property name="java118.home" value="C:\Sun\jdk1.1.8" />
102 <property name="applet.jre.tools" value="${java118.home}/lib/classes.zip"/>
103 <!-- jre for 1.4 version
104 <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
106 <!-- the classpath for building the 1.1 applet -->
107 <path id="jalviewlite.deps">
108 <fileset dir="${java118.home}">
109 <include name="lib/classes.zip"/>
111 <pathelement location="lib/${jmolJar}"/>
116 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties"/>
117 <target name="buildPropertiesFile" depends="init">
118 <tstamp prefix="build">
119 <format property="date" pattern="dd MMMM yyyy"/>
121 <properties file="${outputDir}/.build_properties">
123 ---Jalview Build Details---
125 <property name="VERSION" value="${JALVIEW_VERSION}"/>
126 <property name="BUILD_DATE" value="${build.date}"/>
131 <target name="clean" depends="init">
132 <!-- not efficient yet. -->
133 <delete dir="${outputDir}"/>
136 <target name="distclean" depends="init, clean">
138 <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
141 <include name="${outputJar}"/>
142 <include name="#*#"/>
143 <include name="#*.*#"/>
144 <include name="**/#*#"/>
145 <include name="**/#*.*#"/>
147 <include name="*.*~"/>
148 <include name="**/*~"/>
149 <include name="**/*.*~"/>
154 <target name="prepare" depends="init">
155 <mkdir dir="${outputDir}"/>
156 <copy todir="${outputDir}">
158 <include name="${docDir}/**/*.*"/>
159 <include name="${helpDir}/**/*.*"/>
160 <include name="${libDir}/*.jar"/>
162 <fileset dir="${resourceDir}">
163 <include name="**/*.*"/>
168 <target name="build" depends="prepare">
169 <!-- not efficient yet. -->
170 <javac source="1.4" target="1.4"
171 srcdir ="${sourceDir}"
172 destdir="${outputDir}"
173 debug="${javac.debug}"
174 classpathref="build.classpath">
175 <exclude name="jalview/*applet*"/>
176 <exclude name="com/stevesoft/**"/>
179 <target name="buildindices" depends="init, prepare"
180 unless="help.uptodate">
182 classname="com.sun.java.help.search.Indexer"
183 classpathref="build.classpath"
185 dir="${outputDir}/${helpDir}"
191 <target name="makefulldist" depends="makedist">
192 <!-- the default keystore details might need to be edited here -->
194 storepass="alignmentisfun"
195 keypass="alignmentisfun"
196 keystore="keys/.keystore"
202 <fileset dir="${packageDir}">
203 <include name="*.jar"/>
206 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties"/>
208 <!-- codebase="http://www.jalview.org/jalview/webstart" -->
209 <!-- href="jalview.jnlp" prevent hard-wired pickup of jnlp in certain javaws versions -->
210 <jnlp toFile="${packageDir}/jalview.jnlp"
211 codebase="${WebStartLocation}">
213 <title>Jalview</title>
214 <vendor>The Barton Group</vendor>
215 <homepage href="http://www.jalview.org"/>
216 <description>Jalview Multiple Alignment Editor</description>
217 <description kind="short">Jalview</description>
218 <icon href="logo_big.gif"/>
221 <association mime-type="application-x/ext-file" extensions="fa"/>
222 <association mime-type="application-x/ext-file" extensions="fasta"/>
223 <association mime-type="application-x/ext-file" extensions="fastq"/>
224 <association mime-type="application-x/ext-file" extensions="blc"/>
225 <association mime-type="application-x/ext-file" extensions="msf"/>
226 <association mime-type="application-x/ext-file" extensions="pfam"/>
227 <association mime-type="application-x/ext-file" extensions="aln"/>
228 <association mime-type="application-x/ext-file" extensions="pir"/>
229 <association mime-type="application-x/ext-file" extensions="amsa"/>
233 <j2se version="1.4+"/>
234 <fileset dir="${packageDir}">
235 <include name="jalview.jar"/>
237 <fileset dir="${packageDir}">
238 <include name="*.jar"/>
239 <exclude name="jalview.jar"/>
241 <property name="jalview.version" value="${JALVIEW_VERSION}"/>
243 <application_desc main_class="jalview.bin.Jalview">
250 <target name="runenv" depends="init">
251 <path id="run.classpath">
252 <pathelement location="${outputDir}"/>
253 <fileset dir="${outputDir}">
254 <include name="${libDir}/*.jar"/>
257 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath"/>
259 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
263 <target name="buildextclients" depends="init">
264 <input message="Building external client source from WSDLs - Do you really want to do this ? (Yy/Nn)"
265 validargs="Y,y,n,N" defaultvalue="N"
266 addproperty="doextbuild.response"/>
267 <condition property="dontextbuild">
268 <equals arg1="n" arg2="${doextbuild.response}"/>
270 <condition property="dontextbuild">
271 <equals arg1="N" arg2="${doextbuild.response}"/>
273 <fail if="dontextbuild">
274 Build External Client Code process aborted by user. Jalview source is unchanged.
276 <!-- Currently, this doesn't happen automatically.
277 1. Run WSDL2Java as below, which generates an ext.vamsas +
278 vamsas.<datapackages> fileset.
279 2. refactor ext.vamsas.SpecificserviceWS* to
280 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
281 3. Update the jalview.ws.*WServices classes to reflect the
282 interface type, and all locations of this wsdl type that Jalview
286 <path id="axisbuild">
287 <path refid="build.classpath"/>
289 <taskdef resource="axis-tasks.properties" classpathref="axisbuild"/>
291 <fileset dir="${sourceDir}" id="client">
292 <include name="${wsdl.ClientNS}/*.*"/>
297 output="${sourceDir}"
301 deployscope="Request"
308 namespace="${wsdl.Namespace}"
309 package="${wsdl.ClientNS}"
311 <mapping namespace="http://dataTypes.vamsas"
312 package="${wsdl.ClientNS}"/>
317 <target name="makedist" depends="build, buildPropertiesFile, buildindices">
318 <!-- make the package jar -->
319 <mkdir dir="${packageDir}"/>
321 <jar destfile="${packageDir}/${outputJar}">
323 <attribute name="Main-Class" value="jalview.bin.Jalview"/>
325 <fileset dir="${outputDir}/">
326 <exclude name="cache*/**"/>
327 <exclude name="*.jar" />
328 <exclude name="*.jar.*" />
329 <exclude name="**/*.jar" />
330 <exclude name="**/*.jar.*" />
334 <copy toDir="${packageDir}" flatten="true">
335 <fileset dir="${outputDir}">
336 <include name="*.jar"/>
337 <include name="**/*.jar"/>
343 <!-- jalopy code reformatter -->
344 <target name="sourcescrub" depends="init,build">
345 <jalopy destdir="jsrc" classpathref="run.classpath"
346 convention="jalview-jalopy.xml">
347 <fileset dir="${sourceDir}">
348 <include name="*.java"/>
349 <include name="**/*.java"/>
350 <include name="**/**/*.java"/>
357 <!-- Compile, package and obfuscate Jalview Applet -->
358 <target name="makeApplet" depends="obfuscate"/>
360 <target name="compileApplet" depends="init,clean">
361 <mkdir dir="${outputDir}"/>
364 srcdir="${sourceDir}"
365 destdir="${outputDir}"
366 debug="${javac.debug}"
367 classpath="lib/${jmolJar}"
368 includes="jalview/appletgui/**"
369 excludes="ext/**,MCview/**,org/**,vamsas/**"
373 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
374 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif"/>
375 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif"/>
376 <jar destfile="in.jar">
378 <attribute name="Main-Class" value="jalview.bin.JalviewLite"/>
380 <fileset dir="${outputDir}">
381 <include name="com/**"/>
382 <include name="MCview/**"/>
383 <include name="jalview/**"/>
384 <include name=".build_properties"/>
385 <include name="images/idwidth.gif"/>
386 <include name="images/link.gif"/>
390 <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally" description="construct the final jalviewLite applet jar with or without obfuscation">
392 <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
393 <copy file="in.jar" tofile="${jalviewLiteJar}" />
394 <delete file="in.jar"/>
396 <target name="-obfuscatereally" unless="donotobfuscate">
398 <path id="obfuscateDeps.path">
399 <pathelement location="${applet.jre.tools}"/>
400 <pathelement location="lib/${jmolJar}"/>
402 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
405 <injar file="in.jar"/>
406 <outjar file="${jalviewLiteJar}"/>
407 <libraryjar refid="obfuscateDeps.path"/>
408 <keep access="public" type="class"
409 name="jalview.bin.JalviewLite">
410 <field access="public"/>
411 <method access="public"/>
412 <constructor access="public"/>
414 <!-- -libraryjars "${obfuscateDeps}"
416 -outjars jalviewApplet.jar
417 -keep public class jalview.bin.JalviewLite
420 <delete file="in.jar"/>
423 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
424 <taskdef name="castor-srcgen"
425 classname="org.castor.anttask.CastorCodeGenTask"
426 classpathref="build.classpath" />
428 <fileset dir="${sourceDir}/jalview/schemabinding/version2">
429 <include name="*.java"/>
430 <include name="descriptors/*.java"/>
433 <castor-srcgen file="${schemaDir}/vamsas.xsd"
435 package="jalview.schemabinding.version2"
439 properties="${schemaDir}/jalview.properties"
441 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
443 package="jalview.schemabinding.version2"
447 properties="${schemaDir}/jalview.properties"
449 <castor-srcgen file="${schemaDir}/jalview.xsd"
451 package="jalview.schemabinding.version2"
455 properties="${schemaDir}/jalview.properties"
459 now build the jalview.binding package with the old schema set
462 <fileset dir="${sourceDir}/jalview/binding/">
466 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd"
468 package="jalview.binding"
472 properties="${schemaDir}/jalview.nodesc.properties"
474 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
476 package="jalview.binding"
480 properties="${schemaDir}/jalview.nodesc.properties"
482 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd"
484 package="jalview.binding"
488 properties="${schemaDir}/jalview.nodesc.properties"
491 <target name="sourcedist" description="create jalview source distribution" depends="init">
492 <delete file="${source.dist.name}"/>
493 <tar destfile="${source.dist.name}" compression="gzip">
494 <tarfileset dir="./" prefix="jalview" preserveLeadingSlashes="true">
495 <include name="LICENSE"/>
496 <include name="README"/>
497 <include name="build.xml"/>
498 <include name="jalview-jalopy.xml"/>
499 <include name="JalviewApplet.jpx"/>
500 <include name="JalviewX.jpx"/>
501 <include name="${sourceDir}/*.java"/>
502 <include name="${sourceDir}/**/*.java"/>
503 <include name="${sourceDir}/**/*.cdr"/>
504 <include name="${libDir}/**/*"/>
505 <include name="${resourceDir}/**/*"/>
506 <include name="${helpDir}/**/*"/>
507 <include name="utils/**/*"/>
508 <include name="${schemaDir}/**/*"/>
509 <include name="${docDir}/**/*"/>