jMol jar applet dependency is now a build property and obfuscate proguard task uses...
[jalview.git] / build.xml
index b415140..9a855f5 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -23,6 +23,7 @@
                <echo message="compileApplet - compiles all necessary files for Applet"/>
                <echo message="makeApplet - compiles, then packages and obfuscates the Applet"/>
                <echo message="See docs/building.html and the comments in build file for other targets."/>
+           <echo message="note: compile and makeApplet require the property java118.home to be set to point to a java 1.1.8 jdk."/>
        </target>
 
 
@@ -53,7 +54,7 @@
                        </fileset> -->
       </path>
                <!-- Jalview Version String displayed by application on startup and used to check for updates -->
-      <property name="JALVIEW_VERSION" value="DEVELOPMENT"/>
+      <property name="JALVIEW_VERSION" value="2.3"/>
                <!-- 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"/>
@@ -67,6 +68,8 @@
                <property name="outputDir" value="classes" />
                <property name="packageDir" value="dist" />
                <property name="outputJar" value="jalview.jar" />
+                <!-- Jalview Applet JMol Jar Dependency -->
+                <property name="jmolJar" value="Jmol-11.0.2.jar" />
                <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
                <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
                <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
                                <include name="**/*.jar"/>
                        </fileset>
                </path>
+               <!-- The Location of the java 1.1.8 jdk -->
+               <property name="java118.home" value="C:\Sun\jdk1.1.8" />
+               <!-- the classpath for building the 1.1 applet -->
+               <path id="jalviewlite.deps">
+                       <fileset dir="${java118.home}">
+                               <include name="lib/classes.zip"/>
+                       </fileset>
+               <pathelement location="lib/${jmolJar}"/>
+         </path>
        </target>
 
 
 
 
 
-       <!-- Compile, package and obfuscate Jalview Applet -->
-       <target name="makeApplet" depends="obfuscate"/>
+  <!-- Compile, package and obfuscate Jalview Applet -->
+  <target name="makeApplet" depends="obfuscate"/>
 
-       <target name="compileApplet" depends="init,clean">
-               <mkdir dir="${outputDir}"/>
+  <target name="compileApplet" depends="init,clean">
+    <mkdir dir="${outputDir}"/>
     <javac source="1.2"
     target="1.1"
     srcdir="${sourceDir}" 
     destdir="${outputDir}"
-    classpath="lib/jmol.jar"
+    classpath="lib/${jmolJar}"
        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">
-                       <manifest>
-                               <attribute name="Main-Class" value="jalview.bin.JalviewLite"/>
-                       </manifest>
-                       <fileset dir="${outputDir}">
-                               <include name="com/**"/>
-                               <include name="MCview/**"/>
-                               <include name="jalview/**"/>
-                               <include name=".build_properties"/>
-                               <include name="images/idwidth.gif"/>
-                               <include name="images/link.gif"/>
-                       </fileset>
-               </jar>
-       </target>
-
-       <target name="obfuscate" depends="packageApplet">
-               <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
-               <path id="jalviewlite.deps">
-                       <pathelement location="${java.home}/lib/rt.jar"/>
-                       <pathelement location="lib/jmol.jar"/>
-               </path>
-               <proguard>
-                       <libraryjar refid="jalviewlite.deps"/>
+  </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">
+        <manifest>
+            <attribute name="Main-Class" value="jalview.bin.JalviewLite"/>
+        </manifest>
+        <fileset dir="${outputDir}">
+          <include name="com/**"/>
+          <include name="MCview/**"/>
+          <include name="jalview/**"/>
+          <include name=".build_properties"/>
+          <include name="images/idwidth.gif"/>
+          <include name="images/link.gif"/>
+        </fileset>
+      </jar>
+  </target>
+
+  <target name="obfuscate" depends="packageApplet">
+    <path id="obfuscateDeps.path">
+    <pathelement location="${java.home}/lib/rt.jar"/>
+    <pathelement location="lib/${jmolJar}"/>
+    </path>
+    <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
+    <proguard>
+      <injar file="in.jar"/>
+      <outjar file="jalviewApplet.jar"/>
+      <libraryjar refid="obfuscateDeps.path"/>
+      <keep access="public" type="class"
+      name="jalview.bin.JalviewLite">
+        <field access="public"/>
+        <method access="public"/>
+        <constructor access="public"/>
+      </keep>
+<!--      -libraryjars "${obfuscateDeps}"
       -injars      in.jar
       -outjars     jalviewApplet.jar
       -keep public class jalview.bin.JalviewLite
        { public * ; }
+       -->
     </proguard>
-               <delete file="in.jar"/>
-       </target>
+    <delete file="in.jar"/>
+  </target>
 
        <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
                <taskdef name="castor-srcgen"