3 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
4 * Copyright (C) $$Year-Rel$$ The Jalview Authors
6 * This file is part of Jalview.
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.
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.
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 * The Jalview Authors are detailed in the 'AUTHORS' file.
20 <project name="jalviewX" default="usage" basedir=".">
21 <target name="help" depends="usage" />
22 <target name="usage" depends="init">
23 <echo message="~~~Jalview Ant build.xml Usage~~~~" />
24 <echo message="Targets include:" />
25 <echo message="usage - default target, displays this message" />
26 <echo message="buildindices - generates JavaHelpSearch from the help files" />
27 <echo message="build - compiles all necessary files for Application" />
28 <echo message="makedist - compiles and places all necessary jar files into directory dist" />
29 <echo message="makefulldist - signs all jar files and builds jnlp file for full distribution" />
30 <echo message=" this needs a keystore and key. Add -Dtimestamp to timestamp signed jars"/>
31 <echo message=" See docs/building.html for more information." />
32 <echo message="compileApplet - compiles all necessary files for Applet" />
33 <echo message="makeApplet - compiles, then packages and obfuscates the Applet" />
34 <echo message="testng - run jalview's tests via testNG. Default group is '${testng-groups}'" />
35 <echo message=" you can specify particular test groups as a list via -Dtestng-groups=" />
36 <echo message="See docs/building.html and the comments in build file for other targets." />
37 <echo message="note: compile and makeApplet require the property java118.home to be set to point to a java 1.1.8 jdk." />
38 <echo message="Useful -D flags: -Ddonotobfuscate will prevent applet obfuscation" />
42 <!-- utils is a class path to additional utilities needed for
43 building docs, jars and webstart stuff -->
45 Userdefined build property defaults
47 wsdl.server list (plus namespace mapping info ???) - also want
48 ... to make this a dynamically generatable property
50 Build location - provide a temporary root for speed
51 jarsigner keystore and info
52 Jakarta and axis classpath ?
53 Default argument for starting Jalview (if it exists).
58 <path id="axis.classpath">
60 <fileset dir="/usr/local/axis/lib">
61 <include name="**/*.jar" />
63 <fileset dir="/usr/local/jakarta-tomcat-5/webapps/axis/WEB-INF/lib">
64 <include name="**/*.jar"/>
65 <include name="*.jar"/>
69 <!-- Jalview Version String displayed by application on startup and used to check for updates -->
70 <property name="JALVIEW_VERSION" value="DEVELOPMENT" />
72 <property name="INSTALLATION" value="Source" />
74 <!-- 2.4 (VAMSAS)" -->
75 <!-- Include debugging information in javac true or false -->
76 <property name="javac.debug" value="true" />
78 <!-- JarSigner Key Store for Webstart Distribution -->
79 <property name="jalview.keystore" value="./keys/.keystore" />
80 <!-- Keystore Password -->
81 <property name="jalview.keystore.pass" value="alignmentisfun" />
83 <property name="jalview.key" value="jalview" />
85 <property name="jalview.key.pass" value="alignmentisfun" />
86 <!-- time stamp server URL -->
87 <property name="jalview.tsaurl" value="" />
88 <!-- locally valid proxy for signing with external time server -->
89 <property name="proxyPort" value="80"/>
90 <property name="proxyHost" value="sqid"/>
92 <!-- default TestNG groups to run -->
93 <property name="testng-groups" value="Functional" />
95 <!-- Don't change anything below here unless you know what you are doing! -->
96 <!-- Url path for WebStart in JNLP file -->
97 <property name="WebStartLocation" value="http://www.jalview.org/webstart" />
98 <!-- Webstart Image - looked for in resources/images -->
99 <property name="WebStartImage" value="JalviewLogo_big.png" />
100 <!-- J2SE version needed for webstart launch -->
101 <!-- Anne's version needs 1.7 - should rebuild VARNA to java 1.6 for release -->
102 <property name="j2sev" value="1.7+" />
103 <!-- Java Compilation settings - source and target javac version -->
104 <property name="javac.source" value="1.7" />
105 <property name="javac.target" value="1.7" />
107 <!-- Permissions for running Java applets and applications. -->
108 <!-- Defaults are those suitable for deploying jalview webstart www.jalview.org -->
109 <property name="application.codebase" value="*.jalview.org" />
110 <!-- and allowing the applet to be deployed from any URL -->
111 <!-- note - if you want to make sure LiveConnect works without any warnings, please rebuild and sign your applet jar with your own domain included in the codebase/allowable-codebase properties -->
112 <property name="applet.codebase" value="*.jalview.org *.dundee.ac.uk *" />
113 <property name="applet.caller-codebase" value="${applet.codebase}" />
115 <!-- build directory configuration -->
116 <property name="libDir" value="lib" />
117 <property name="resourceDir" value="resources" />
118 <property name="helpDir" value="help" />
119 <property name="docDir" value="doc" />
120 <property name="sourceDir" value="src" />
121 <property name="schemaDir" value="schemas" />
122 <property name="outputDir" value="classes" />
123 <property name="packageDir" value="dist" />
124 <property name="outputJar" value="jalview.jar" />
125 <!-- Jalview Applet JMol Jar Dependency -->
126 <property name="jmolJar" value="JmolApplet-14.2.14_2015.06.11.jar" />
127 <property name="varnaJar" value="VARNAv3-93.jar" />
128 <property name="jsoup" value="jsoup-1.8.1.jar" />
129 <property name="jsonSimple" value="json_simple-1.1.jar" />
130 <property name="javaJson" value="java-json.jar" />
131 <property name="jalviewLiteJar" value="jalviewApplet.jar" />
132 <property name="reportDir" value="test-reports" />
133 <property name="testDir" value="test" />
134 <property name="testOutputDir" value="tests" />
135 <!-- switch to indicate if we should obfuscate jalviewLite -->
136 <!-- <property name="donotobfuscate" value="true"/> -->
137 <!-- switch to exclude associations from generated jnlp files -->
138 <!-- <property name="nojnlpfileassocs" value="true"/> -->
140 <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
141 <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
142 <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
143 <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
144 <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
145 <property name="WSInterf" value="MsaWS" />
146 <property name="wsdl.Namespace" value="vamsas" />
147 <property name="wsdl.ClientNS" value="ext.vamsas" />
148 <!-- the class path for building the application -->
149 <path id="build.classpath">
150 <fileset dir="utils">
151 <include name="*.jar" />
152 <include name="**/*.jar" />
154 <fileset dir="${libDir}">
155 <include name="*.jar" />
156 <include name="**/*.jar" />
158 <fileset dir="${java.home}/lib">
159 <include name="plugin.jar" />
161 <fileset dir="appletlib">
162 <!-- the JmolApplet includes the JmolApplet console and the application javac seems to always try and build all packages
164 <include name="${jmolJar}" />
165 <include name="${varnaJar}" />
168 <path id="test.classpath">
169 <pathelement path="${outputDir}" />
170 <path refid="build.classpath" />
172 <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
173 <!-- The Location of the java 1.1.8 jdk -->
174 <!--<property name="java118.home" value="C:\Sun\jdk1.1.8" /> -->
175 <property name="java118.home" value="${java.home}" />
176 <!-- <property name="applet.jre.tools" value="${java118.home}/lib/classes.zip" />
178 <!-- jre for 1.4 version -->
179 <property name="applet.jre.tools" value="${java.home}/lib/rt.jar" />
181 <!-- the classpath for building the 1.1 applet -->
182 <path id="jalviewlite.deps">
183 <fileset dir="${java118.home}">
184 <include name="lib/classes.zip" />
186 <fileset dir="${java.home}/lib">
187 <include name="plugin.jar" />
189 <pathelement location="appletlib/${jmolJar}" />
190 <pathelement location="lib/${varnaJar}" />
191 <pathelement location="lib/${jsoup}" />
192 <pathelement location="lib/${jsonSimple}" />
193 <pathelement location="lib/${javaJson}" />
196 <!-- default location for outputting javadoc -->
197 <property name="javadocDir" value="${packageDir}/javadoc" />
201 <taskdef classpath="utils/roxes-ant-tasks-1.2-2004-01-30.jar" resource="com/roxes/tools/ant/taskdefs.properties" />
202 <target name="buildPropertiesFile" depends="init">
203 <tstamp prefix="build">
204 <format property="date" pattern="dd MMMM yyyy" />
206 <exec executable="/usr/bin/git" outputproperty="git.commit" failifexecutionfails="false">
207 <arg value="rev-parse" />
208 <arg value="--short" />
211 <exec executable="/usr/bin/git" outputproperty="git.branch" failifexecutionfails="false">
212 <arg value="rev-parse" />
213 <arg value="--abbrev-ref" />
216 <properties file="${outputDir}/.build_properties">
218 ---Jalview Build Details---
220 <property name="VERSION" value="${JALVIEW_VERSION}" />
221 <property name="INSTALLATION" value="${INSTALLATION} git-commit:${git.commit} [${git.branch}]" />
222 <property name="BUILD_DATE" value="${build.date}" />
227 <target name="clean" depends="init">
228 <!-- not efficient yet. -->
229 <delete dir="${outputDir}" includes="*,**/*" />
232 <target name="distclean" depends="init, clean">
234 <echo message="REMOVING ALL BACKUP/AUTOSAVES!" />
237 <include name="${outputJar}" />
238 <include name="#*#" />
239 <include name="#*.*#" />
240 <include name="**/#*#" />
241 <include name="**/#*.*#" />
242 <include name="*~" />
243 <include name="*.*~" />
244 <include name="**/*~" />
245 <include name="**/*.*~" />
250 <target name="prepare" depends="init">
251 <mkdir dir="${outputDir}" />
252 <copy todir="${outputDir}">
254 <include name="${docDir}/**/*.*" />
255 <include name="${helpDir}/**/*.*" />
256 <include name="${libDir}/*.jar" />
258 <fileset dir="${resourceDir}">
259 <include name="**/*.*" />
264 <target name="build" depends="prepare">
265 <!-- not efficient yet. -->
266 <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="build.classpath">
267 <exclude name="jalview/*applet*" />
268 <exclude name="jalview/appletgui/**" />
269 <exclude name="com/stevesoft/**" />
274 <target name="testclean" depends="init">
275 <delete dir="${testOutputDir}" includes="*,**/*" />
278 <target name="prepareTests" depends="init,testclean">
279 <mkdir dir="${testOutputDir}" />
282 <target name="buildTests" depends="build,buildindices,prepareTests">
283 <javac source="${javac.source}" target="${javac.target}" srcdir="${testDir}" destdir="${testOutputDir}" debug="${javac.debug}" classpathref="test.classpath" includeantruntime="false">
287 <taskdef resource="testngtasks" classpath="utils/testnglibs/testng.jar" />
289 <target name="testng" depends="buildTests">
290 <testng outputDir="${reportDir}" haltOnFailure="false" groups="${testng-groups}" mode="testng"
293 <pathelement location="${testOutputDir}" />
294 <path refid="test.classpath" />
296 <classfileset dir="${testOutputDir}" includes="**/*.class" />
300 <target name="buildindices" depends="init, prepare" unless="help.uptodate">
301 <java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
306 <target name="preparejnlp" depends="makedist">
307 <copy todir="${packageDir}">
308 <fileset dir="${resourceDir}/images">
309 <include name="${WebStartImage}" />
313 <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties" />
315 <!-- create a dummy jar which will eventually contain the jnlp template -->
316 <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
317 <fileset dir="${packageDir}">
318 <include name="jalview.jar" />
322 <mkdir dir="${packageDir}/JNLP-INF" />
323 <antcall target="writejnlpf">
324 <param name="jnlpFile" value="${packageDir}/JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
325 <param name="inih" value="*" />
326 <param name="maxh" value="*" />
329 <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
330 <fileset dir="${packageDir}">
331 <include name="JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
335 <antcall target="writejnlpf">
336 <param name="jnlpFile" value="${packageDir}/jalview.jnlp" />
337 <param name="inih" value="10M" />
338 <param name="maxh" value="256M" />
341 <antcall target="writejnlpf">
342 <param name="jnlpFile" value="${packageDir}/jalview_1G.jnlp" />
343 <param name="inih" value="128M" />
344 <param name="maxh" value="512M" />
347 <antcall target="writejnlpf">
348 <param name="jnlpFile" value="${packageDir}/jalview_2G.jnlp" />
349 <param name="inih" value="256M" />
350 <param name="maxh" value="1024M" />
353 <!-- finally, need to postprocess to add in associations at end of 'information' element
355 <xslt in="${packageDir}/jalview_noa_1G.jnlp" out="${packageDir}/jalview_1G.jnlp">
362 <association mime-type="application-x/ext-file" extensions="fa"/>
363 <association mime-type="application-x/ext-file" extensions="fasta"/>
364 <association mime-type="application-x/ext-file" extensions="mfa"/>
365 <association mime-type="application-x/ext-file" extensions="fastq"/>
366 <association mime-type="application-x/ext-file" extensions="blc"/>
367 <association mime-type="application-x/ext-file" extensions="msf"/>
368 <association mime-type="application-x/ext-file" extensions="pfam"/>
369 <association mime-type="application-x/ext-file" extensions="aln"/>
370 <association mime-type="application-x/ext-file" extensions="pir"/>
371 <association mime-type="application-x/ext-file" extensions="amsa"/>
372 <association mime-type="application-x/ext-file" extensions="stk"/>
373 <association mime-type="application-x/ext-file" extensions="jar"/>-->
376 <target name="-jarsignwithtsa" depends="makedist,preparejnlp" if="timestamp">
377 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="SHA1withRSA"
378 tsaproxyhost="${proxyHost}" tsaproxyport="${proxyPort}" tsaurl="${jalview.tsaurl}">
379 <fileset dir="${packageDir}">
380 <include name="*.jar" />
384 <target name="-jarsignnotsa" depends="makedist,preparejnlp" unless="timestamp">
385 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="SHA1withRSA">
386 <fileset dir="${packageDir}">
387 <include name="*.jar" />
392 <target name="makefulldist" depends="makedist,preparejnlp,-jarsignwithtsa,-jarsignnotsa">
393 <!-- and sign the jars -->
394 <!-- the default keystore details might need to be edited here -->
397 <target name="runenv" depends="init">
398 <path id="run.classpath">
399 <pathelement location="${outputDir}" />
400 <fileset dir="${outputDir}">
401 <include name="${libDir}/*.jar" />
404 <pathconvert targetos="unix" refid="run.classpath" property="run.classpath" />
406 <echo>java -classpath ${run.classpath} jalview.bin.Jalview
410 <target name="-generatejnlpf">
411 <presetdef name="jnlpf">
412 <jnlp codebase="${WebStartLocation}">
414 <title>Jalview</title>
415 <vendor>The Barton Group</vendor>
416 <homepage href="http://www.jalview.org" />
417 <description>Jalview Multiple Alignment Editor</description>
418 <description kind="short">Jalview</description>
419 <icon href="${WebStartImage}" />
423 <j2se version="${j2sev}" initial_heap_size="${inih}" max_heap_size="${maxh}" />
424 <fileset dir="${packageDir}">
425 <include name="jalview.jar" />
427 <fileset dir="${packageDir}">
428 <include name="*.jar" />
429 <include name="*_*.jar" />
430 <exclude name="jalview.jar" />
431 <exclude name="*jnilib.jar" />
433 <property name="jalview.version" value="${JALVIEW_VERSION}" />
435 <resources os="Mac OS X">
436 <fileset dir="${packageDir}">
437 <include name="*quaqua*.jnilib.jar" />
441 <application_desc main_class="jalview.bin.Jalview">
449 <jnlpf toFile="${jnlpFile}" />
453 <target name="-dofakejnlpfileassoc" depends="-generatejnlpf" if="nojnlpfileassocs">
454 <echo message="Not adding JNLP File Associations" />
457 <target name="-dojnlpfileassoc" depends="-generatejnlpf" unless="nojnlpfileassocs">
458 <replace file="${jnlpFile}">
460 <![CDATA[</information>]]></replacetoken>
463 <association mime-type="application-x/ext-file" extensions="fa" />
464 <association mime-type="application-x/ext-file" extensions="fasta" />
465 <association mime-type="application-x/ext-file" extensions="mfa" />
466 <association mime-type="application-x/ext-file" extensions="fastq" />
467 <association mime-type="application-x/ext-file" extensions="blc" />
468 <association mime-type="application-x/ext-file" extensions="msf" />
469 <association mime-type="application-x/ext-file" extensions="pfam" />
470 <association mime-type="application-x/ext-file" extensions="aln"/>
471 <association mime-type="application-x/ext-file" extensions="pir"/>
472 <association mime-type="application-x/ext-file" extensions="amsa"/>
473 <association mime-type="application-x/ext-file" extensions="stk"/>
474 <association mime-type="application-x/ext-file" extensions="jvp"/>
475 </information>]]></replacevalue>
477 <echo message="Added file associations to JNLP file" />
479 <target name="writejnlpf" depends="-dojnlpfileassoc,-dofakejnlpfileassoc">
482 <target name="buildextclients" depends="init">
483 <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" />
484 <condition property="dontextbuild">
485 <equals arg1="n" arg2="${doextbuild.response}" />
487 <condition property="dontextbuild">
488 <equals arg1="N" arg2="${doextbuild.response}" />
490 <fail if="dontextbuild">
491 Build External Client Code process aborted by user. Jalview source is unchanged.
493 <!-- Currently, this doesn't happen automatically.
494 1. Run WSDL2Java as below, which generates an ext.vamsas +
495 vamsas.<datapackages> fileset.
496 2. refactor ext.vamsas.SpecificserviceWS* to
497 ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
498 3. Update the jalview.ws.*WServices classes to reflect the
499 interface type, and all locations of this wsdl type that Jalview
503 <path id="axisbuild">
504 <path refid="build.classpath" />
506 <taskdef resource="axis-tasks.properties" classpathref="axisbuild" />
508 <fileset dir="${sourceDir}" id="client">
509 <include name="${wsdl.ClientNS}/*.*" />
513 <axis-wsdl2java output="${sourceDir}" verbose="true" url="${wsdl.MsaWS2}" serverside="false" deployscope="Request" debug="false" helpergen="true" all="true">
515 <mapping namespace="${wsdl.Namespace}" package="${wsdl.ClientNS}" />
516 <mapping namespace="http://dataTypes.vamsas" package="${wsdl.ClientNS}" />
521 <target name="makedist" depends="build, buildPropertiesFile, buildindices">
522 <!-- make the package jar if not already existing -->
523 <mkdir dir="${packageDir}" />
524 <!-- clean dir if it already existed -->
526 <fileset dir="${packageDir}">
527 <include name="*.jar" />
530 <jar destfile="${packageDir}/${outputJar}" index="true">
532 <attribute name="Main-Class" value="jalview.bin.Jalview" />
533 <attribute name="Permissions" value="all-permissions" />
534 <attribute name="Application-Name" value="Jalview Desktop" />
535 <attribute name="Codebase" value="${application.codebase}" />
537 <fileset dir="${outputDir}/">
538 <exclude name="cache*/**" />
539 <exclude name="*.jar" />
540 <exclude name="*.jar.*" />
541 <exclude name="**/*.jar" />
542 <exclude name="**/*.jar.*" />
546 <copy toDir="${packageDir}" flatten="true">
547 <fileset dir="${outputDir}">
548 <include name="*.jar" />
549 <include name="**/*.jar" />
555 <!-- jalopy code reformatter -->
556 <target name="sourcescrub" depends="init,build">
557 <jalopy destdir="jsrc" classpathref="run.classpath" convention="jalview-jalopy.xml">
558 <fileset dir="${sourceDir}">
559 <include name="*.java" />
560 <include name="**/*.java" />
561 <include name="**/**/*.java" />
568 <!-- Compile, package and obfuscate Jalview Applet -->
569 <target name="makeApplet" depends="obfuscate" description="assemble the final jalviewLite applet jar with or without obfuscation" />
571 <target name="compileApplet" depends="init,clean">
572 <mkdir dir="${outputDir}" />
573 <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="jalviewlite.deps" includes="jalview/appletgui/**" excludes="ext/**,gui/**,jbgui/**,MCview/**,org/**,vamsas/**,jalview/ext/rbvi/**,jalview/ext/paradise/**" />
576 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
577 <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif" />
578 <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
579 <copy todir="${outputDir}/lang">
580 <fileset dir="${resourceDir}/lang">
581 <include name="**.*" />
584 <jar destfile="in.jar" index="true">
586 <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
587 <attribute name="Application-Name" value="JalviewLite" />
588 <attribute name="Codebase" value="${applet.codebase}" />
590 <fileset dir="${outputDir}">
591 <include name="com/**" />
592 <include name="MCview/**" />
593 <include name="jalview/**" />
594 <include name=".build_properties" />
595 <include name="images/idwidth.gif" />
596 <include name="images/link.gif" />
597 <include name="lang/**" />
601 <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally">
603 <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
604 <copy file="in.jar" tofile="${jalviewLiteJar}" overwrite="true" />
605 <delete file="in.jar" />
607 <target name="-obfuscatereally" unless="donotobfuscate">
609 <path id="obfuscateDeps.path">
610 <pathelement location="${applet.jre.tools}" />
611 <pathelement location="appletlib/${jmolJar}" />
612 <pathelement location="appletlib/${jsonSimple}" />
613 <pathelement location="appletlib/${javaJson}" />
615 <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
618 <injar file="in.jar" />
619 <outjar file="${jalviewLiteJar}" />
620 <libraryjar refid="obfuscateDeps.path" />
622 <keep access="public" type="class" name="jalview.bin.JalviewLite">
623 <field access="public" />
624 <method access="public" />
625 <constructor access="public" />
627 <keep access="public" type="class" name="jalview.appletgui.AlignFrame">
628 <field access="public" />
629 <method access="public" />
630 <constructor access="public" />
632 <!-- -libraryjars "${obfuscateDeps}"
634 -outjars jalviewApplet.jar
635 -keep public class jalview.bin.JalviewLite
638 <delete file="in.jar" />
641 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
642 <taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask" classpathref="build.classpath" />
644 <fileset dir="${sourceDir}/jalview/schemabinding/version2">
645 <include name="*.java" />
646 <include name="descriptors/*.java" />
649 <castor-srcgen file="${schemaDir}/vamsas.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
650 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
651 <castor-srcgen file="${schemaDir}/JalviewWsParamSet.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
652 <castor-srcgen file="${schemaDir}/jalview.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
654 now build the jalview.binding package with the old schema set
657 <fileset dir="${sourceDir}/jalview/binding/">
658 <include name="**" />
661 <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
662 <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
663 <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
665 <target name="sourcedist" description="create jalview source distribution" depends="init">
666 <delete file="${source.dist.name}" />
667 <tar destfile="${source.dist.name}" compression="gzip">
668 <tarfileset dir="./" prefix="jalview" preserveLeadingSlashes="true">
669 <include name="LICENSE" />
670 <include name="README" />
671 <include name="build.xml" />
672 <include name="jalview-jalopy.xml" />
673 <include name="JalviewApplet.jpx" />
674 <include name="JalviewX.jpx" />
675 <include name="nbbuild.xml" />
676 <include name="nbproject/genfiles.properties" />
677 <include name="nbproject/project.properties" />
678 <include name="nbproject/project.xml" />
679 <include name="${sourceDir}/*.java" />
680 <include name="${sourceDir}/**/*.java" />
681 <include name="${sourceDir}/**/*.cdr" />
682 <include name="${libDir}/**/*" />
683 <include name="${resourceDir}/**/*" />
684 <include name="${helpDir}/**/*" />
685 <include name="appletlib/${jmolJar}" />
686 <exclude name="**/*locales" />
687 <exclude name="*locales/**" />
688 <exclude name="utils/InstallAnywhere/**Build.iap_xml" />
689 <exclude name="utils/InstallAnywhere/**Build*/**" />
690 <exclude name="utils/InstallAnywhere/**Build*/**" />
691 <exclude name="utils/InstallAnywhere/**locale*" />
692 <exclude name="utils/InstallAnywhere/**locale*/**" />
693 <include name="${schemaDir}/**/*" />
694 <include name="utils/**/*" />
695 <include name="${docDir}/**/*" />
696 <include name="examples/**/*" />
700 <target name="prepubapplet_1" depends="makeApplet">
701 <copy todir="${packageDir}/examples">
702 <fileset dir="examples">
703 <include name="**/*" />
704 <include name="javascript/*" />
705 <include name="jmol/*" />
708 <include name="${jalviewLiteJar}" />
710 <fileset dir="appletlib">
711 <include name="**/*" />
714 <jar update="true" index="true" jarfile="${packageDir}/examples/${jalviewLiteJar}" />
715 <jar update="true" index="true" jarfile="${packageDir}/examples/${javaJson}" />
716 <jar update="true" index="true" jarfile="${packageDir}/examples/${jsonSimple}" />
717 <jar update="true" index="true" jarfile="${packageDir}/examples/${jmolJar}">
719 <attribute name="Application-Name" value="Jmol (bundled with JalviewLite)" />
720 <!-- <attribute name="Permissions" value="sandbox" /> -->
721 <!--<attribute name="Trusted-Lib" value="true" /> -->
722 <attribute name="Codebase" value="${applet.codebase}" />
723 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
727 <presetdef name="ap_applet.jar">
728 <!-- build a signed applet with 'all-permissions' -
729 Needs 'param name="permissions' value="all-permissions"' in applet tag
730 JalviewLite+JmolApplet linked sequence/structure fails
731 Mixed code warnings are raised
733 <jar update="true" index="true">
735 <attribute name="Application-Name" value="JalviewLite" />
736 <attribute name="Permissions" value="all-permissions" />
737 <attribute name="Codebase" value="${applet.codebase}" />
738 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
739 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
743 <presetdef name="applet.jar">
744 <!-- build signed applet with sandbox permissions -
745 Needs 'param name="permissions' value="sandbox"' in applet tag
746 Preserves Pre-Java 1.7_u45 behavior once 'permissions' parameter added to applet tag
749 <jar update="true" index="true">
751 <attribute name="Application-Name" value="JalviewLite" />
752 <attribute name="Permissions" value="sandbox" />
753 <attribute name="Codebase" value="${applet.codebase}" />
754 <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
755 <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
759 <presetdef name="tl_applet.jar">
760 <!-- build signed applet with trusted library/trusted permissions -
761 Needs 'param name="permissions' value="all-permissions"' in applet tag
763 No mixed code warnings raised
764 Jmol/JalviewLite sequence/structure example doesn't link structures
765 Raises dialog asking user to allow page to control applet via LiveConnect javascript
769 <jar update="true" index="true">
771 <attribute name="Application-Name" value="JalviewLite" />
772 <attribute name="Permissions" value="all-permissions" />
773 <attribute name="Codebase" value="${applet.codebase}" />
774 <attribute name="Trusted-Only" value="true" />
775 <attribute name="Trusted-Library" value="true" />
779 <presetdef name="to_applet.jar">
780 <!-- not fully test variant (yet) -->
781 <jar update="true" index="true">
783 <attribute name="Application-Name" value="JalviewLite" />
784 <attribute name="Permissions" value="all-permissions" />
785 <attribute name="Codebase" value="${applet.codebase}" />
786 <attribute name="Trusted-Only" value="true" />
790 <!-- create differently privileged artefacts -->
791 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/u_${jalviewLiteJar}" />
792 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
793 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true" />
794 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true" />
795 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/ap_${jalviewLiteJar}" />
796 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/ap_${jmolJar}" />
797 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/ap_${javaJson}" />
798 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/ap_${jsonSimple}" />
799 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jalviewLiteJar}" />
800 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jmolJar}" />
801 <ap_applet.jar jarfile="${packageDir}/examples/ap_${javaJson}" />
802 <ap_applet.jar jarfile="${packageDir}/examples/ap_${jsonSimple}" />
803 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/tl_${jalviewLiteJar}" />
804 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/tl_${jmolJar}" />
805 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/tl_${javaJson}" />
806 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/tl_${jsonSimple}" />
807 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jalviewLiteJar}" />
808 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jmolJar}" />
809 <tl_applet.jar jarfile="${packageDir}/examples/tl_${javaJson}" />
810 <tl_applet.jar jarfile="${packageDir}/examples/tl_${jsonSimple}" />
811 <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/to_${jalviewLiteJar}" />
812 <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/to_${jmolJar}" />
813 <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/to_${javaJson}" />
814 <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/to_${jsonSimple}" />
815 <to_applet.jar jarfile="${packageDir}/examples/to_${jalviewLiteJar}" />
816 <to_applet.jar jarfile="${packageDir}/examples/to_${jmolJar}" />
817 <to_applet.jar jarfile="${packageDir}/examples/to_${javaJson}" />
818 <to_applet.jar jarfile="${packageDir}/examples/to_${jsonSimple}" />
819 <!-- finally, create manifest for original jars -->
820 <applet.jar jarfile="${packageDir}/examples/${jalviewLiteJar}" />
821 <applet.jar jarfile="${packageDir}/examples/${jmolJar}" />
822 <applet.jar jarfile="${packageDir}/examples/${javaJson}" />
823 <applet.jar jarfile="${packageDir}/examples/${jsonSimple}" />
825 <!-- todo - write examples/downloads for alternate versions of the applet
826 probably don't need to do this now since we don't have alternate versions anymore !-->
828 <target name="-signapplet" depends="prepubapplet_1">
829 <fileset id="signappletjarset" dir="${packageDir}/examples">
830 <exclude name="u_*.jar" />
831 <include name="${jalviewLiteJar}" />
832 <include name="${jmolJar}" />
833 <include name="${javaJson}" />
834 <include name="${jsonSimple}" />
835 <include name="to_${jalviewLiteJar}" />
836 <include name="to_${jmolJar}" />
837 <include name="to_${javaJson}" />
838 <include name="to_${jsonSimple}" />
839 <include name="tl_${jalviewLiteJar}" />
840 <include name="tl_${jmolJar}" />
841 <include name="tl_${javaJson}" />
842 <include name="tl_${jsonSimple}" />
843 <include name="ap_${jalviewLiteJar}" />
844 <include name="ap_${jmolJar}" />
845 <include name="ap_${javaJson}" />
846 <include name="ap_${jsonSimple}" />
849 <target name="-signappletnotsa" unless="timestamp" depends="-signapplet">
850 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
851 <fileset refid="signappletjarset" />
855 <target name="-signapplettsa" if="timestamp" depends="-signapplet">
856 <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" tsaproxyhost="${proxyHost}" tsaproxyport="${proxyPort}" tsaurl="${jalview.tsaurl}">
857 <fileset refid="signappletjarset" />
861 <target name="signApplet" description="internal target to sign applet" depends="-signappletnotsa,-signapplettsa" />
863 <target name="pubapplet" description="installs the jalviewLite applet and dependent jars into an applet examples directory built under ${outputDir}" depends="makeApplet, signApplet">
865 <!-- bizarre bug causes JmolApplet to always get signed, even if excluded from above. so copy explicitly -->
866 <copy file="appletlib/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
867 <!-- finally, replace any launchApp servlet tags with a version specification -->
868 <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}"">
870 <![CDATA[http://www.jalview.org/services/launchApp"]]>
872 <fileset dir="${packageDir}/examples">
873 <include name="**/*.html" />
876 <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}'">
878 <![CDATA[http://www.jalview.org/services/launchApp']]>
880 <fileset dir="${packageDir}/examples">
881 <include name="**/*.html" />
886 <target name="sourcedoc" description="Create jalview source documentation pages" depends="init">
887 <javadoc destdir="${javadocDir}">
888 <packageset dir="${sourceDir}" includes="jalview/*,MCView/*">