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."/>
29 <!-- utils is a class path to additional utilities needed for
30 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">
47 <!--> <fileset dir="/usr/local/axis/lib">
48 <include name="**/*.jar" />
50 <fileset dir="/usr/local/jakarta-tomcat-5/webapps/axis/WEB-INF/lib">
51 <include name="**/*.jar"/>
52 <include name="*.jar"/>
55 <!-- Jalview Version String displayed by application on startup and used to check for updates -->
56 <property name="JALVIEW_VERSION" value="ANNOTATION_TEST"/>
57 <!-- Don't change anything below here unless you know what you are doing! -->
58 <!-- Url path for WebStart in JNLP file -->
59 <property name="WebStartLocation" value="http://www.jalview.org/webstart"/>
60 <!-- build directory configuration -->
61 <property name="libDir" value="lib"/>
62 <property name="resourceDir" value="resources"/>
63 <property name="helpDir" value="help"/>
64 <property name="docDir" value="doc"/>
65 <property name="sourceDir" value="src" />
66 <property name="outputDir" value="classes" />
67 <property name="packageDir" value="dist" />
68 <property name="outputJar" value="jalview.jar" />
69 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
70 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
71 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
72 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
73 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
74 <property name="WSInterf" value="MsaWS" />
75 <property name="wsdl.Namespace" value="vamsas" />
76 <property name="wsdl.ClientNS" value="ext.vamsas" />
77 <!-- the class path for building the application -->
78 <path id="build.classpath">
80 <include name="*.jar"/>
81 <include name="**/*.jar"/>
83 <fileset dir="${libDir}">
84 <include name="*.jar"/>
85 <include name="**/*.jar"/>
91 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties"/>
92 <target name="buildPropertiesFile" depends="init">
93 <tstamp prefix="build">
94 <format property="date" pattern="dd MMMM yyyy"/>
96 <properties file="${outputDir}/.build_properties">
98 ---Jalview Build Details---
100 <property name="VERSION" value="${JALVIEW_VERSION}"/>
101 <property name="BUILD_DATE" value="${build.date}"/>
106 <target name="clean" depends="init">
107 <!-- not efficient yet. -->
108 <delete dir="${outputDir}"/>
111 <target name="distclean" depends="init, clean">
113 <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
116 <include name="${outputJar}"/>
117 <include name="#*#"/>
118 <include name="#*.*#"/>
119 <include name="**/#*#"/>
120 <include name="**/#*.*#"/>
122 <include name="*.*~"/>
123 <include name="**/*~"/>
124 <include name="**/*.*~"/>
129 <target name="prepare" depends="init">
130 <mkdir dir="${outputDir}"/>
131 <copy todir="${outputDir}">
133 <include name="${docDir}/**/*.*"/>
134 <include name="${helpDir}/**/*.*"/>
135 <include name="${libDir}/*.jar"/>
137 <fileset dir="${resourceDir}">
138 <include name="**/*.*"/>
143 <target name="build" depends="prepare">
144 <!-- not efficient yet. -->
145 <javac source="1.4" target="1.4"
146 srcdir ="${sourceDir}"
147 destdir="${outputDir}"
148 classpathref="build.classpath">
149 <exclude name="jalview/*applet*"/>
150 <exclude name="com/stevesoft/**"/>
153 <target name="buildindices" depends="init, prepare"
154 unless="help.uptodate">
156 classname="com.sun.java.help.search.Indexer"
157 classpathref="build.classpath"
159 dir="${outputDir}/${helpDir}"
165 <target name="makefulldist" depends="makedist">
166 <!-- the default keystore details might need to be edited here -->
168 storepass="alignmentisfun"
169 keypass="alignmentisfun"
170 keystore="keys/.keystore"
176 <fileset dir="${packageDir}">
177 <include name="*.jar"/>
180 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties"/>
182 <!-- codebase="http://www.jalview.org/jalview/webstart" -->
183 <jnlp toFile="${packageDir}/jalview.jnlp" href="jalview.jnlp"
184 codebase="${WebStartLocation}">
186 <title>Jalview</title>
187 <vendor>The Barton Group</vendor>
188 <homepage href="http://www.jalview.org"/>
189 <description>Jalview Multiple Alignment Editor</description>
190 <description kind="short">Jalview</description>
191 <icon href="logo_big.gif"/>
194 <association mime-type="application-x/ext-file" extensions="fa"/>
195 <association mime-type="application-x/ext-file" extensions="fasta"/>
196 <association mime-type="application-x/ext-file" extensions="fastq"/>
197 <association mime-type="application-x/ext-file" extensions="blc"/>
198 <association mime-type="application-x/ext-file" extensions="msf"/>
199 <association mime-type="application-x/ext-file" extensions="pfam"/>
200 <association mime-type="application-x/ext-file" extensions="aln"/>
201 <association mime-type="application-x/ext-file" extensions="pir"/>
205 <j2se version="1.4+"/>
206 <fileset dir="${packageDir}">
207 <include name="jalview.jar"/>
209 <fileset dir="${packageDir}">
210 <include name="*.jar"/>
211 <exclude name="jalview.jar"/>
213 <property name="jalview.version" value="${JALVIEW_VERSION}"/>
215 <application_desc main_class="jalview.bin.Jalview">
222 <target name="runenv" depends="init">
223 <path id="run.classpath">
224 <pathelement location="${outputDir}"/>
225 <fileset dir="${outputDir}">
226 <include name="${libDir}/*.jar"/>
229 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath"/>
231 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
235 <target name="buildextclients" depends="init">
236 <input message="Building external client source from WSDLs - Do you really want to do this ? (Yy/Nn)"
237 validargs="Y,y,n,N" defaultvalue="N"
238 addproperty="doextbuild.response"/>
239 <condition property="dontextbuild">
240 <equals arg1="n" arg2="${doextbuild.response}"/>
242 <condition property="dontextbuild">
243 <equals arg1="N" arg2="${doextbuild.response}"/>
245 <fail if="dontextbuild">
246 Build External Client Code process aborted by user. Jalview source is unchanged.
248 <!-- Currently, this doesn't happen automatically.
249 1. Run WSDL2Java as below, which generates an ext.vamsas +
250 vamsas.<datapackages> fileset.
251 2. refactor ext.vamsas.SpecificserviceWS* to
252 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
253 3. Update the jalview.ws.*WServices classes to reflect the
254 interface type, and all locations of this wsdl type that Jalview
258 <path id="axisbuild">
259 <path refid="build.classpath"/>
261 <taskdef resource="axis-tasks.properties" classpathref="axisbuild"/>
263 <fileset dir="${sourceDir}" id="client">
264 <include name="${wsdl.ClientNS}/*.*"/>
269 output="${sourceDir}"
273 deployscope="Request"
280 namespace="${wsdl.Namespace}"
281 package="${wsdl.ClientNS}"
283 <mapping namespace="http://dataTypes.vamsas"
284 package="${wsdl.ClientNS}"/>
289 <target name="makedist" depends="build, buildPropertiesFile, buildindices">
290 <!-- make the package jar -->
291 <mkdir dir="${packageDir}"/>
293 <jar destfile="${packageDir}/${outputJar}">
295 <attribute name="Main-Class" value="jalview.bin.Jalview"/>
297 <fileset dir="${outputDir}/">
298 <exclude name="cache*/**"/>
299 <exclude name="*.jar" />
300 <exclude name="*.jar.*" />
301 <exclude name="**/*.jar" />
302 <exclude name="**/*.jar.*" />
306 <copy toDir="${packageDir}" flatten="true">
307 <fileset dir="${outputDir}">
308 <include name="*.jar"/>
309 <include name="**/*.jar"/>
315 <!-- jalopy code reformatter -->
316 <target name="sourcescrub" depends="init,build">
317 <jalopy destdir="jsrc" classpathref="run.classpath"
318 convention="jalview-jalopy.xml">
319 <fileset dir="${sourceDir}">
320 <include name="*.java"/>
321 <include name="**/*.java"/>
322 <include name="**/**/*.java"/>
329 <!-- Compile, package and obfuscate Jalview Applet -->
330 <target name="makeApplet" depends="obfuscate"/>
332 <target name="compileApplet" depends="init,clean">
333 <mkdir dir="${outputDir}"/>
334 <javac source="1.2" target="1.1" srcdir="${sourceDir}" destdir="${outputDir}"
335 includes="jalview/analysis/**,jalview/appletgui/**,jalview/datamodel/**jalview/jbappletgui/**,jalview/math/**,jalview/schemes/**"
336 excludes="ext/**,MCview/**,org/**,vamsas/**"/>
339 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
340 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif"/>
341 <jar destfile="in.jar">
343 <attribute name="Main-Class" value="jalview.bin.JalviewLite"/>
345 <fileset dir="${outputDir}">
346 <include name="com/**"/>
347 <include name="MCview/**"/>
348 <include name="jalview/**"/>
349 <include name=".build_properties"/>
350 <include name="images/idwidth.gif"/>
355 <target name="obfuscate" depends="packageApplet">
356 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
358 -libraryjars "${java.home}/lib/rt.jar"
360 -outjars jalviewApplet.jar
361 -keep public class jalview.bin.JalviewLite
364 <delete file="in.jar"/>