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 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
76 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
77 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
78 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
79 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
80 <property name="WSInterf" value="MsaWS" />
81 <property name="wsdl.Namespace" value="vamsas" />
82 <property name="wsdl.ClientNS" value="ext.vamsas" />
83 <!-- the class path for building the application -->
84 <path id="build.classpath">
86 <include name="*.jar"/>
87 <include name="**/*.jar"/>
89 <fileset dir="${libDir}">
90 <include name="*.jar"/>
91 <include name="**/*.jar"/>
94 <!-- The Location of the java 1.1.8 jdk -->
95 <property name="java118.home" value="C:\Sun\jdk1.1.8" />
96 <property name="applet.jre.tools" value="${java118.home}/lib/classes.zip"/>
97 <!-- jre for 1.4 version
98 <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
100 <!-- the classpath for building the 1.1 applet -->
101 <path id="jalviewlite.deps">
102 <fileset dir="${java118.home}">
103 <include name="lib/classes.zip"/>
105 <pathelement location="lib/${jmolJar}"/>
110 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties"/>
111 <target name="buildPropertiesFile" depends="init">
112 <tstamp prefix="build">
113 <format property="date" pattern="dd MMMM yyyy"/>
115 <properties file="${outputDir}/.build_properties">
117 ---Jalview Build Details---
119 <property name="VERSION" value="${JALVIEW_VERSION}"/>
120 <property name="BUILD_DATE" value="${build.date}"/>
125 <target name="clean" depends="init">
126 <!-- not efficient yet. -->
127 <delete dir="${outputDir}"/>
130 <target name="distclean" depends="init, clean">
132 <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
135 <include name="${outputJar}"/>
136 <include name="#*#"/>
137 <include name="#*.*#"/>
138 <include name="**/#*#"/>
139 <include name="**/#*.*#"/>
141 <include name="*.*~"/>
142 <include name="**/*~"/>
143 <include name="**/*.*~"/>
148 <target name="prepare" depends="init">
149 <mkdir dir="${outputDir}"/>
150 <copy todir="${outputDir}">
152 <include name="${docDir}/**/*.*"/>
153 <include name="${helpDir}/**/*.*"/>
154 <include name="${libDir}/*.jar"/>
156 <fileset dir="${resourceDir}">
157 <include name="**/*.*"/>
162 <target name="build" depends="prepare">
163 <!-- not efficient yet. -->
164 <javac source="1.4" target="1.4"
165 srcdir ="${sourceDir}"
166 destdir="${outputDir}"
167 debug="${javac.debug}"
168 classpathref="build.classpath">
169 <exclude name="jalview/*applet*"/>
170 <exclude name="com/stevesoft/**"/>
173 <target name="buildindices" depends="init, prepare"
174 unless="help.uptodate">
176 classname="com.sun.java.help.search.Indexer"
177 classpathref="build.classpath"
179 dir="${outputDir}/${helpDir}"
185 <target name="makefulldist" depends="makedist">
186 <!-- the default keystore details might need to be edited here -->
188 storepass="alignmentisfun"
189 keypass="alignmentisfun"
190 keystore="keys/.keystore"
196 <fileset dir="${packageDir}">
197 <include name="*.jar"/>
200 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties"/>
202 <!-- codebase="http://www.jalview.org/jalview/webstart" -->
203 <jnlp toFile="${packageDir}/jalview.jnlp" href="jalview.jnlp"
204 codebase="${WebStartLocation}">
206 <title>Jalview</title>
207 <vendor>The Barton Group</vendor>
208 <homepage href="http://www.jalview.org"/>
209 <description>Jalview Multiple Alignment Editor</description>
210 <description kind="short">Jalview</description>
211 <icon href="logo_big.gif"/>
214 <association mime-type="application-x/ext-file" extensions="fa"/>
215 <association mime-type="application-x/ext-file" extensions="fasta"/>
216 <association mime-type="application-x/ext-file" extensions="fastq"/>
217 <association mime-type="application-x/ext-file" extensions="blc"/>
218 <association mime-type="application-x/ext-file" extensions="msf"/>
219 <association mime-type="application-x/ext-file" extensions="pfam"/>
220 <association mime-type="application-x/ext-file" extensions="aln"/>
221 <association mime-type="application-x/ext-file" extensions="pir"/>
225 <j2se version="1.4+"/>
226 <fileset dir="${packageDir}">
227 <include name="jalview.jar"/>
229 <fileset dir="${packageDir}">
230 <include name="*.jar"/>
231 <exclude name="jalview.jar"/>
233 <property name="jalview.version" value="${JALVIEW_VERSION}"/>
235 <application_desc main_class="jalview.bin.Jalview">
242 <target name="runenv" depends="init">
243 <path id="run.classpath">
244 <pathelement location="${outputDir}"/>
245 <fileset dir="${outputDir}">
246 <include name="${libDir}/*.jar"/>
249 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath"/>
251 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
255 <target name="buildextclients" depends="init">
256 <input message="Building external client source from WSDLs - Do you really want to do this ? (Yy/Nn)"
257 validargs="Y,y,n,N" defaultvalue="N"
258 addproperty="doextbuild.response"/>
259 <condition property="dontextbuild">
260 <equals arg1="n" arg2="${doextbuild.response}"/>
262 <condition property="dontextbuild">
263 <equals arg1="N" arg2="${doextbuild.response}"/>
265 <fail if="dontextbuild">
266 Build External Client Code process aborted by user. Jalview source is unchanged.
268 <!-- Currently, this doesn't happen automatically.
269 1. Run WSDL2Java as below, which generates an ext.vamsas +
270 vamsas.<datapackages> fileset.
271 2. refactor ext.vamsas.SpecificserviceWS* to
272 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
273 3. Update the jalview.ws.*WServices classes to reflect the
274 interface type, and all locations of this wsdl type that Jalview
278 <path id="axisbuild">
279 <path refid="build.classpath"/>
281 <taskdef resource="axis-tasks.properties" classpathref="axisbuild"/>
283 <fileset dir="${sourceDir}" id="client">
284 <include name="${wsdl.ClientNS}/*.*"/>
289 output="${sourceDir}"
293 deployscope="Request"
300 namespace="${wsdl.Namespace}"
301 package="${wsdl.ClientNS}"
303 <mapping namespace="http://dataTypes.vamsas"
304 package="${wsdl.ClientNS}"/>
309 <target name="makedist" depends="build, buildPropertiesFile, buildindices">
310 <!-- make the package jar -->
311 <mkdir dir="${packageDir}"/>
313 <jar destfile="${packageDir}/${outputJar}">
315 <attribute name="Main-Class" value="jalview.bin.Jalview"/>
317 <fileset dir="${outputDir}/">
318 <exclude name="cache*/**"/>
319 <exclude name="*.jar" />
320 <exclude name="*.jar.*" />
321 <exclude name="**/*.jar" />
322 <exclude name="**/*.jar.*" />
326 <copy toDir="${packageDir}" flatten="true">
327 <fileset dir="${outputDir}">
328 <include name="*.jar"/>
329 <include name="**/*.jar"/>
335 <!-- jalopy code reformatter -->
336 <target name="sourcescrub" depends="init,build">
337 <jalopy destdir="jsrc" classpathref="run.classpath"
338 convention="jalview-jalopy.xml">
339 <fileset dir="${sourceDir}">
340 <include name="*.java"/>
341 <include name="**/*.java"/>
342 <include name="**/**/*.java"/>
349 <!-- Compile, package and obfuscate Jalview Applet -->
350 <target name="makeApplet" depends="obfuscate"/>
352 <target name="compileApplet" depends="init,clean">
353 <mkdir dir="${outputDir}"/>
356 srcdir="${sourceDir}"
357 destdir="${outputDir}"
358 classpath="lib/${jmolJar}"
359 includes="jalview/appletgui/**"
360 excludes="ext/**,MCview/**,org/**,vamsas/**"
364 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
365 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif"/>
366 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif"/>
367 <jar destfile="in.jar">
369 <attribute name="Main-Class" value="jalview.bin.JalviewLite"/>
371 <fileset dir="${outputDir}">
372 <include name="com/**"/>
373 <include name="MCview/**"/>
374 <include name="jalview/**"/>
375 <include name=".build_properties"/>
376 <include name="images/idwidth.gif"/>
377 <include name="images/link.gif"/>
382 <target name="obfuscate" depends="packageApplet">
383 <path id="obfuscateDeps.path">
384 <pathelement location="${applet.jre.tools}"/>
385 <pathelement location="lib/${jmolJar}"/>
387 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
389 <injar file="in.jar"/>
390 <outjar file="jalviewApplet.jar"/>
391 <libraryjar refid="obfuscateDeps.path"/>
392 <keep access="public" type="class"
393 name="jalview.bin.JalviewLite">
394 <field access="public"/>
395 <method access="public"/>
396 <constructor access="public"/>
398 <!-- -libraryjars "${obfuscateDeps}"
400 -outjars jalviewApplet.jar
401 -keep public class jalview.bin.JalviewLite
405 <delete file="in.jar"/>
408 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
409 <taskdef name="castor-srcgen"
410 classname="org.castor.anttask.CastorCodeGenTask"
411 classpathref="build.classpath" />
413 <fileset dir="${sourceDir}/jalview/schemabinding/version2">
414 <include name="*.java"/>
415 <include name="descriptors/*.java"/>
418 <castor-srcgen file="${schemaDir}/vamsas.xsd"
420 package="jalview.schemabinding.version2"
424 properties="${schemaDir}/jalview.properties"
426 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
428 package="jalview.schemabinding.version2"
432 properties="${schemaDir}/jalview.properties"
434 <castor-srcgen file="${schemaDir}/jalview.xsd"
436 package="jalview.schemabinding.version2"
440 properties="${schemaDir}/jalview.properties"
444 now build the jalview.binding package with the old schema set
447 <fileset dir="${sourceDir}/jalview/binding/">
451 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd"
453 package="jalview.binding"
457 properties="${schemaDir}/jalview.nodesc.properties"
459 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
461 package="jalview.binding"
465 properties="${schemaDir}/jalview.nodesc.properties"
467 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd"
469 package="jalview.binding"
473 properties="${schemaDir}/jalview.nodesc.properties"