Merge branch 'Release_2_8_Branch' into WIP_fix_JAL-1423
[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                 <property name="j2sev" value="1.6+"/>
97
98     <!-- Permissions for running Java applets and applications. Defaults are those suitable for deploying jalview webstart/jalviewLite at www.jalview.org -->
99     <property name="application.codebase" value="*.jalview.org"/>
100     <property name="applet.codebase" value="*"/>
101     <property name="applet.caller-codebase" value="${applet.codebase}"/>
102
103                 <!-- build directory configuration -->
104                 <property name="libDir" value="lib" />
105                 <property name="resourceDir" value="resources" />
106                 <property name="helpDir" value="help" />
107                 <property name="docDir" value="doc" />
108                 <property name="sourceDir" value="src" />
109                 <property name="schemaDir" value="schemas" />
110                 <property name="outputDir" value="classes" />
111                 <property name="packageDir" value="dist" />
112                 <property name="outputJar" value="jalview.jar" />
113                 <!-- Jalview Applet JMol Jar Dependency -->
114                 <property name="jmolJar" value="JmolApplet-12.2.4.jar" />
115                 <property name="jalviewLiteJar" value="jalviewApplet.jar" />
116                 <!-- switch to indicate if we should obfuscate jalviewLite -->
117                 <!--<property name="donotobfuscate" value="true"/> -->
118
119                 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
120                 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
121                 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
122                 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
123                 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
124                 <property name="WSInterf" value="MsaWS" />
125                 <property name="wsdl.Namespace" value="vamsas" />
126                 <property name="wsdl.ClientNS" value="ext.vamsas" />
127                 <!-- the class path for building the application -->
128                 <path id="build.classpath">
129                         <fileset dir="utils">
130                                 <include name="*.jar" />
131                                 <include name="**/*.jar" />
132                         </fileset>
133                         <fileset dir="${libDir}">
134                                 <include name="*.jar" />
135                                 <include name="**/*.jar" />
136                         </fileset>
137                         <fileset dir="${java.home}/lib">
138                                 <include name="plugin.jar"/>
139                         </fileset>
140                         <fileset dir="appletlib">
141                                 <!-- the JmolApplet includes the JmolApplet console and the application javac seems to always try and build all packages 
142                                 -->
143                                 <include name="${jmolJar}" />
144                         </fileset>
145
146                 </path>
147                 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
148                 <!-- The Location of the java 1.1.8 jdk -->
149                 <!--<property name="java118.home" value="C:\Sun\jdk1.1.8" />
150                 -->
151                 <property name="java118.home" value="${java.home}" />
152                     <!--<property name="applet.jre.tools" value="${java118.home}/lib/classes.zip" />
153                 --><!-- jre for 1.4 version -->
154                 <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
155                 
156                 <!-- the classpath for building the 1.1 applet -->
157                 <path id="jalviewlite.deps">
158                         <fileset dir="${java118.home}">
159                                 <include name="lib/classes.zip" />
160                         </fileset>
161                         <fileset dir="${java.home}/lib">
162                                 <include name="plugin.jar"/>
163                         </fileset>
164                         <pathelement location="appletlib/${jmolJar}" />
165                 </path>
166     <!-- default location for outputting javadoc -->
167     <property name="javadocDir" value="${packageDir}/javadoc"/>
168         </target>
169
170
171         <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties" />
172         <target name="buildPropertiesFile" depends="init">
173                 <tstamp prefix="build">
174                         <format property="date" pattern="dd MMMM yyyy" />
175                 </tstamp>
176                 <properties file="${outputDir}/.build_properties">
177                         <header>
178           ---Jalview Build Details---
179         </header>
180                         <property name="VERSION" value="${JALVIEW_VERSION}" />
181                         <property name="BUILD_DATE" value="${build.date}" />
182                 </properties>
183         </target>
184
185
186         <target name="clean" depends="init">
187                 <!-- not efficient yet. -->
188                 <delete dir="${outputDir}" includes="*,**/*"/>
189         </target>
190
191         <target name="distclean" depends="init, clean">
192
193                 <echo message="REMOVING ALL BACKUP/AUTOSAVES!" />
194                 <delete>
195                         <fileset dir=".">
196                                 <include name="${outputJar}" />
197                                 <include name="#*#" />
198                                 <include name="#*.*#" />
199                                 <include name="**/#*#" />
200                                 <include name="**/#*.*#" />
201                                 <include name="*~" />
202                                 <include name="*.*~" />
203                                 <include name="**/*~" />
204                                 <include name="**/*.*~" />
205                         </fileset>
206                 </delete>
207         </target>
208
209         <target name="prepare" depends="init">
210                 <mkdir dir="${outputDir}" />
211                 <copy todir="${outputDir}">
212                         <fileset dir=".">
213                                 <include name="${docDir}/**/*.*" />
214                                 <include name="${helpDir}/**/*.*" />
215                                 <include name="${libDir}/*.jar" />
216                         </fileset>
217                         <fileset dir="${resourceDir}">
218                                 <include name="**/*.*" />
219                         </fileset>
220                 </copy>
221         </target>
222
223         <target name="build" depends="prepare">
224                 <!-- not efficient yet. -->
225                 <javac source="1.5" target="1.5" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="build.classpath">
226                         <exclude name="jalview/*applet*" />
227                         <exclude name="jalview/appletgui/**" />
228                         <exclude name="com/stevesoft/**" />
229                 </javac>
230         </target>
231         <target name="buildindices" depends="init, prepare" unless="help.uptodate">
232                 <java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
233                         <arg line="html" />
234                 </java>
235         </target>
236
237         <target name="makefulldist" depends="makedist">
238                 <!-- the default keystore details might need to be edited here -->
239                 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="SHA1withRSA">
240
241                         <fileset dir="${packageDir}">
242                                 <include name="*.jar" />
243                         </fileset>
244                 </signjar>
245                 <copy todir="${packageDir}">
246                         <fileset dir="${resourceDir}/images">
247                                 <include name="${WebStartImage}"/>
248                         </fileset>
249                                         </copy>
250                 
251                 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties" />
252
253                 <!--    codebase="http://www.jalview.org/jalview/webstart" -->
254                 <!-- href="jalview.jnlp" prevent hard-wired pickup of jnlp in certain javaws versions -->
255                 <jnlp toFile="${packageDir}/jalview.jnlp" codebase="${WebStartLocation}">
256                         <information>
257                                 <title>Jalview</title>
258                                 <vendor>The Barton Group</vendor>
259                                 <homepage href="http://www.jalview.org" />
260                                 <description>Jalview Multiple Alignment Editor</description>
261                                 <description kind="short">Jalview</description>
262                                 <icon href="${WebStartImage}" />
263                                 <offline_allowed/>
264                         </information>
265                         <resources>
266                                 <j2se version="${j2sev}" initial_heap_size="10M"  />
267                                 <fileset dir="${packageDir}">
268                                         <include name="jalview.jar" />
269                                 </fileset>
270                                 <fileset dir="${packageDir}">
271                                         <include name="*.jar" />
272                                         <include name="*_*.jar" />
273                                         <exclude name="jalview.jar" />
274                                 </fileset>
275                                 <property name="jalview.version" value="${JALVIEW_VERSION}" />
276                         </resources>
277                         <application_desc main_class="jalview.bin.Jalview">
278                         </application_desc>
279                         <security>
280                                 <all_permissions />
281                         </security>
282                 </jnlp>         
283                 <jnlp toFile="${packageDir}/jalview_1G.jnlp" codebase="${WebStartLocation}">
284                         <information>
285                                 <title>Jalview</title>
286                                 <vendor>The Barton Group</vendor>
287                                 <homepage href="http://www.jalview.org" />
288                                 <description>Jalview Multiple Alignment Editor</description>
289                                 <description kind="short">Jalview</description>
290                                 <icon href="${WebStartImage}" />
291                                 <offline_allowed />
292                         </information>
293                         <resources>
294                                 <j2se version="${j2sev}" initial_heap_size="128M" max_heap_size="512M" />
295                                 <fileset dir="${packageDir}">
296                                         <include name="jalview.jar" />
297                                 </fileset>
298                                 <fileset dir="${packageDir}">
299                                         <include name="*.jar" />
300                                         <include name="*_*.jar" />
301                                         <exclude name="jalview.jar" />
302                                 </fileset>
303                                 <property name="jalview.version" value="${JALVIEW_VERSION}" />
304                         </resources>
305                         <application_desc main_class="jalview.bin.Jalview">
306                         </application_desc>
307                         <security>
308                                 <all_permissions />
309                         </security>
310                 </jnlp>
311                 <jnlp toFile="${packageDir}/jalview_2G.jnlp" codebase="${WebStartLocation}">
312                         <information>
313                                 <title>Jalview</title>
314                                 <vendor>The Barton Group</vendor>
315                                 <homepage href="http://www.jalview.org" />
316                                 <description>Jalview Multiple Alignment Editor</description>
317                                 <description kind="short">Jalview</description>
318                                 <icon href="${WebStartImage}" />
319                                 <offline_allowed />
320                         </information>
321                         <resources>
322                                 <j2se version="${j2sev}" initial_heap_size="256M" max_heap_size="1024M" />
323                                 <fileset dir="${packageDir}">
324                                         <include name="jalview.jar" />
325                                 </fileset>
326                                 <fileset dir="${packageDir}">
327                                         <include name="*.jar" />
328                                         <include name="*_*.jar" />
329                                         <exclude name="jalview.jar" />
330                                 </fileset>
331                                 <property name="jalview.version" value="${JALVIEW_VERSION}" />
332                         </resources>
333                         <application_desc main_class="jalview.bin.Jalview">
334                         </application_desc>
335                         <security>
336                                 <all_permissions />
337                         </security>
338                 </jnlp>
339                         <!-- finally, need to postprocess to add in associations at end of 'information' element 
340                         
341                         <xslt in="${packageDir}/jalview_noa_1G.jnlp" out="${packageDir}/jalview_1G.jnlp">
342                 
343                 </xslt>
344                         
345                         
346                         -->
347                                         <!--
348                                 <association mime-type="application-x/ext-file" extensions="fa"/>
349         <association mime-type="application-x/ext-file" extensions="fasta"/>
350         <association mime-type="application-x/ext-file" extensions="fastq"/>
351         <association mime-type="application-x/ext-file" extensions="blc"/>
352         <association mime-type="application-x/ext-file" extensions="msf"/>
353         <association mime-type="application-x/ext-file" extensions="pfam"/>
354         <association mime-type="application-x/ext-file" extensions="aln"/>
355         <association mime-type="application-x/ext-file" extensions="pir"/>
356         <association mime-type="application-x/ext-file" extensions="amsa"/>
357         <association mime-type="application-x/ext-file" extensions="stk"/>
358         <association mime-type="application-x/ext-file" extensions="jar"/>-->
359         
360         </target>
361
362         <target name="runenv" depends="init">
363                 <path id="run.classpath">
364                         <pathelement location="${outputDir}" />
365                         <fileset dir="${outputDir}">
366                                 <include name="${libDir}/*.jar" />
367                         </fileset>
368                 </path>
369                 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath" />
370
371                 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
372       </echo>
373         </target>
374
375         <target name="buildextclients" depends="init">
376                 <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" />
377                 <condition property="dontextbuild">
378                         <equals arg1="n" arg2="${doextbuild.response}" />
379                 </condition>
380                 <condition property="dontextbuild">
381                         <equals arg1="N" arg2="${doextbuild.response}" />
382                 </condition>
383                 <fail if="dontextbuild">
384         Build External Client Code process aborted by user. Jalview source is unchanged.
385       </fail>
386                 <!-- Currently, this doesn't happen automatically.
387      1. Run WSDL2Java as below, which generates an ext.vamsas +
388      vamsas.<datapackages> fileset.
389      2. refactor ext.vamsas.SpecificserviceWS* to
390      ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
391      3. Update the jalview.ws.*WServices classes to reflect the
392      interface type, and all locations of this wsdl type that Jalview
393      might be using.
394
395 -->
396                 <path id="axisbuild">
397                         <path refid="build.classpath" />
398                 </path>
399                 <taskdef resource="axis-tasks.properties" classpathref="axisbuild" />
400                 <move todir="./bak">
401                         <fileset dir="${sourceDir}" id="client">
402                                 <include name="${wsdl.ClientNS}/*.*" />
403                         </fileset>
404                 </move>
405
406                 <axis-wsdl2java output="${sourceDir}" verbose="true" url="${wsdl.MsaWS2}" serverside="false" deployscope="Request" debug="false" helpergen="true" all="true">
407                         <mappingSet>
408                                 <mapping namespace="${wsdl.Namespace}" package="${wsdl.ClientNS}" />
409                                 <mapping namespace="http://dataTypes.vamsas" package="${wsdl.ClientNS}" />
410                         </mappingSet>
411                 </axis-wsdl2java>
412         </target>
413
414         <target name="makedist" depends="build, buildPropertiesFile, buildindices">
415                 <!-- make the package jar if not already existing -->
416                 <mkdir dir="${packageDir}" />
417                 <!-- clean dir if it already existed -->
418                 <delete>
419                         <fileset dir="${packageDir}">
420                                 <include name="*.jar"/>
421                         </fileset>
422                 </delete>
423                 <jar destfile="${packageDir}/${outputJar}" index="true">
424                         <manifest>
425                                 <attribute name="Main-Class" value="jalview.bin.Jalview" />
426         <attribute name="Permissions" value="all-permissions" />
427         <attribute name="Application-Name" value="Jalview Desktop"/>
428         <attribute name="Codebase" value="${application.codebase}"/>
429                         </manifest>
430                         <fileset dir="${outputDir}/">
431                                 <exclude name="cache*/**" />
432                                 <exclude name="*.jar" />
433                                 <exclude name="*.jar.*" />
434                                 <exclude name="**/*.jar" />
435                                 <exclude name="**/*.jar.*" />
436                         </fileset>
437                 </jar>
438
439                 <copy toDir="${packageDir}" flatten="true">
440                         <fileset dir="${outputDir}">
441                                 <include name="*.jar" />
442                                 <include name="**/*.jar" />
443                         </fileset>
444                 </copy>
445         </target>
446
447
448         <!-- jalopy code reformatter -->
449         <target name="sourcescrub" depends="init,build">
450                 <jalopy destdir="jsrc" classpathref="run.classpath" convention="jalview-jalopy.xml">
451                         <fileset dir="${sourceDir}">
452                                 <include name="*.java" />
453                                 <include name="**/*.java" />
454                                 <include name="**/**/*.java" />
455                         </fileset>
456                 </jalopy>
457         </target>
458
459
460
461         <!-- Compile, package and obfuscate Jalview Applet -->
462         <target name="makeApplet" depends="obfuscate" description="assemble the final jalviewLite applet jar with or without obfuscation"/>
463
464         <target name="compileApplet" depends="init,clean">
465                 <mkdir dir="${outputDir}" />
466                 <javac source="1.5" target="1.5" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" 
467                         classpathref="jalviewlite.deps" includes="jalview/appletgui/**"
468                         excludes="ext/**,MCview/**,org/**,vamsas/**" />
469         </target>
470
471         <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
472                 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif" />
473                 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
474                 <jar destfile="in.jar" index="true">
475                         <manifest>
476                                 <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
477                                 <attribute name="Application-Name" value="JalviewLite"/>
478                                 <attribute name="Permissions" value="all-permissions" />
479                                 <attribute name="Codebase" value="${applet.codebase}"/>
480                         </manifest>
481                         <fileset dir="${outputDir}">
482                                 <include name="com/**" />
483                                 <include name="MCview/**" />
484                                 <include name="jalview/**" />
485                                 <include name=".build_properties" />
486                                 <include name="images/idwidth.gif" />
487                                 <include name="images/link.gif" />
488                         </fileset>
489                 </jar>
490         </target>
491         <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally">
492         </target>
493         <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
494                 <copy file="in.jar" tofile="${jalviewLiteJar}" overwrite="true" />
495                 <delete file="in.jar" />
496         </target>
497         <target name="-obfuscatereally" unless="donotobfuscate">
498
499                 <path id="obfuscateDeps.path">
500                         <pathelement location="${applet.jre.tools}" />
501                         <pathelement location="appletlib/${jmolJar}" />
502                 </path>
503                 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
504
505                 <proguard>
506                         <injar file="in.jar" />
507                         <outjar file="${jalviewLiteJar}" />
508                         <libraryjar refid="obfuscateDeps.path" />
509                         <dontwarn/>
510                         <keep access="public" type="class" name="jalview.bin.JalviewLite">
511                                 <field access="public" />
512                                 <method access="public" />
513                                 <constructor access="public" />
514                         </keep>
515                         <keep access="public" type="class" name="jalview.appletgui.AlignFrame">
516                                 <field access="public" />
517                                 <method access="public" />
518                                 <constructor access="public" />
519                         </keep>
520                         <!--      -libraryjars "${obfuscateDeps}"
521       -injars      in.jar
522       -outjars     jalviewApplet.jar
523       -keep public class jalview.bin.JalviewLite
524        { public * ; } -->
525                 </proguard>
526                 <delete file="in.jar" />
527         </target>
528
529         <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
530                 <taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask" classpathref="build.classpath" />
531                 <delete>
532                         <fileset dir="${sourceDir}/jalview/schemabinding/version2">
533                                 <include name="*.java" />
534                                 <include name="descriptors/*.java" />
535                         </fileset>
536                 </delete>
537                 <castor-srcgen file="${schemaDir}/vamsas.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
538                 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
539                 <castor-srcgen file="${schemaDir}/JalviewWsParamSet.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
540                 <castor-srcgen file="${schemaDir}/jalview.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
541                 <!-- 
542                 now build the jalview.binding package with the old schema set
543                 -->
544                 <delete>
545                         <fileset dir="${sourceDir}/jalview/binding/">
546                                 <include name="**" />
547                         </fileset>
548                 </delete>
549                 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
550                 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
551                 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
552         </target>
553         <target name="sourcedist" description="create jalview source distribution" depends="init">
554                 <delete file="${source.dist.name}" />
555                 <tar destfile="${source.dist.name}" compression="gzip">
556                         <tarfileset dir="./" prefix="jalview" preserveLeadingSlashes="true">
557                                 <include name="LICENSE" />
558                                 <include name="README" />
559                                 <include name="build.xml" />
560                                 <include name="jalview-jalopy.xml" />
561                                 <include name="JalviewApplet.jpx" />
562                                 <include name="JalviewX.jpx" />
563                                 <include name="nbbuild.xml"/>
564                                 <include name="nbproject/genfiles.properties"/>
565         <include name="nbproject/project.properties"/>
566         <include name="nbproject/project.xml"/>
567                                 <include name="${sourceDir}/*.java" />
568                                 <include name="${sourceDir}/**/*.java" />
569                                 <include name="${sourceDir}/**/*.cdr" />
570                                 <include name="${libDir}/**/*" />
571                                 <include name="${resourceDir}/**/*" />
572                                 <include name="${helpDir}/**/*" />
573                                 <include name="appletlib/${jmolJar}" />
574                                 <exclude name="**/*locales" />
575                                 <exclude name="*locales/**" />
576                                 <exclude name="utils/InstallAnywhere/**Build.iap_xml" />
577                                 <exclude name="utils/InstallAnywhere/**Build*/**" />
578                                 <exclude name="utils/InstallAnywhere/**Build*/**" />
579                                 <exclude name="utils/InstallAnywhere/**locale*" />
580                                 <exclude name="utils/InstallAnywhere/**locale*/**" />
581                                 <include name="${schemaDir}/**/*" />
582                                 <include name="utils/**/*" />
583                                 <include name="${docDir}/**/*" />
584                                 <include name="examples/**/*" />
585                         </tarfileset>
586                 </tar>
587         </target>
588         <target name="pubapplet" description="installs the jalviewLite applet and dependent jars into an applet examples directory built under ${outputDir}" depends="makeApplet">
589           <copy todir="${packageDir}/examples">
590           <fileset dir="examples">
591                 <include name="**/*"/>
592                 <include name="javascript/*"/>
593       <include name="jmol/*"/>
594           </fileset>
595                 <fileset dir=".">
596                 <include name="${jalviewLiteJar}"/>
597                         </fileset>
598                 <fileset dir="appletlib">
599                       <include name="**/*"/>
600                         </fileset>
601           </copy>
602           <presetdef name="applet.jar">
603             <jar update="true" index="true">
604                 <manifest>
605                 <attribute name="Application-Name" value="JalviewLite"/>
606                 <attribute name="Permissions" value="all-permissions"/>
607                 <attribute name="Codebase" value="${applet.codebase}"/>
608                 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}"/>
609                 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}"/>
610                 <!--
611                 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}"/>
612                 -->
613 <!--            <attribute name="Trusted-Only" value="true"/>
614 -->
615 <!--            <attribute name="Trusted-Library" value="true"/>
616 -->
617                 </manifest>
618           </jar>
619           </presetdef>
620           <presetdef name="applet_tl.jar">
621             <jar update="true" index="true" jarfile="@{jarfile}">
622                 <manifest>
623                 <attribute name="Application-Name" value="JalviewLite"/>
624                 <attribute name="Permissions" value="all-permissions" />
625                 <attribute name="Codebase" value="${applet.codebase}"/>
626                 <attribute name="Trusted-Only" value="true"/>
627                 <attribute name="Trusted-Library" value="true"/>
628                 </manifest>
629           </jar>
630
631           </presetdef>
632           <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/tl_${jalviewLiteJar}"/>
633           <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/tl_${jmolJar}"/>
634           <applet.jar jarfile="${packageDir}/examples/${jalviewLiteJar}"/>
635           <applet_tl.jar jarfile="${packageDir}/examples/tl_${jalviewLiteJar}"/>
636           <applet.jar jarfile="${packageDir}/examples/${jmolJar}"/>
637           <applet_tl.jar jarfile="${packageDir}/examples/tl_${jmolJar}"/>
638     <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
639
640       <fileset dir="${packageDir}/examples">
641         <include name="*.jar" />
642       </fileset>
643     </signjar>
644         </target>
645         <target name="sourcedoc" description="Create jalview source documentation pages" depends="init">
646          <javadoc destdir="${javadocDir}">
647                 <packageset dir="${sourceDir}" includes="jalview/*,MCView/*">
648                 </packageset>
649                 </javadoc>
650         </target>
651         
652 </project>