JAL-690 JAL-1503 make file associations optional for JNLP
authorJim Procter <jprocter@dundee.ac.uk>
Wed, 4 Jun 2014 14:47:03 +0000 (15:47 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Wed, 4 Jun 2014 14:47:03 +0000 (15:47 +0100)
build.xml

index d440331..1ac7afc 100755 (executable)
--- a/build.xml
+++ b/build.xml
     <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"/> -->
+    <!-- <property name="donotobfuscate" value="true"/> -->
+    <!-- switch to exclude associations from generated jnlp files -->
+    <!-- <property name="nojnlpfileassocs" value="true"/> -->
 
     <!-- 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" />
     <echo>java -classpath ${run.classpath} jalview.bin.Jalview
       </echo>
   </target>
-  <target name="writejnlpf">
+
+  <target name="-generatejnlpf">
     <presetdef name="jnlpf">
       <jnlp codebase="${WebStartLocation}">
         <information>
     </presetdef>
 
     <jnlpf toFile="${jnlpFile}"/>
+  
+  </target>
+  
+  <target name="-dofakejnlpfileassoc" depends="-generatejnlpf" if="nojnlpfileassocs">
+    <echo message="Not adding JNLP File Associations"/>
+  </target>
+  
+  <target name="-dojnlpfileassoc" depends="-generatejnlpf" unless="nojnlpfileassocs">
     <replace file="${jnlpFile}">
       <replacetoken>
         <![CDATA[</information>]]></replacetoken>
       <replacevalue>
         <![CDATA[
-        <association mime-type="application-x/ext-file" extensions="fa" />
+          <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="stk"/>
         <association mime-type="application-x/ext-file" extensions="jvp"/>
       </information>]]></replacevalue>
-  </replace>
+    </replace>
+    <echo message="Added file associations to JNLP file"/>
+    </target>
+<target name="writejnlpf" depends="-dojnlpfileassoc,-dofakejnlpfileassoc">
 </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">