+ <!-- Compile, package and obfuscate Jalview Applet -->
+ <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}"
+ 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" />
+ <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="MCview/**" />
+ <include name="jalview/**" />
+ <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">
+ </target>
+ <target name="-obfuscatefake" depends="packageApplet" if="donotobfuscate">
+ <copy file="in.jar" tofile="${jalviewLiteJar}" overwrite="true" />
+ <delete file="in.jar" />
+ </target>
+ <target name="-obfuscatereally" unless="donotobfuscate">
+
+ <path id="obfuscateDeps.path">
+ <pathelement location="${applet.jre.tools}" />
+ <pathelement location="appletlib/${jmolJar}" />
+ </path>
+ <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
+
+ <proguard>
+ <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
+ -keep public class jalview.bin.JalviewLite
+ { public * ; } -->
+ </proguard>
+ <delete file="in.jar" />
+ </target>
+
+ <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
+ <taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask" classpathref="build.classpath" />
+ <delete>
+ <fileset dir="${sourceDir}/jalview/schemabinding/version2">
+ <include name="*.java" />
+ <include name="descriptors/*.java" />
+ </fileset>
+ </delete>
+ <castor-srcgen file="${schemaDir}/vamsas.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
+ <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
+ <castor-srcgen file="${schemaDir}/JalviewWsParamSet.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
+ <castor-srcgen file="${schemaDir}/jalview.xsd" todir="${sourceDir}" package="jalview.schemabinding.version2" warnings="false" nodesc="false" verbose="true" properties="${schemaDir}/jalview.properties" />
+ <!--
+ now build the jalview.binding package with the old schema set
+ -->
+ <delete>
+ <fileset dir="${sourceDir}/jalview/binding/">
+ <include name="**" />
+ </fileset>
+ </delete>
+ <castor-srcgen file="${schemaDir}/vamsasJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
+ <castor-srcgen file="${schemaDir}/JalviewUserColours.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
+ <castor-srcgen file="${schemaDir}/jalviewJvV1.xsd" todir="${sourceDir}" package="jalview.binding" warnings="false" nodesc="true" verbose="true" properties="${schemaDir}/jalview.nodesc.properties" />
+ </target>
+ <target name="sourcedist" description="create jalview source distribution" depends="init">
+ <delete file="${source.dist.name}" />
+ <tar destfile="${source.dist.name}" compression="gzip">
+ <tarfileset dir="./" prefix="jalview" preserveLeadingSlashes="true">
+ <include name="LICENSE" />
+ <include name="README" />
+ <include name="build.xml" />
+ <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="${libDir}/**/*" />
+ <include name="${resourceDir}/**/*" />
+ <include name="${helpDir}/**/*" />
+ <include name="appletlib/${jmolJar}" />
+ <exclude name="**/*locales" />
+ <exclude name="*locales/**" />
+ <exclude name="utils/InstallAnywhere/**Build.iap_xml" />
+ <exclude name="utils/InstallAnywhere/**Build*/**" />
+ <exclude name="utils/InstallAnywhere/**Build*/**" />
+ <exclude name="utils/InstallAnywhere/**locale*" />
+ <exclude name="utils/InstallAnywhere/**locale*/**" />
+ <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" />