JAL-1503 update version in GPL header
[jalview.git] / build.xml
index fdefa36..ba538c2 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -1,20 +1,21 @@
 <?xml version="1.0"?>
 <!--
-   * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
-   * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
-   * 
-   * This file is part of Jalview.
-   * 
-   * Jalview is free software: you can redistribute it and/or
-   * modify it under the terms of the GNU General Public License 
-   * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-   * 
-   * Jalview is distributed in the hope that it will be useful, but 
-   * WITHOUT ANY WARRANTY; without even the implied warranty 
-   * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
-   * PURPOSE.  See the GNU General Public License for more details.
-   * 
-   * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
+ * Copyright (C) 2014 The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
 -->
 <project name="jalviewX" default="usage" basedir=".">
        <!-- we use jalopy to format our sources -->
                <!-- Key Password -->
                <property name="jalview.key.pass" value="alignmentisfun" />
 
+                   
+                   
                <!-- Don't change anything below here unless you know what you are doing! -->
                <!-- Url path for WebStart in JNLP file -->
                <property name="WebStartLocation" value="http://www.jalview.org/webstart" />
+               <!-- Webstart Image - looked for in resources/images -->
+               <property name="WebStartImage" value="JalviewLogo_big.png"/>
+               <!-- J2SE version needed for webstart launch -->
+               <property name="j2sev" value="1.6+"/>
+
+    <!-- Permissions for running Java applets and applications. -->
+    <!-- Defaults are those suitable for deploying jalview webstart www.jalview.org -->
+    <property name="application.codebase" value="*.jalview.org" />
+    <!-- and allowing the applet to be deployed from any URL -->
+    <property name="applet.codebase" value="*" />
+    <property name="applet.caller-codebase" value="${applet.codebase}" />
+
                <!-- build directory configuration -->
                <property name="libDir" value="lib" />
                <property name="resourceDir" value="resources" />
                <property name="packageDir" value="dist" />
                <property name="outputJar" value="jalview.jar" />
                <!-- Jalview Applet JMol Jar Dependency -->
-               <property name="jmolJar" value="JmolApplet-12.1.13.jar" />
+               <property name="jmolJar" value="JmolApplet-12.2.4.jar" />
                <property name="jalviewLiteJar" value="jalviewApplet.jar" />
                <!-- switch to indicate if we should obfuscate jalviewLite -->
                <!--<property name="donotobfuscate" value="true"/> -->
                                <include name="*.jar" />
                                <include name="**/*.jar" />
                        </fileset>
+                       <fileset dir="${java.home}/lib">
+                               <include name="plugin.jar"/>
+                       </fileset>
                        <fileset dir="appletlib">
                                <!-- the JmolApplet includes the JmolApplet console and the application javac seems to always try and build all packages 
                                -->
                </path>
                <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
                <!-- The Location of the java 1.1.8 jdk -->
-               <property name="java118.home" value="C:\Sun\jdk1.1.8" />
-               <property name="applet.jre.tools" value="${java118.home}/lib/classes.zip" />
-               <!-- jre for 1.4 version
-               <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
+               <!--<property name="java118.home" value="C:\Sun\jdk1.1.8" />
                -->
+               <property name="java118.home" value="${java.home}" />
+                   <!--<property name="applet.jre.tools" value="${java118.home}/lib/classes.zip" />
+               --><!-- jre for 1.4 version -->
+               <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
+               
                <!-- the classpath for building the 1.1 applet -->
                <path id="jalviewlite.deps">
                        <fileset dir="${java118.home}">
                                <include name="lib/classes.zip" />
                        </fileset>
+                       <fileset dir="${java.home}/lib">
+                               <include name="plugin.jar"/>
+                       </fileset>
                        <pathelement location="appletlib/${jmolJar}" />
                </path>
+    <!-- default location for outputting javadoc -->
+    <property name="javadocDir" value="${packageDir}/javadoc"/>
        </target>
 
 
 
        <target name="clean" depends="init">
                <!-- not efficient yet. -->
-               <delete dir="${outputDir}" />
+               <delete dir="${outputDir}" includes="*,**/*"/>
        </target>
 
        <target name="distclean" depends="init, clean">
        </target>
 
        <target name="makefulldist" depends="makedist">
-               <!-- the default keystore details might need to be edited here -->
-               <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
-
-                       <fileset dir="${packageDir}">
-                               <include name="*.jar" />
+               <copy todir="${packageDir}">
+                       <fileset dir="${resourceDir}/images">
+                               <include name="${WebStartImage}"/>
                        </fileset>
-               </signjar>
+                                       </copy>
+               
                <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties" />
 
-               <!--    codebase="http://www.jalview.org/jalview/webstart" -->
-               <!-- href="jalview.jnlp" prevent hard-wired pickup of jnlp in certain javaws versions -->
-               <jnlp toFile="${packageDir}/jalview.jnlp" codebase="${WebStartLocation}">
-                       <information>
-                               <title>Jalview</title>
-                               <vendor>The Barton Group</vendor>
-                               <homepage href="http://www.jalview.org" />
-                               <description>Jalview Multiple Alignment Editor</description>
-                               <description kind="short">Jalview</description>
-                               <icon href="logo_big.gif" />
-                               <offline_allowed />
-                               <!--
-       <association mime-type="application-x/ext-file" extensions="fa"/>
+    <!-- create a dummy jar which will eventually contain the jnlp template -->
+    <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
+                               <fileset dir="${packageDir}">
+                                       <include name="jalview.jar" />
+                               </fileset>
+    </jar>
+       
+       <mkdir dir="${packageDir}/JNLP-INF"/>
+    <antcall target="writejnlpf">
+       <param name="jnlpFile" value="${packageDir}/JNLP-INF/APPLICATION-TEMPLATE.JNLP"/>
+       <param name="inih" value="*" />
+       <param name="maxh" value="*"/>
+    </antcall>
+               
+       <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
+                               <fileset dir="${packageDir}">
+               <include name="JNLP-INF"/>
+                               </fileset>
+       </jar>
+    
+       <antcall target="writejnlpf">
+               <param name="jnlpFile" value="${packageDir}/jalview.jnlp"/>
+               <param name="inih" value="10M" />
+         <param name="maxh" value="256M"/>
+       </antcall>
+       
+       <antcall target="writejnlpf">
+         <param name="jnlpFile" value="${packageDir}/jalview_1G.jnlp"/>
+         <param name="inih" value="128M" />
+               <param name="maxh" value="512M"/>
+       </antcall>
+           
+       <antcall target="writejnlpf">
+         <param name="jnlpFile" value="${packageDir}/jalview_2G.jnlp"/>
+         <param name="inih" value="256M" />
+         <param name="maxh" value="1024M"/>
+       </antcall>
+       
+                       <!-- finally, need to postprocess to add in associations at end of 'information' element 
+                       
+                       <xslt in="${packageDir}/jalview_noa_1G.jnlp" out="${packageDir}/jalview_1G.jnlp">
+               
+               </xslt>
+                       
+                       
+                       -->
+                                       <!--
+                               <association mime-type="application-x/ext-file" extensions="fa"/>
         <association mime-type="application-x/ext-file" extensions="fasta"/>
+        <association mime-type="application-x/ext-file" extensions="mfa"/>
         <association mime-type="application-x/ext-file" extensions="fastq"/>
         <association mime-type="application-x/ext-file" extensions="blc"/>
         <association mime-type="application-x/ext-file" extensions="msf"/>
         <association mime-type="application-x/ext-file" extensions="aln"/>
         <association mime-type="application-x/ext-file" extensions="pir"/>
         <association mime-type="application-x/ext-file" extensions="amsa"/>
-       -->
-                       </information>
-                       <resources>
-                               <j2se version="1.5+" initial_heap_size="10M" />
-                               <fileset dir="${packageDir}">
-                                       <include name="jalview.jar" />
-                               </fileset>
-                               <fileset dir="${packageDir}">
-                                       <include name="*.jar" />
-                                       <include name="*_*.jar" />
-                                       <exclude name="jalview.jar" />
-                               </fileset>
-                               <property name="jalview.version" value="${JALVIEW_VERSION}" />
-                       </resources>
-                       <application_desc main_class="jalview.bin.Jalview">
-                       </application_desc>
-                       <security>
-                               <all_permissions />
-                       </security>
-               </jnlp>
-               <!-- the rest of these jnlp tasks are copy and pastes of the above but with different Vm args -->
-               <jnlp toFile="${packageDir}/jalview_1G.jnlp" codebase="${WebStartLocation}">
-                       <information>
-                               <title>Jalview</title>
-                               <vendor>The Barton Group</vendor>
-                               <homepage href="http://www.jalview.org" />
-                               <description>Jalview Multiple Alignment Editor</description>
-                               <description kind="short">Jalview</description>
-                               <icon href="logo_big.gif" />
-                               <offline_allowed />
-                               <!--
-               <association mime-type="application-x/ext-file" extensions="fa"/>
-               <association mime-type="application-x/ext-file" extensions="fasta"/>
-               <association mime-type="application-x/ext-file" extensions="fastq"/>
-               <association mime-type="application-x/ext-file" extensions="blc"/>
-               <association mime-type="application-x/ext-file" extensions="msf"/>
-               <association mime-type="application-x/ext-file" extensions="pfam"/>
-               <association mime-type="application-x/ext-file" extensions="aln"/>
-               <association mime-type="application-x/ext-file" extensions="pir"/>
-               <association mime-type="application-x/ext-file" extensions="amsa"/>
-               -->
-                       </information>
-                       <resources>
-                               <j2se version="1.5+" initial_heap_size="64M" max_heap_size="512M" />
-                               <fileset dir="${packageDir}">
-                                       <include name="jalview.jar" />
-                               </fileset>
-                               <fileset dir="${packageDir}">
-                                       <include name="*.jar" />
-                                       <include name="*_*.jar" />
-                                       <exclude name="jalview.jar" />
-                               </fileset>
-                               <property name="jalview.version" value="${JALVIEW_VERSION}" />
-                       </resources>
-                       <application_desc main_class="jalview.bin.Jalview">
-                       </application_desc>
-                       <security>
-                               <all_permissions />
-                       </security>
-               </jnlp>
-               <jnlp toFile="${packageDir}/jalview_2G.jnlp" codebase="${WebStartLocation}">
-                       <information>
-                               <title>Jalview</title>
-                               <vendor>The Barton Group</vendor>
-                               <homepage href="http://www.jalview.org" />
-                               <description>Jalview Multiple Alignment Editor</description>
-                               <description kind="short">Jalview</description>
-                               <icon href="logo_big.gif" />
-                               <offline_allowed />
-                               <!--
-                       <association mime-type="application-x/ext-file" extensions="fa"/>
-                       <association mime-type="application-x/ext-file" extensions="fasta"/>
-                       <association mime-type="application-x/ext-file" extensions="fastq"/>
-                       <association mime-type="application-x/ext-file" extensions="blc"/>
-                       <association mime-type="application-x/ext-file" extensions="msf"/>
-                       <association mime-type="application-x/ext-file" extensions="pfam"/>
-                       <association mime-type="application-x/ext-file" extensions="aln"/>
-                       <association mime-type="application-x/ext-file" extensions="pir"/>
-                       <association mime-type="application-x/ext-file" extensions="amsa"/>
-                       -->
-                       </information>
-                       <resources>
-                               <j2se version="1.5+" initial_heap_size="256M" max_heap_size="1024M" />
-                               <fileset dir="${packageDir}">
-                                       <include name="jalview.jar" />
-                               </fileset>
-                               <fileset dir="${packageDir}">
-                                       <include name="*.jar" />
-                                       <include name="*_*.jar" />
-                                       <exclude name="jalview.jar" />
-                               </fileset>
-                               <property name="jalview.version" value="${JALVIEW_VERSION}" />
-                       </resources>
-                       <application_desc main_class="jalview.bin.Jalview">
-                       </application_desc>
-                       <security>
-                               <all_permissions />
-                       </security>
-               </jnlp>
-
+        <association mime-type="application-x/ext-file" extensions="stk"/>
+        <association mime-type="application-x/ext-file" extensions="jar"/>-->
+    <!-- and sign the jars -->
+    <!-- the default keystore details might need to be edited here -->
+    <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="SHA1withRSA">
+        <fileset dir="${packageDir}">
+          <include name="*.jar" />
+        </fileset>
+    </signjar>
        </target>
 
        <target name="runenv" depends="init">
                <echo>java -classpath ${run.classpath} jalview.bin.Jalview
       </echo>
        </target>
-
+  <target name="writejnlpf">
+       <presetdef name="jnlpf">
+           <jnlp codebase="${WebStartLocation}">
+             <information>
+               <title>Jalview</title>
+               <vendor>The Barton Group</vendor>
+               <homepage href="http://www.jalview.org" />
+               <description>Jalview Multiple Alignment Editor</description>
+               <description kind="short">Jalview</description>
+               <icon href="${WebStartImage}" />
+               <offline_allowed />
+             </information>
+             <resources>
+               <j2se version="${j2sev}" initial_heap_size="${inih}" max_heap_size="${maxh}" />
+               <fileset dir="${packageDir}">
+                 <include name="jalview.jar" />
+               </fileset>
+               <fileset dir="${packageDir}">
+                 <include name="*.jar" />
+                 <include name="*_*.jar" />
+                 <exclude name="jalview.jar" />
+               </fileset>
+               <property name="jalview.version" value="${JALVIEW_VERSION}" />
+             </resources>
+             <application_desc main_class="jalview.bin.Jalview">
+             </application_desc>
+             <security>
+               <all_permissions />
+             </security>
+           </jnlp>
+           </presetdef>
+
+           <jnlpf toFile="${jnlpFile}"/>
+  </target>
        <target name="buildextclients" depends="init">
                <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" />
                <condition property="dontextbuild">
                                <include name="*.jar"/>
                        </fileset>
                </delete>
-               <jar destfile="${packageDir}/${outputJar}">
+               <jar destfile="${packageDir}/${outputJar}" index="true">
                        <manifest>
                                <attribute name="Main-Class" value="jalview.bin.Jalview" />
+        <attribute name="Permissions" value="all-permissions" />
+        <attribute name="Application-Name" value="Jalview Desktop" />
+        <attribute name="Codebase" value="${application.codebase}" />
                        </manifest>
                        <fileset dir="${outputDir}/">
                                <exclude name="cache*/**" />
 
 
        <!-- Compile, package and obfuscate Jalview Applet -->
-       <target name="makeApplet" depends="obfuscate" />
+       <target name="makeApplet" depends="obfuscate" description="assemble the final jalviewLite applet jar with or without obfuscation"/>
 
        <target name="compileApplet" depends="init,clean">
                <mkdir dir="${outputDir}" />
-               <javac source="1.5" target="1.5" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpath="appletlib/${jmolJar}" includes="jalview/appletgui/**" excludes="ext/**,MCview/**,org/**,vamsas/**" />
+               <javac source="1.5" target="1.5" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" 
+                       classpathref="jalviewlite.deps" includes="jalview/appletgui/**"
+                       excludes="ext/**,MCview/**,org/**,vamsas/**" />
        </target>
 
        <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
                <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif" />
                <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
-               <jar destfile="in.jar">
+               <copy todir="${outputDir}/lang">
+                       <fileset dir="${resourceDir}/lang"><include name="**.*"/></fileset></copy>
+               <jar destfile="in.jar" index="true">
                        <manifest>
                                <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
+               <attribute name="Application-Name" value="JalviewLite" />
+           <attribute name="Codebase" value="${applet.codebase}" />
                        </manifest>
                        <fileset dir="${outputDir}">
                                <include name="com/**" />
                                <include name=".build_properties" />
                                <include name="images/idwidth.gif" />
                                <include name="images/link.gif" />
+                               <include name="lang/**" />
                        </fileset>
                </jar>
        </target>
-       <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally" description="construct the final jalviewLite applet jar with or without obfuscation">
+       <target name="obfuscate" depends="-obfuscatefake,-obfuscatereally">
        </target>
        <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
                <copy file="in.jar" tofile="${jalviewLiteJar}" overwrite="true" />
                        <injar file="in.jar" />
                        <outjar file="${jalviewLiteJar}" />
                        <libraryjar refid="obfuscateDeps.path" />
+                       <dontwarn/>
                        <keep access="public" type="class" name="jalview.bin.JalviewLite">
                                <field access="public" />
                                <method access="public" />
                                <constructor access="public" />
                        </keep>
+                       <keep access="public" type="class" name="jalview.appletgui.AlignFrame">
+                               <field access="public" />
+                               <method access="public" />
+                               <constructor access="public" />
+                       </keep>
                        <!--      -libraryjars "${obfuscateDeps}"
       -injars      in.jar
       -outjars     jalviewApplet.jar
                                <include name="jalview-jalopy.xml" />
                                <include name="JalviewApplet.jpx" />
                                <include name="JalviewX.jpx" />
+                               <include name="nbbuild.xml"/>
+                               <include name="nbproject/genfiles.properties"/>
+        <include name="nbproject/project.properties"/>
+        <include name="nbproject/project.xml"/>
                                <include name="${sourceDir}/*.java" />
                                <include name="${sourceDir}/**/*.java" />
                                <include name="${sourceDir}/**/*.cdr" />
                                <include name="${schemaDir}/**/*" />
                                <include name="utils/**/*" />
                                <include name="${docDir}/**/*" />
+                               <include name="examples/**/*" />
                        </tarfileset>
                </tar>
        </target>
+       <target name="pubapplet" description="installs the jalviewLite applet and dependent jars into an applet examples directory built under ${outputDir}" depends="makeApplet">
+         <copy todir="${packageDir}/examples">
+         <fileset dir="examples">
+               <include name="**/*"/>
+               <include name="javascript/*"/>
+      <include name="jmol/*"/>
+         </fileset>
+               <fileset dir=".">
+        <include name="${jalviewLiteJar}" />
+                       </fileset>
+               <fileset dir="appletlib">
+                     <include name="**/*"/>
+                       </fileset>
+         </copy>
+           <jar update="true" index="true" jarfile="${packageDir}/examples/${jalviewLiteJar}"/>
+           <jar update="true" index="true" jarfile="${packageDir}/examples/${jmolJar}">
+               <manifest>
+               <attribute name="Application-Name" value="Jmol (bundled with JalviewLite)"/>
+               <!--          <attribute name="Permissions" value="sandbox" /> -->
+               <!--<attribute name="Trusted-Lib" value="true" /> -->
+               <attribute name="Codebase" value="${applet.codebase}"/>
+               <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}"/>
+                 </manifest>
+               </jar>
+    <signjar sigalg="SHA1WithRSA" storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
+      <fileset dir="${packageDir}/examples">
+        <include name="*.jar" />
+      </fileset>
+    </signjar>
+    <presetdef name="ap_applet.jar">
+      <!-- build a signed applet with 'all-permissions' - 
+                         Needs 'param name="permissions' value="all-permissions"' in applet tag
+                         JalviewLite+JmolApplet linked sequence/structure fails
+                         Mixed code warnings are raised
+                         -->
+      <jar update="true" index="true">
+        <manifest>
+          <attribute name="Application-Name" value="JalviewLite" />
+          <attribute name="Permissions" value="all-permissions" />
+          <attribute name="Codebase" value="${applet.codebase}" />
+          <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
+          <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
+        </manifest>
+      </jar>
+    </presetdef>
+    <presetdef name="applet.jar">
+      <!-- build signed applet with sandbox permissions -
+                         Needs 'param name="permissions' value="sandbox"' in applet tag
+                        Preserves Pre-Java 1.7_u45 behavior once 'permissions' parameter added to applet tag 
+                       -->
+
+      <jar update="true" index="true">
+        <manifest>
+          <attribute name="Application-Name" value="JalviewLite" />
+          <attribute name="Permissions" value="sandbox" />
+          <attribute name="Codebase" value="${applet.codebase}" />
+          <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
+          <attribute name="Application-Library-Allowable-Codebase" value="${applet.codebase}" />
+        </manifest>
+      </jar>
+    </presetdef>
+    <presetdef name="tl_applet.jar">
+      <!-- build signed applet with trusted library/trusted permissions -
+                               Needs 'param name="permissions' value="all-permissions"' in applet tag
+                              j1.7_45:
+                              No mixed code warnings raised 
+                              Jmol/JalviewLite sequence/structure example doesn't link structures
+                              Raises dialog asking user to allow page to control applet via LiveConnect javascript
+                              
+                             -->
+
+      <jar update="true" index="true">
+        <manifest>
+          <attribute name="Application-Name" value="JalviewLite" />
+          <attribute name="Permissions" value="all-permissions" />
+          <attribute name="Codebase" value="${applet.codebase}" />
+          <attribute name="Trusted-Only" value="true" />
+          <attribute name="Trusted-Library" value="true" />
+        </manifest>
+      </jar>
+    </presetdef>
+    <presetdef name="to_applet.jar">
+      <!-- not fully test variant (yet) -->
+      <jar update="true" index="true">
+        <manifest>
+          <attribute name="Application-Name" value="JalviewLite" />
+          <attribute name="Permissions" value="all-permissions" />
+          <attribute name="Codebase" value="${applet.codebase}" />
+          <attribute name="Trusted-Only" value="true" />
+        </manifest>
+      </jar>
+    </presetdef>
+    <!-- create differently privileged artefacts -->
+    <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/u_${jalviewLiteJar}" />
+    <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true"/>
+    <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/ap_${jalviewLiteJar}" />
+    <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/ap_${jmolJar}"/>
+    <ap_applet.jar jarfile="${packageDir}/examples/ap_${jalviewLiteJar}" />
+    <ap_applet.jar jarfile="${packageDir}/examples/ap_${jmolJar}" />
+    <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/tl_${jalviewLiteJar}" />
+    <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/tl_${jmolJar}" />
+    <tl_applet.jar jarfile="${packageDir}/examples/tl_${jalviewLiteJar}" />
+    <tl_applet.jar jarfile="${packageDir}/examples/tl_${jmolJar}" />
+    <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/to_${jalviewLiteJar}" />
+    <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/to_${jmolJar}" />
+    <to_applet.jar jarfile="${packageDir}/examples/to_${jalviewLiteJar}" />
+    <to_applet.jar jarfile="${packageDir}/examples/to_${jmolJar}" />
+    <!-- finally, create manifest for original jars -->
+    <applet.jar jarfile="${packageDir}/examples/${jalviewLiteJar}" />
+    <applet.jar jarfile="${packageDir}/examples/${jmolJar}" />
+
+    <!-- todo - write examples/downloads for alternate versions of the applet -->
+    <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
+
+      <fileset dir="${packageDir}/examples">
+        <exclude name="u_*.jar"/>
+        <include name="${jalviewLiteJar}" />
+        <include name="${jmolJar}" />
+        <include name="to_${jalviewLiteJar}" />
+        <include name="to_${jmolJar}" />
+        <include name="tl_${jalviewLiteJar}" />
+        <include name="tl_${jmolJar}" />
+        <include name="ap_${jalviewLiteJar}" />
+        <include name="ap_${jmolJar}" />
+      </fileset>
+    </signjar>
+    <!-- bizarre bug causes JmolApplet to always get signed, even if excluded from above. so copy explicitly -->
+    <copy file="appletlib/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
+  </target>
+  <target name="sourcedoc" description="Create jalview source documentation pages" depends="init">
+    <javadoc destdir="${javadocDir}">
+      <packageset dir="${sourceDir}" includes="jalview/*,MCView/*">
+      </packageset>
+    </javadoc>
+  </target>
 </project>