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="2.3"/>
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 <!-- the classpath for building the 1.1 applet -->
95 <path id="jalviewlite.deps">
96 <fileset dir="${java118.home}">
97 <include name="lib/classes.zip"/>
99 <pathelement location="lib/${jmolJar}"/>
104 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties"/>
105 <target name="buildPropertiesFile" depends="init">
106 <tstamp prefix="build">
107 <format property="date" pattern="dd MMMM yyyy"/>
109 <properties file="${outputDir}/.build_properties">
111 ---Jalview Build Details---
113 <property name="VERSION" value="${JALVIEW_VERSION}"/>
114 <property name="BUILD_DATE" value="${build.date}"/>
119 <target name="clean" depends="init">
120 <!-- not efficient yet. -->
121 <delete dir="${outputDir}"/>
124 <target name="distclean" depends="init, clean">
126 <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
129 <include name="${outputJar}"/>
130 <include name="#*#"/>
131 <include name="#*.*#"/>
132 <include name="**/#*#"/>
133 <include name="**/#*.*#"/>
135 <include name="*.*~"/>
136 <include name="**/*~"/>
137 <include name="**/*.*~"/>
142 <target name="prepare" depends="init">
143 <mkdir dir="${outputDir}"/>
144 <copy todir="${outputDir}">
146 <include name="${docDir}/**/*.*"/>
147 <include name="${helpDir}/**/*.*"/>
148 <include name="${libDir}/*.jar"/>
150 <fileset dir="${resourceDir}">
151 <include name="**/*.*"/>
156 <target name="build" depends="prepare">
157 <!-- not efficient yet. -->
158 <javac source="1.4" target="1.4"
159 srcdir ="${sourceDir}"
160 destdir="${outputDir}"
161 classpathref="build.classpath">
162 <exclude name="jalview/*applet*"/>
163 <exclude name="com/stevesoft/**"/>
166 <target name="buildindices" depends="init, prepare"
167 unless="help.uptodate">
169 classname="com.sun.java.help.search.Indexer"
170 classpathref="build.classpath"
172 dir="${outputDir}/${helpDir}"
178 <target name="makefulldist" depends="makedist">
179 <!-- the default keystore details might need to be edited here -->
181 storepass="alignmentisfun"
182 keypass="alignmentisfun"
183 keystore="keys/.keystore"
189 <fileset dir="${packageDir}">
190 <include name="*.jar"/>
193 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties"/>
195 <!-- codebase="http://www.jalview.org/jalview/webstart" -->
196 <jnlp toFile="${packageDir}/jalview.jnlp" href="jalview.jnlp"
197 codebase="${WebStartLocation}">
199 <title>Jalview</title>
200 <vendor>The Barton Group</vendor>
201 <homepage href="http://www.jalview.org"/>
202 <description>Jalview Multiple Alignment Editor</description>
203 <description kind="short">Jalview</description>
204 <icon href="logo_big.gif"/>
207 <association mime-type="application-x/ext-file" extensions="fa"/>
208 <association mime-type="application-x/ext-file" extensions="fasta"/>
209 <association mime-type="application-x/ext-file" extensions="fastq"/>
210 <association mime-type="application-x/ext-file" extensions="blc"/>
211 <association mime-type="application-x/ext-file" extensions="msf"/>
212 <association mime-type="application-x/ext-file" extensions="pfam"/>
213 <association mime-type="application-x/ext-file" extensions="aln"/>
214 <association mime-type="application-x/ext-file" extensions="pir"/>
218 <j2se version="1.4+"/>
219 <fileset dir="${packageDir}">
220 <include name="jalview.jar"/>
222 <fileset dir="${packageDir}">
223 <include name="*.jar"/>
224 <exclude name="jalview.jar"/>
226 <property name="jalview.version" value="${JALVIEW_VERSION}"/>
228 <application_desc main_class="jalview.bin.Jalview">
235 <target name="runenv" depends="init">
236 <path id="run.classpath">
237 <pathelement location="${outputDir}"/>
238 <fileset dir="${outputDir}">
239 <include name="${libDir}/*.jar"/>
242 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath"/>
244 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
248 <target name="buildextclients" depends="init">
249 <input message="Building external client source from WSDLs - Do you really want to do this ? (Yy/Nn)"
250 validargs="Y,y,n,N" defaultvalue="N"
251 addproperty="doextbuild.response"/>
252 <condition property="dontextbuild">
253 <equals arg1="n" arg2="${doextbuild.response}"/>
255 <condition property="dontextbuild">
256 <equals arg1="N" arg2="${doextbuild.response}"/>
258 <fail if="dontextbuild">
259 Build External Client Code process aborted by user. Jalview source is unchanged.
261 <!-- Currently, this doesn't happen automatically.
262 1. Run WSDL2Java as below, which generates an ext.vamsas +
263 vamsas.<datapackages> fileset.
264 2. refactor ext.vamsas.SpecificserviceWS* to
265 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
266 3. Update the jalview.ws.*WServices classes to reflect the
267 interface type, and all locations of this wsdl type that Jalview
271 <path id="axisbuild">
272 <path refid="build.classpath"/>
274 <taskdef resource="axis-tasks.properties" classpathref="axisbuild"/>
276 <fileset dir="${sourceDir}" id="client">
277 <include name="${wsdl.ClientNS}/*.*"/>
282 output="${sourceDir}"
286 deployscope="Request"
293 namespace="${wsdl.Namespace}"
294 package="${wsdl.ClientNS}"
296 <mapping namespace="http://dataTypes.vamsas"
297 package="${wsdl.ClientNS}"/>
302 <target name="makedist" depends="build, buildPropertiesFile, buildindices">
303 <!-- make the package jar -->
304 <mkdir dir="${packageDir}"/>
306 <jar destfile="${packageDir}/${outputJar}">
308 <attribute name="Main-Class" value="jalview.bin.Jalview"/>
310 <fileset dir="${outputDir}/">
311 <exclude name="cache*/**"/>
312 <exclude name="*.jar" />
313 <exclude name="*.jar.*" />
314 <exclude name="**/*.jar" />
315 <exclude name="**/*.jar.*" />
319 <copy toDir="${packageDir}" flatten="true">
320 <fileset dir="${outputDir}">
321 <include name="*.jar"/>
322 <include name="**/*.jar"/>
328 <!-- jalopy code reformatter -->
329 <target name="sourcescrub" depends="init,build">
330 <jalopy destdir="jsrc" classpathref="run.classpath"
331 convention="jalview-jalopy.xml">
332 <fileset dir="${sourceDir}">
333 <include name="*.java"/>
334 <include name="**/*.java"/>
335 <include name="**/**/*.java"/>
342 <!-- Compile, package and obfuscate Jalview Applet -->
343 <target name="makeApplet" depends="obfuscate"/>
345 <target name="compileApplet" depends="init,clean">
346 <mkdir dir="${outputDir}"/>
349 srcdir="${sourceDir}"
350 destdir="${outputDir}"
351 classpath="lib/${jmolJar}"
352 includes="jalview/appletgui/**"
353 excludes="ext/**,MCview/**,org/**,vamsas/**"
357 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
358 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif"/>
359 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif"/>
360 <jar destfile="in.jar">
362 <attribute name="Main-Class" value="jalview.bin.JalviewLite"/>
364 <fileset dir="${outputDir}">
365 <include name="com/**"/>
366 <include name="MCview/**"/>
367 <include name="jalview/**"/>
368 <include name=".build_properties"/>
369 <include name="images/idwidth.gif"/>
370 <include name="images/link.gif"/>
375 <target name="obfuscate" depends="packageApplet">
376 <path id="obfuscateDeps.path">
377 <pathelement location="${java.home}/lib/rt.jar"/>
378 <pathelement location="lib/${jmolJar}"/>
380 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
382 <injar file="in.jar"/>
383 <outjar file="jalviewApplet.jar"/>
384 <libraryjar refid="obfuscateDeps.path"/>
385 <keep access="public" type="class"
386 name="jalview.bin.JalviewLite">
387 <field access="public"/>
388 <method access="public"/>
389 <constructor access="public"/>
391 <!-- -libraryjars "${obfuscateDeps}"
393 -outjars jalviewApplet.jar
394 -keep public class jalview.bin.JalviewLite
398 <delete file="in.jar"/>
401 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
402 <taskdef name="castor-srcgen"
403 classname="org.exolab.castor.tools.ant.taskdefs.CastorSourceGenTask"
404 classpathref="build.classpath" />
406 <fileset dir="${sourceDir}/jalview/schemabinding/version2/">
410 <castor-srcgen file="${schemaDir}/vamsas.xsd"
412 package="jalview.schemabinding.version2"
415 properties="${schemaDir}/jalview.properties"
417 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd"
419 package="jalview.schemabinding.version2"
422 properties="${schemaDir}/jalview.properties"
424 <castor-srcgen file="${schemaDir}/jalview.xsd"
426 package="jalview.schemabinding.version2"
429 properties="${schemaDir}/jalview.properties"