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 Applet JMol Jar Dependency -->
72 <property name="jmolJar" value="Jmol-11.0.2.jar" />
73 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
74 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
75 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
76 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
77 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
78 <property name="WSInterf" value="MsaWS" />
79 <property name="wsdl.Namespace" value="vamsas" />
80 <property name="wsdl.ClientNS" value="ext.vamsas" />
81 <!-- the class path for building the application -->
82 <path id="build.classpath">
84 <include name="*.jar"/>
85 <include name="**/*.jar"/>
87 <fileset dir="${libDir}">
88 <include name="*.jar"/>
89 <include name="**/*.jar"/>
92 <!-- The Location of the java 1.1.8 jdk -->
93 <property name="java118.home" value="C:\Sun\jdk1.1.8" />
94 <property name="applet.jre.tools" value="${java118.home}/lib/classes.zip"/>
95 <!-- jre for 1.4 version
96 <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
98 <!-- the classpath for building the 1.1 applet -->
99 <path id="jalviewlite.deps">
100 <fileset dir="${java118.home}">
101 <include name="lib/classes.zip"/>
103 <pathelement location="lib/${jmolJar}"/>
108 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties"/>
109 <target name="buildPropertiesFile" depends="init">
110 <tstamp prefix="build">
111 <format property="date" pattern="dd MMMM yyyy"/>
113 <properties file="${outputDir}/.build_properties">
115 ---Jalview Build Details---
117 <property name="VERSION" value="${JALVIEW_VERSION}"/>
118 <property name="BUILD_DATE" value="${build.date}"/>
123 <target name="clean" depends="init">
124 <!-- not efficient yet. -->
125 <delete dir="${outputDir}"/>
128 <target name="distclean" depends="init, clean">
130 <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
133 <include name="${outputJar}"/>
134 <include name="#*#"/>
135 <include name="#*.*#"/>
136 <include name="**/#*#"/>
137 <include name="**/#*.*#"/>
139 <include name="*.*~"/>
140 <include name="**/*~"/>
141 <include name="**/*.*~"/>
146 <target name="prepare" depends="init">
147 <mkdir dir="${outputDir}"/>
148 <copy todir="${outputDir}">
150 <include name="${docDir}/**/*.*"/>
151 <include name="${helpDir}/**/*.*"/>
152 <include name="${libDir}/*.jar"/>
154 <fileset dir="${resourceDir}">
155 <include name="**/*.*"/>
160 <target name="build" depends="prepare">
161 <!-- not efficient yet. -->
162 <javac source="1.4" target="1.4"
163 srcdir ="${sourceDir}"
164 destdir="${outputDir}"
165 classpathref="build.classpath">
166 <exclude name="jalview/*applet*"/>
167 <exclude name="com/stevesoft/**"/>
170 <target name="buildindices" depends="init, prepare"
171 unless="help.uptodate">
173 classname="com.sun.java.help.search.Indexer"
174 classpathref="build.classpath"
176 dir="${outputDir}/${helpDir}"
182 <target name="makefulldist" depends="makedist">
183 <!-- the default keystore details might need to be edited here -->
185 storepass="alignmentisfun"
186 keypass="alignmentisfun"
187 keystore="keys/.keystore"
193 <fileset dir="${packageDir}">
194 <include name="*.jar"/>
197 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties"/>
199 <!-- codebase="http://www.jalview.org/jalview/webstart" -->
200 <jnlp toFile="${packageDir}/jalview.jnlp" href="jalview.jnlp"
201 codebase="${WebStartLocation}">
203 <title>Jalview</title>
204 <vendor>The Barton Group</vendor>
205 <homepage href="http://www.jalview.org"/>
206 <description>Jalview Multiple Alignment Editor</description>
207 <description kind="short">Jalview</description>
208 <icon href="logo_big.gif"/>
211 <association mime-type="application-x/ext-file" extensions="fa"/>
212 <association mime-type="application-x/ext-file" extensions="fasta"/>
213 <association mime-type="application-x/ext-file" extensions="fastq"/>
214 <association mime-type="application-x/ext-file" extensions="blc"/>
215 <association mime-type="application-x/ext-file" extensions="msf"/>
216 <association mime-type="application-x/ext-file" extensions="pfam"/>
217 <association mime-type="application-x/ext-file" extensions="aln"/>
218 <association mime-type="application-x/ext-file" extensions="pir"/>
222 <j2se version="1.4+"/>
223 <fileset dir="${packageDir}">
224 <include name="jalview.jar"/>
226 <fileset dir="${packageDir}">
227 <include name="*.jar"/>
228 <exclude name="jalview.jar"/>
230 <property name="jalview.version" value="${JALVIEW_VERSION}"/>
232 <application_desc main_class="jalview.bin.Jalview">
239 <target name="runenv" depends="init">
240 <path id="run.classpath">
241 <pathelement location="${outputDir}"/>
242 <fileset dir="${outputDir}">
243 <include name="${libDir}/*.jar"/>
246 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath"/>
248 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
252 <target name="buildextclients" depends="init">
253 <input message="Building external client source from WSDLs - Do you really want to do this ? (Yy/Nn)"
254 validargs="Y,y,n,N" defaultvalue="N"
255 addproperty="doextbuild.response"/>
256 <condition property="dontextbuild">
257 <equals arg1="n" arg2="${doextbuild.response}"/>
259 <condition property="dontextbuild">
260 <equals arg1="N" arg2="${doextbuild.response}"/>
262 <fail if="dontextbuild">
263 Build External Client Code process aborted by user. Jalview source is unchanged.
265 <!-- Currently, this doesn't happen automatically.
266 1. Run WSDL2Java as below, which generates an ext.vamsas +
267 vamsas.<datapackages> fileset.
268 2. refactor ext.vamsas.SpecificserviceWS* to
269 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
270 3. Update the jalview.ws.*WServices classes to reflect the
271 interface type, and all locations of this wsdl type that Jalview
275 <path id="axisbuild">
276 <path refid="build.classpath"/>
278 <taskdef resource="axis-tasks.properties" classpathref="axisbuild"/>
280 <fileset dir="${sourceDir}" id="client">
281 <include name="${wsdl.ClientNS}/*.*"/>
286 output="${sourceDir}"
290 deployscope="Request"
297 namespace="${wsdl.Namespace}"
298 package="${wsdl.ClientNS}"
300 <mapping namespace="http://dataTypes.vamsas"
301 package="${wsdl.ClientNS}"/>
306 <target name="makedist" depends="build, buildPropertiesFile, buildindices">
307 <!-- make the package jar -->
308 <mkdir dir="${packageDir}"/>
310 <jar destfile="${packageDir}/${outputJar}">
312 <attribute name="Main-Class" value="jalview.bin.Jalview"/>
314 <fileset dir="${outputDir}/">
315 <exclude name="cache*/**"/>
316 <exclude name="*.jar" />
317 <exclude name="*.jar.*" />
318 <exclude name="**/*.jar" />
319 <exclude name="**/*.jar.*" />
323 <copy toDir="${packageDir}" flatten="true">
324 <fileset dir="${outputDir}">
325 <include name="*.jar"/>
326 <include name="**/*.jar"/>
332 <!-- jalopy code reformatter -->
333 <target name="sourcescrub" depends="init,build">
334 <jalopy destdir="jsrc" classpathref="run.classpath"
335 convention="jalview-jalopy.xml">
336 <fileset dir="${sourceDir}">
337 <include name="*.java"/>
338 <include name="**/*.java"/>
339 <include name="**/**/*.java"/>
346 <!-- Compile, package and obfuscate Jalview Applet -->
347 <target name="makeApplet" depends="obfuscate"/>
349 <target name="compileApplet" depends="init,clean">
350 <mkdir dir="${outputDir}"/>
353 srcdir="${sourceDir}"
354 destdir="${outputDir}"
355 classpath="lib/${jmolJar}"
356 includes="jalview/appletgui/**"
357 excludes="ext/**,MCview/**,org/**,vamsas/**"
361 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
362 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif"/>
363 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif"/>
364 <jar destfile="in.jar">
366 <attribute name="Main-Class" value="jalview.bin.JalviewLite"/>
368 <fileset dir="${outputDir}">
369 <include name="com/**"/>
370 <include name="MCview/**"/>
371 <include name="jalview/**"/>
372 <include name=".build_properties"/>
373 <include name="images/idwidth.gif"/>
374 <include name="images/link.gif"/>
379 <target name="obfuscate" depends="packageApplet">
380 <path id="obfuscateDeps.path">
381 <pathelement location="${applet.jre.tools}"/>
382 <pathelement location="lib/${jmolJar}"/>
384 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
386 <injar file="in.jar"/>
387 <outjar file="jalviewApplet.jar"/>
388 <libraryjar refid="obfuscateDeps.path"/>
389 <keep access="public" type="class"
390 name="jalview.bin.JalviewLite">
391 <field access="public"/>
392 <method access="public"/>
393 <constructor access="public"/>
395 <!-- -libraryjars "${obfuscateDeps}"
397 -outjars jalviewApplet.jar
398 -keep public class jalview.bin.JalviewLite
402 <delete file="in.jar"/>
405 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
406 <taskdef name="castor-srcgen"
407 classname="org.castor.anttask.CastorCodeGenTask"
408 classpathref="build.classpath" />
410 <fileset dir="${sourceDir}/jalview/schemabinding/version2">
411 <include name="*.java"/>
412 <include name="descriptors/*.java"/>
415 <castor-srcgen file="${schemaDir}/vamsas.xsd"
417 package="jalview.schemabinding.version2"
421 properties="${schemaDir}/jalview.properties"
423 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
425 package="jalview.schemabinding.version2"
429 properties="${schemaDir}/jalview.properties"
431 <castor-srcgen file="${schemaDir}/jalview.xsd"
433 package="jalview.schemabinding.version2"
437 properties="${schemaDir}/jalview.properties"
441 now build the jalview.binding package with the old schema set
444 <fileset dir="${sourceDir}/jalview/binding/">
448 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd"
450 package="jalview.binding"
454 properties="${schemaDir}/jalview.nodesc.properties"
456 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
458 package="jalview.binding"
462 properties="${schemaDir}/jalview.nodesc.properties"
464 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd"
466 package="jalview.binding"
470 properties="${schemaDir}/jalview.nodesc.properties"