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"/>
58 <!-- Don't change anything below here unless you know what you are doing! -->
59 <!-- Url path for WebStart in JNLP file -->
60 <property name="WebStartLocation" value="http://www.jalview.org/webstart"/>
61 <!-- build directory configuration -->
62 <property name="libDir" value="lib"/>
63 <property name="resourceDir" value="resources"/>
64 <property name="helpDir" value="help"/>
65 <property name="docDir" value="doc"/>
66 <property name="sourceDir" value="src" />
67 <property name="schemaDir" value="schemas" />
68 <property name="outputDir" value="classes" />
69 <property name="packageDir" value="dist" />
70 <property name="outputJar" value="jalview.jar" />
71 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
72 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
73 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
74 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
75 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
76 <property name="WSInterf" value="MsaWS" />
77 <property name="wsdl.Namespace" value="vamsas" />
78 <property name="wsdl.ClientNS" value="ext.vamsas" />
79 <!-- the class path for building the application -->
80 <path id="build.classpath">
82 <include name="*.jar"/>
83 <include name="**/*.jar"/>
85 <fileset dir="${libDir}">
86 <include name="*.jar"/>
87 <include name="**/*.jar"/>
90 <!-- The Location of the java 1.1.8 jdk -->
91 <property name="java118.home" value="C:\Sun\jdk1.1.8" />
92 <!-- the classpath for building the 1.1 applet -->
93 <path id="jalviewlite.deps">
94 <fileset dir="${java118.home}">
95 <include name="lib/classes.zip"/>
97 <pathelement location="lib/jmol.jar"/>
102 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties"/>
103 <target name="buildPropertiesFile" depends="init">
104 <tstamp prefix="build">
105 <format property="date" pattern="dd MMMM yyyy"/>
107 <properties file="${outputDir}/.build_properties">
109 ---Jalview Build Details---
111 <property name="VERSION" value="${JALVIEW_VERSION}"/>
112 <property name="BUILD_DATE" value="${build.date}"/>
117 <target name="clean" depends="init">
118 <!-- not efficient yet. -->
119 <delete dir="${outputDir}"/>
122 <target name="distclean" depends="init, clean">
124 <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
127 <include name="${outputJar}"/>
128 <include name="#*#"/>
129 <include name="#*.*#"/>
130 <include name="**/#*#"/>
131 <include name="**/#*.*#"/>
133 <include name="*.*~"/>
134 <include name="**/*~"/>
135 <include name="**/*.*~"/>
140 <target name="prepare" depends="init">
141 <mkdir dir="${outputDir}"/>
142 <copy todir="${outputDir}">
144 <include name="${docDir}/**/*.*"/>
145 <include name="${helpDir}/**/*.*"/>
146 <include name="${libDir}/*.jar"/>
148 <fileset dir="${resourceDir}">
149 <include name="**/*.*"/>
154 <target name="build" depends="prepare">
155 <!-- not efficient yet. -->
156 <javac source="1.4" target="1.4"
157 srcdir ="${sourceDir}"
158 destdir="${outputDir}"
159 classpathref="build.classpath">
160 <exclude name="jalview/*applet*"/>
161 <exclude name="com/stevesoft/**"/>
164 <target name="buildindices" depends="init, prepare"
165 unless="help.uptodate">
167 classname="com.sun.java.help.search.Indexer"
168 classpathref="build.classpath"
170 dir="${outputDir}/${helpDir}"
176 <target name="makefulldist" depends="makedist">
177 <!-- the default keystore details might need to be edited here -->
179 storepass="alignmentisfun"
180 keypass="alignmentisfun"
181 keystore="keys/.keystore"
187 <fileset dir="${packageDir}">
188 <include name="*.jar"/>
191 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties"/>
193 <!-- codebase="http://www.jalview.org/jalview/webstart" -->
194 <jnlp toFile="${packageDir}/jalview.jnlp" href="jalview.jnlp"
195 codebase="${WebStartLocation}">
197 <title>Jalview</title>
198 <vendor>The Barton Group</vendor>
199 <homepage href="http://www.jalview.org"/>
200 <description>Jalview Multiple Alignment Editor</description>
201 <description kind="short">Jalview</description>
202 <icon href="logo_big.gif"/>
205 <association mime-type="application-x/ext-file" extensions="fa"/>
206 <association mime-type="application-x/ext-file" extensions="fasta"/>
207 <association mime-type="application-x/ext-file" extensions="fastq"/>
208 <association mime-type="application-x/ext-file" extensions="blc"/>
209 <association mime-type="application-x/ext-file" extensions="msf"/>
210 <association mime-type="application-x/ext-file" extensions="pfam"/>
211 <association mime-type="application-x/ext-file" extensions="aln"/>
212 <association mime-type="application-x/ext-file" extensions="pir"/>
216 <j2se version="1.4+"/>
217 <fileset dir="${packageDir}">
218 <include name="jalview.jar"/>
220 <fileset dir="${packageDir}">
221 <include name="*.jar"/>
222 <exclude name="jalview.jar"/>
224 <property name="jalview.version" value="${JALVIEW_VERSION}"/>
226 <application_desc main_class="jalview.bin.Jalview">
233 <target name="runenv" depends="init">
234 <path id="run.classpath">
235 <pathelement location="${outputDir}"/>
236 <fileset dir="${outputDir}">
237 <include name="${libDir}/*.jar"/>
240 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath"/>
242 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
246 <target name="buildextclients" depends="init">
247 <input message="Building external client source from WSDLs - Do you really want to do this ? (Yy/Nn)"
248 validargs="Y,y,n,N" defaultvalue="N"
249 addproperty="doextbuild.response"/>
250 <condition property="dontextbuild">
251 <equals arg1="n" arg2="${doextbuild.response}"/>
253 <condition property="dontextbuild">
254 <equals arg1="N" arg2="${doextbuild.response}"/>
256 <fail if="dontextbuild">
257 Build External Client Code process aborted by user. Jalview source is unchanged.
259 <!-- Currently, this doesn't happen automatically.
260 1. Run WSDL2Java as below, which generates an ext.vamsas +
261 vamsas.<datapackages> fileset.
262 2. refactor ext.vamsas.SpecificserviceWS* to
263 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
264 3. Update the jalview.ws.*WServices classes to reflect the
265 interface type, and all locations of this wsdl type that Jalview
269 <path id="axisbuild">
270 <path refid="build.classpath"/>
272 <taskdef resource="axis-tasks.properties" classpathref="axisbuild"/>
274 <fileset dir="${sourceDir}" id="client">
275 <include name="${wsdl.ClientNS}/*.*"/>
280 output="${sourceDir}"
284 deployscope="Request"
291 namespace="${wsdl.Namespace}"
292 package="${wsdl.ClientNS}"
294 <mapping namespace="http://dataTypes.vamsas"
295 package="${wsdl.ClientNS}"/>
300 <target name="makedist" depends="build, buildPropertiesFile, buildindices">
301 <!-- make the package jar -->
302 <mkdir dir="${packageDir}"/>
304 <jar destfile="${packageDir}/${outputJar}">
306 <attribute name="Main-Class" value="jalview.bin.Jalview"/>
308 <fileset dir="${outputDir}/">
309 <exclude name="cache*/**"/>
310 <exclude name="*.jar" />
311 <exclude name="*.jar.*" />
312 <exclude name="**/*.jar" />
313 <exclude name="**/*.jar.*" />
317 <copy toDir="${packageDir}" flatten="true">
318 <fileset dir="${outputDir}">
319 <include name="*.jar"/>
320 <include name="**/*.jar"/>
326 <!-- jalopy code reformatter -->
327 <target name="sourcescrub" depends="init,build">
328 <jalopy destdir="jsrc" classpathref="run.classpath"
329 convention="jalview-jalopy.xml">
330 <fileset dir="${sourceDir}">
331 <include name="*.java"/>
332 <include name="**/*.java"/>
333 <include name="**/**/*.java"/>
340 <!-- Compile, package and obfuscate Jalview Applet -->
341 <target name="makeApplet" depends="obfuscate"/>
343 <target name="compileApplet" depends="init,clean">
344 <mkdir dir="${outputDir}"/>
347 srcdir="${sourceDir}"
348 destdir="${outputDir}"
349 classpath="lib/JmolApplet.jar"
350 includes="jalview/appletgui/**"
351 excludes="ext/**,MCview/**,org/**,vamsas/**"
355 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
356 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif"/>
357 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif"/>
358 <jar destfile="in.jar">
360 <attribute name="Main-Class" value="jalview.bin.JalviewLite"/>
362 <fileset dir="${outputDir}">
363 <include name="com/**"/>
364 <include name="MCview/**"/>
365 <include name="jalview/**"/>
366 <include name=".build_properties"/>
367 <include name="images/idwidth.gif"/>
368 <include name="images/link.gif"/>
373 <target name="obfuscate" depends="packageApplet">
374 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
376 -libraryjars "${java.home}/lib/rt.jar";lib/JmolApplet.jar
378 -outjars jalviewApplet.jar
379 -keep public class jalview.bin.JalviewLite
382 <delete file="in.jar"/>
385 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
386 <taskdef name="castor-srcgen"
387 classname="org.castor.anttask.CastorCodeGenTask"
388 classpathref="build.classpath" />
390 <fileset dir="${sourceDir}/jalview/schemabinding/version2">
391 <include name="*.java"/>
392 <include name="descriptors/*.java"/>
395 <castor-srcgen file="${schemaDir}/vamsas.xsd"
397 package="jalview.schemabinding.version2"
401 properties="${schemaDir}/jalview.properties"
403 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
405 package="jalview.schemabinding.version2"
409 properties="${schemaDir}/jalview.properties"
411 <castor-srcgen file="${schemaDir}/jalview.xsd"
413 package="jalview.schemabinding.version2"
417 properties="${schemaDir}/jalview.properties"
421 now build the jalview.binding package with the old schema set
424 <fileset dir="${sourceDir}/jalview/binding/">
428 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd"
430 package="jalview.binding"
434 properties="${schemaDir}/jalview.nodesc.properties"
436 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
438 package="jalview.binding"
442 properties="${schemaDir}/jalview.nodesc.properties"
444 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd"
446 package="jalview.binding"
450 properties="${schemaDir}/jalview.nodesc.properties"