dc93408a688636e94e85e0dc8355f055360c03e9
[jalview.git] / build.xml
1 <?xml version="1.0"?>
2 <!--
3  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
4  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
5  * 
6  * This file is part of Jalview.
7  * 
8  * Jalview is free software: you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License 
10  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11  * 
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
18 -->
19 <project name="jalviewX" default="usage" basedir=".">
20         <!-- we use jalopy to format our sources -->
21         <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
22                 <classpath>
23                         <fileset dir="utils/jalopy/lib">
24                                 <include name="*.jar" />
25                         </fileset>
26                 </classpath>
27         </taskdef>
28
29         <target name="help" depends="usage" />
30         <target name="usage">
31                 <echo message="~~~Jalview Ant build.xml Usage~~~~" />
32                 <echo message="Targets include:" />
33                 <echo message="usage - default target, displays this message" />
34                 <echo message="buildindices - generates JavaHelpSearch from the help files" />
35                 <echo message="build - compiles all necessary files for Application" />
36                 <echo message="makedist - compiles and places all necessary jar files into directory dist" />
37                 <echo message="makefulldist - signs all jar files and builds jnlp file for full distribution" />
38                 <echo message="              this needs a keystore and key. See docs/building.html for more information." />
39                 <echo message="compileApplet - compiles all necessary files for Applet" />
40                 <echo message="makeApplet - compiles, then packages and obfuscates the Applet" />
41                 <echo message="See docs/building.html and the comments in build file for other targets." />
42                 <echo message="note: compile and makeApplet require the property java118.home to be set to point to a java 1.1.8 jdk." />
43                 <echo message="Useful -D flags: -Ddonotobfuscate will prevent applet obfuscation" />
44         </target>
45
46
47         <!-- utils is a class path to additional utilities needed for
48     building docs, jars and webstart stuff -->
49         <!--
50         Userdefined build property defaults
51
52         wsdl.server list (plus namespace mapping info ???)  - also want
53                 ... to make this a dynamically generatable property
54         WebStart Location
55         Build location - provide a temporary root for speed
56         jarsigner keystore and info
57         Jakarta and axis classpath ?
58         Default argument for starting Jalview (if it exists).
59
60 -->
61
62         <target name="init">
63                 <path id="axis.classpath">
64                         <!-->
65                         <fileset dir="/usr/local/axis/lib">
66                                 <include name="**/*.jar" />
67                         </fileset>
68                         <fileset dir="/usr/local/jakarta-tomcat-5/webapps/axis/WEB-INF/lib">
69                                 <include name="**/*.jar"/>
70                                 <include name="*.jar"/>
71                         </fileset> -->
72       </path>
73                 <!-- Jalview Version String displayed by application on startup and used to check for updates -->
74                 <property name="JALVIEW_VERSION" value="DEVELOPMENT" />
75                 <!-- 2.4 (VAMSAS)" -->
76                 <!-- Include debugging information in javac true or false -->
77                 <property name="javac.debug" value="true" />
78
79                 <!-- JarSigner Key Store for Webstart Distribution -->
80                 <property name="jalview.keystore" value="./keys/.keystore" />
81                 <!-- Keystore Password -->
82                 <property name="jalview.keystore.pass" value="alignmentisfun" />
83                 <!-- Key Name -->
84                 <property name="jalview.key" value="jalview" />
85                 <!-- Key Password -->
86                 <property name="jalview.key.pass" value="alignmentisfun" />
87
88                     
89                     
90                 <!-- Don't change anything below here unless you know what you are doing! -->
91                 <!-- Url path for WebStart in JNLP file -->
92                 <property name="WebStartLocation" value="http://www.jalview.org/webstart" />
93                 <!-- Webstart Image - looked for in resources/images -->
94                 <property name="WebStartImage" value="JalviewLogo_big.png"/>
95                 <!-- J2SE version needed for webstart launch -->
96 <!-- Anne's version needs 1.7 - should rebuild VARNA to java 1.6 for release -->
97                 <property name="j2sev" value="1.7+"/>
98
99     <!-- Permissions for running Java applets and applications. Defaults are those suitable for deploying jalview webstart/jalviewLite at www.jalview.org -->
100     <property name="application.codebase" value="*.jalview.org"/>
101     <property name="applet.codebase" value="*.jalview.org"/>
102     <property name="applet.caller-codebase" value="${applet.codebase}"/>
103
104                 <!-- build directory configuration -->
105                 <property name="libDir" value="lib" />
106                 <property name="resourceDir" value="resources" />
107                 <property name="helpDir" value="help" />
108                 <property name="docDir" value="doc" />
109                 <property name="sourceDir" value="src" />
110                 <property name="schemaDir" value="schemas" />
111                 <property name="outputDir" value="classes" />
112                 <property name="packageDir" value="dist" />
113                 <property name="outputJar" value="jalview.jar" />
114                 <!-- Jalview Applet JMol Jar Dependency -->
115                 <property name="jmolJar" value="JmolApplet-12.2.4.jar" />
116                 <property name="varnaJar" value="VARNAv3-9.jar" />
117                 <property name="jalviewLiteJar" value="jalviewApplet.jar" />
118                 <!-- switch to indicate if we should obfuscate jalviewLite -->
119                 <!--<property name="donotobfuscate" value="true"/> -->
120
121                 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
122                 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
123                 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
124                 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
125                 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
126                 <property name="WSInterf" value="MsaWS" />
127                 <property name="wsdl.Namespace" value="vamsas" />
128                 <property name="wsdl.ClientNS" value="ext.vamsas" />
129                 <!-- the class path for building the application -->
130                 <path id="build.classpath">
131                         <fileset dir="utils">
132                                 <include name="*.jar" />
133                                 <include name="**/*.jar" />
134                         </fileset>
135                         <fileset dir="${libDir}">
136                                 <include name="*.jar" />
137                                 <include name="**/*.jar" />
138                         </fileset>
139                         <fileset dir="${java.home}/lib">
140                                 <include name="plugin.jar"/>
141                         </fileset>
142                         <fileset dir="appletlib">
143                                 <!-- the JmolApplet includes the JmolApplet console and the application javac seems to always try and build all packages 
144                                 -->
145                                 <include name="${jmolJar}" />
146                                 <include name="${varnaJar}" />
147                         </fileset>
148
149                 </path>
150                 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
151                 <!-- The Location of the java 1.1.8 jdk -->
152                 <!--<property name="java118.home" value="C:\Sun\jdk1.1.8" />
153                 -->
154                 <property name="java118.home" value="${java.home}" />
155                     <!--<property name="applet.jre.tools" value="${java118.home}/lib/classes.zip" />
156                 --><!-- jre for 1.4 version -->
157                 <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
158                 
159                 <!-- the classpath for building the 1.1 applet -->
160                 <path id="jalviewlite.deps">
161                         <fileset dir="${java118.home}">
162                                 <include name="lib/classes.zip" />
163                         </fileset>
164                         <fileset dir="${java.home}/lib">
165                                 <include name="plugin.jar"/>
166                         </fileset>
167                         <pathelement location="appletlib/${jmolJar}" />
168       <pathelement location="lib/${varnaJar}" />
169
170                 </path>
171     <!-- default location for outputting javadoc -->
172     <property name="javadocDir" value="${packageDir}/javadoc"/>
173         </target>
174
175
176         <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties" />
177         <target name="buildPropertiesFile" depends="init">
178                 <tstamp prefix="build">
179                         <format property="date" pattern="dd MMMM yyyy" />
180                 </tstamp>
181                 <properties file="${outputDir}/.build_properties">
182                         <header>
183           ---Jalview Build Details---
184         </header>
185                         <property name="VERSION" value="${JALVIEW_VERSION}" />
186                         <property name="BUILD_DATE" value="${build.date}" />
187                 </properties>
188         </target>
189
190
191         <target name="clean" depends="init">
192                 <!-- not efficient yet. -->
193                 <delete dir="${outputDir}" includes="*,**/*"/>
194         </target>
195
196         <target name="distclean" depends="init, clean">
197
198                 <echo message="REMOVING ALL BACKUP/AUTOSAVES!" />
199                 <delete>
200                         <fileset dir=".">
201                                 <include name="${outputJar}" />
202                                 <include name="#*#" />
203                                 <include name="#*.*#" />
204                                 <include name="**/#*#" />
205                                 <include name="**/#*.*#" />
206                                 <include name="*~" />
207                                 <include name="*.*~" />
208                                 <include name="**/*~" />
209                                 <include name="**/*.*~" />
210                         </fileset>
211                 </delete>
212         </target>
213
214         <target name="prepare" depends="init">
215                 <mkdir dir="${outputDir}" />
216                 <copy todir="${outputDir}">
217                         <fileset dir=".">
218                                 <include name="${docDir}/**/*.*" />
219                                 <include name="${helpDir}/**/*.*" />
220                                 <include name="${libDir}/*.jar" />
221                         </fileset>
222                         <fileset dir="${resourceDir}">
223                                 <include name="**/*.*" />
224                         </fileset>
225                 </copy>
226         </target>
227
228         <target name="build" depends="prepare">
229                 <!-- not efficient yet. -->
230                 <javac source="1.5" target="1.5" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="build.classpath">
231                         <exclude name="jalview/*applet*" />
232                         <exclude name="jalview/appletgui/**" />
233                         <exclude name="com/stevesoft/**" />
234                 </javac>
235         </target>
236         <target name="buildindices" depends="init, prepare" unless="help.uptodate">
237                 <java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
238                         <arg line="html" />
239                 </java>
240         </target>
241
242         <target name="makefulldist" depends="makedist">
243                 <!-- the default keystore details might need to be edited here -->
244                 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="SHA1withRSA">
245
246                         <fileset dir="${packageDir}">
247                                 <include name="*.jar" />
248                         </fileset>
249                 </signjar>
250                 <copy todir="${packageDir}">
251                         <fileset dir="${resourceDir}/images">
252                                 <include name="${WebStartImage}"/>
253                         </fileset>
254                                         </copy>
255                 
256                 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties" />
257
258                 <!--    codebase="http://www.jalview.org/jalview/webstart" -->
259                 <!-- href="jalview.jnlp" prevent hard-wired pickup of jnlp in certain javaws versions -->
260                 <jnlp toFile="${packageDir}/jalview.jnlp" codebase="${WebStartLocation}">
261                         <information>
262                                 <title>Jalview</title>
263                                 <vendor>The Barton Group</vendor>
264                                 <homepage href="http://www.jalview.org" />
265                                 <description>Jalview Multiple Alignment Editor</description>
266                                 <description kind="short">Jalview</description>
267                                 <icon href="${WebStartImage}" />
268                                 <offline_allowed/>
269                         </information>
270                         <resources>
271                                 <j2se version="${j2sev}" initial_heap_size="10M"  />
272                                 <fileset dir="${packageDir}">
273                                         <include name="jalview.jar" />
274                                 </fileset>
275                                 <fileset dir="${packageDir}">
276                                         <include name="*.jar" />
277                                         <include name="*_*.jar" />
278                                         <exclude name="jalview.jar" />
279                                 </fileset>
280                                 <property name="jalview.version" value="${JALVIEW_VERSION}" />
281                         </resources>
282                         <application_desc main_class="jalview.bin.Jalview">
283                         </application_desc>
284                         <security>
285                                 <all_permissions />
286                         </security>
287                 </jnlp>         
288                 <jnlp toFile="${packageDir}/jalview_1G.jnlp" codebase="${WebStartLocation}">
289                         <information>
290                                 <title>Jalview</title>
291                                 <vendor>The Barton Group</vendor>
292                                 <homepage href="http://www.jalview.org" />
293                                 <description>Jalview Multiple Alignment Editor</description>
294                                 <description kind="short">Jalview</description>
295                                 <icon href="${WebStartImage}" />
296                                 <offline_allowed />
297                         </information>
298                         <resources>
299                                 <j2se version="${j2sev}" initial_heap_size="128M" max_heap_size="512M" />
300                                 <fileset dir="${packageDir}">
301                                         <include name="jalview.jar" />
302                                 </fileset>
303                                 <fileset dir="${packageDir}">
304                                         <include name="*.jar" />
305                                         <include name="*_*.jar" />
306                                         <exclude name="jalview.jar" />
307                                 </fileset>
308                                 <property name="jalview.version" value="${JALVIEW_VERSION}" />
309                         </resources>
310                         <application_desc main_class="jalview.bin.Jalview">
311                         </application_desc>
312                         <security>
313                                 <all_permissions />
314                         </security>
315                 </jnlp>
316                 <jnlp toFile="${packageDir}/jalview_2G.jnlp" codebase="${WebStartLocation}">
317                         <information>
318                                 <title>Jalview</title>
319                                 <vendor>The Barton Group</vendor>
320                                 <homepage href="http://www.jalview.org" />
321                                 <description>Jalview Multiple Alignment Editor</description>
322                                 <description kind="short">Jalview</description>
323                                 <icon href="${WebStartImage}" />
324                                 <offline_allowed />
325                         </information>
326                         <resources>
327                                 <j2se version="${j2sev}" initial_heap_size="256M" max_heap_size="1024M" />
328                                 <fileset dir="${packageDir}">
329                                         <include name="jalview.jar" />
330                                 </fileset>
331                                 <fileset dir="${packageDir}">
332                                         <include name="*.jar" />
333                                         <include name="*_*.jar" />
334                                         <exclude name="jalview.jar" />
335                                 </fileset>
336                                 <property name="jalview.version" value="${JALVIEW_VERSION}" />
337                         </resources>
338                         <application_desc main_class="jalview.bin.Jalview">
339                         </application_desc>
340                         <security>
341                                 <all_permissions />
342                         </security>
343                 </jnlp>
344                         <!-- finally, need to postprocess to add in associations at end of 'information' element 
345                         
346                         <xslt in="${packageDir}/jalview_noa_1G.jnlp" out="${packageDir}/jalview_1G.jnlp">
347                 
348                 </xslt>
349                         
350                         
351                         -->
352                                         <!--
353                                 <association mime-type="application-x/ext-file" extensions="fa"/>
354         <association mime-type="application-x/ext-file" extensions="fasta"/>
355         <association mime-type="application-x/ext-file" extensions="fastq"/>
356         <association mime-type="application-x/ext-file" extensions="blc"/>
357         <association mime-type="application-x/ext-file" extensions="msf"/>
358         <association mime-type="application-x/ext-file" extensions="pfam"/>
359         <association mime-type="application-x/ext-file" extensions="aln"/>
360         <association mime-type="application-x/ext-file" extensions="pir"/>
361         <association mime-type="application-x/ext-file" extensions="amsa"/>
362         <association mime-type="application-x/ext-file" extensions="stk"/>
363         <association mime-type="application-x/ext-file" extensions="jar"/>-->
364         
365         </target>
366
367         <target name="runenv" depends="init">
368                 <path id="run.classpath">
369                         <pathelement location="${outputDir}" />
370                         <fileset dir="${outputDir}">
371                                 <include name="${libDir}/*.jar" />
372                         </fileset>
373                 </path>
374                 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath" />
375
376                 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
377       </echo>
378         </target>
379
380         <target name="buildextclients" depends="init">
381                 <input message="Building external client source from WSDLs - Do you really want to do this ? (Yy/Nn)" validargs="Y,y,n,N" defaultvalue="N" addproperty="doextbuild.response" />
382                 <condition property="dontextbuild">
383                         <equals arg1="n" arg2="${doextbuild.response}" />
384                 </condition>
385                 <condition property="dontextbuild">
386                         <equals arg1="N" arg2="${doextbuild.response}" />
387                 </condition>
388                 <fail if="dontextbuild">
389         Build External Client Code process aborted by user. Jalview source is unchanged.
390       </fail>
391                 <!-- Currently, this doesn't happen automatically.
392      1. Run WSDL2Java as below, which generates an ext.vamsas +
393      vamsas.<datapackages> fileset.
394      2. refactor ext.vamsas.SpecificserviceWS* to
395      ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
396      3. Update the jalview.ws.*WServices classes to reflect the
397      interface type, and all locations of this wsdl type that Jalview
398      might be using.
399
400 -->
401                 <path id="axisbuild">
402                         <path refid="build.classpath" />
403                 </path>
404                 <taskdef resource="axis-tasks.properties" classpathref="axisbuild" />
405                 <move todir="./bak">
406                         <fileset dir="${sourceDir}" id="client">
407                                 <include name="${wsdl.ClientNS}/*.*" />
408                         </fileset>
409                 </move>
410
411                 <axis-wsdl2java output="${sourceDir}" verbose="true" url="${wsdl.MsaWS2}" serverside="false" deployscope="Request" debug="false" helpergen="true" all="true">
412                         <mappingSet>
413                                 <mapping namespace="${wsdl.Namespace}" package="${wsdl.ClientNS}" />
414                                 <mapping namespace="http://dataTypes.vamsas" package="${wsdl.ClientNS}" />
415                         </mappingSet>
416                 </axis-wsdl2java>
417         </target>
418
419         <target name="makedist" depends="build, buildPropertiesFile, buildindices">
420                 <!-- make the package jar if not already existing -->
421                 <mkdir dir="${packageDir}" />
422                 <!-- clean dir if it already existed -->
423                 <delete>
424                         <fileset dir="${packageDir}">
425                                 <include name="*.jar"/>
426                         </fileset>
427                 </delete>
428                 <jar destfile="${packageDir}/${outputJar}" index="true">
429                         <manifest>
430                                 <attribute name="Main-Class" value="jalview.bin.Jalview" />
431         <attribute name="Permissions" value="all-permissions" />
432         <!--<attribute name="Trusted-Lib" value="true" /> -->
433         <attribute name="Application-Name" value="Jalview Desktop"/>
434         <attribute name="Codebase" value="${application.codebase}"/>
435                         </manifest>
436                         <fileset dir="${outputDir}/">
437                                 <exclude name="cache*/**" />
438                                 <exclude name="*.jar" />
439                                 <exclude name="*.jar.*" />
440                                 <exclude name="**/*.jar" />
441                                 <exclude name="**/*.jar.*" />
442                         </fileset>
443                 </jar>
444
445                 <copy toDir="${packageDir}" flatten="true">
446                         <fileset dir="${outputDir}">
447                                 <include name="*.jar" />
448                                 <include name="**/*.jar" />
449                         </fileset>
450                 </copy>
451         </target>
452
453
454         <!-- jalopy code reformatter -->
455         <target name="sourcescrub" depends="init,build">
456                 <jalopy destdir="jsrc" classpathref="run.classpath" convention="jalview-jalopy.xml">
457                         <fileset dir="${sourceDir}">
458                                 <include name="*.java" />
459                                 <include name="**/*.java" />
460                                 <include name="**/**/*.java" />
461                         </fileset>
462                 </jalopy>
463         </target>
464
465
466
467         <!-- Compile, package and obfuscate Jalview Applet -->
468         <target name="makeApplet" depends="obfuscate" description="assemble the final jalviewLite applet jar with or without obfuscation"/>
469
470         <target name="compileApplet" depends="init,clean">
471                 <mkdir dir="${outputDir}" />
472                 <javac source="1.5" target="1.5" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" 
473                         classpathref="jalviewlite.deps" includes="jalview/appletgui/**"
474                         excludes="ext/**,MCview/**,org/**,vamsas/**,jalview/ext/paradise/**" />
475         </target>
476
477         <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
478                 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif" />
479                 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
480                 <copy todir="${outputDir}/lang">
481                         <fileset dir="${resourceDir}/lang"><include name="**.*"/></fileset></copy>
482                 <jar destfile="in.jar" index="true">
483                         <manifest>
484                                 <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
485                                 <attribute name="Application-Name" value="JalviewLite Applet"/>
486                                 <!--            <attribute name="Permissions" value="sandbox" /> -->
487                                 <!--<attribute name="Trusted-Lib" value="true" /> -->
488                                 <attribute name="Codebase" value="${applet.codebase}"/>
489                                 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}"/>
490                         </manifest>
491                         <fileset dir="${outputDir}">
492                                 <include name="com/**" />
493                                 <include name="MCview/**" />
494                                 <include name="jalview/**" />
495                                 <include name=".build_properties" />
496                                 <include name="images/idwidth.gif" />
497                                 <include name="images/link.gif" />
498                                 <include name="lang/**" />
499                         </fileset>
500                 </jar>
501         </target>
502         <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally">
503         </target>
504         <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
505                 <copy file="in.jar" tofile="${jalviewLiteJar}" overwrite="true" />
506                 <delete file="in.jar" />
507         </target>
508         <target name="-obfuscatereally" unless="donotobfuscate">
509
510                 <path id="obfuscateDeps.path">
511                         <pathelement location="${applet.jre.tools}" />
512                         <pathelement location="appletlib/${jmolJar}" />
513                 </path>
514                 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
515
516                 <proguard>
517                         <injar file="in.jar" />
518                         <outjar file="${jalviewLiteJar}" />
519                         <libraryjar refid="obfuscateDeps.path" />
520                         <dontwarn/>
521                         <keep access="public" type="class" name="jalview.bin.JalviewLite">
522                                 <field access="public" />
523                                 <method access="public" />
524                                 <constructor access="public" />
525                         </keep>
526                         <keep access="public" type="class" name="jalview.appletgui.AlignFrame">
527                                 <field access="public" />
528                                 <method access="public" />
529                                 <constructor access="public" />
530                         </keep>
531                         <!--      -libraryjars "${obfuscateDeps}"
532       -injars      in.jar
533       -outjars     jalviewApplet.jar
534       -keep public class jalview.bin.JalviewLite
535        { public * ; } -->
536                 </proguard>
537                 <delete file="in.jar" />
538         </target>
539
540         <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
541                 <taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask" classpathref="build.classpath" />
542                 <delete>
543                         <fileset dir="${sourceDir}/jalview/schemabinding/version2">
544                                 <include name="*.java" />
545                                 <include name="descriptors/*.java" />
546                         </fileset>
547                 </delete>
548                 <castor-srcgen file="${schemaDir}/vamsas.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
549                 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
550                 <castor-srcgen file="${schemaDir}/JalviewWsParamSet.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
551                 <castor-srcgen file="${schemaDir}/jalview.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
552                 <!-- 
553                 now build the jalview.binding package with the old schema set
554                 -->
555                 <delete>
556                         <fileset dir="${sourceDir}/jalview/binding/">
557                                 <include name="**" />
558                         </fileset>
559                 </delete>
560                 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
561                 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
562                 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
563         </target>
564         <target name="sourcedist" description="create jalview source distribution" depends="init">
565                 <delete file="${source.dist.name}" />
566                 <tar destfile="${source.dist.name}" compression="gzip">
567                         <tarfileset dir="./" prefix="jalview" preserveLeadingSlashes="true">
568                                 <include name="LICENSE" />
569                                 <include name="README" />
570                                 <include name="build.xml" />
571                                 <include name="jalview-jalopy.xml" />
572                                 <include name="JalviewApplet.jpx" />
573                                 <include name="JalviewX.jpx" />
574                                 <include name="nbbuild.xml"/>
575                                 <include name="nbproject/genfiles.properties"/>
576         <include name="nbproject/project.properties"/>
577         <include name="nbproject/project.xml"/>
578                                 <include name="${sourceDir}/*.java" />
579                                 <include name="${sourceDir}/**/*.java" />
580                                 <include name="${sourceDir}/**/*.cdr" />
581                                 <include name="${libDir}/**/*" />
582                                 <include name="${resourceDir}/**/*" />
583                                 <include name="${helpDir}/**/*" />
584                                 <include name="appletlib/${jmolJar}" />
585                                 <exclude name="**/*locales" />
586                                 <exclude name="*locales/**" />
587                                 <exclude name="utils/InstallAnywhere/**Build.iap_xml" />
588                                 <exclude name="utils/InstallAnywhere/**Build*/**" />
589                                 <exclude name="utils/InstallAnywhere/**Build*/**" />
590                                 <exclude name="utils/InstallAnywhere/**locale*" />
591                                 <exclude name="utils/InstallAnywhere/**locale*/**" />
592                                 <include name="${schemaDir}/**/*" />
593                                 <include name="utils/**/*" />
594                                 <include name="${docDir}/**/*" />
595                                 <include name="examples/**/*" />
596                         </tarfileset>
597                 </tar>
598         </target>
599         <target name="pubapplet" description="installs the jalviewLite applet and dependent jars into an applet examples directory built under ${outputDir}" depends="makeApplet">
600           <copy todir="${packageDir}/examples">
601           <fileset dir="examples">
602                 <include name="**/*"/>
603                 <include name="javascript/*"/>
604       <include name="jmol/*"/>
605           </fileset>
606                 <fileset dir=".">
607                 <include name="jalviewApplet.jar"/>
608                         </fileset>
609                 <fileset dir="appletlib">
610                       <include name="**/*"/>
611                         </fileset>
612           </copy>
613             <jar update="true" index="true" jarfile="${packageDir}/examples/${jalviewLiteJar}"/>
614             <jar update="true" index="true" jarfile="${packageDir}/examples/${jmolJar}">
615                 <manifest>
616                 <attribute name="Application-Name" value="Jmol (bundled with JalviewLite)"/>
617                 <!--          <attribute name="Permissions" value="sandbox" /> -->
618                 <!--<attribute name="Trusted-Lib" value="true" /> -->
619                 <attribute name="Codebase" value="${applet.codebase}"/>
620                 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}"/>
621                   </manifest>
622                 </jar>
623     <signjar sigalg="SHA1WithRSA" storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
624       <fileset dir="${packageDir}/examples">
625         <include name="*.jar" />
626       </fileset>
627     </signjar>
628         </target>
629         <target name="sourcedoc" description="Create jalview source documentation pages" depends="init">
630          <javadoc destdir="${javadocDir}">
631                 <packageset dir="${sourceDir}" includes="jalview/*,MCView/*">
632                 </packageset>
633                 </javadoc>
634         </target>
635         
636 </project>