JAL-1791 make timestamping optional using -Dtimestamp
authorJim Procter <jprocter@issues.jalview.org>
Thu, 15 Oct 2015 13:45:06 +0000 (14:45 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 15 Oct 2015 16:40:30 +0000 (17:40 +0100)
build.xml

index 7ad650e..70c30a1 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -27,7 +27,8 @@
     <echo message="build - compiles all necessary files for Application" />
     <echo message="makedist - compiles and places all necessary jar files into directory dist" />
     <echo message="makefulldist - signs all jar files and builds jnlp file for full distribution" />
-    <echo message="              this needs a keystore and key. See docs/building.html for more information." />
+    <echo message="              this needs a keystore and key. Add -Dtimestamp to timestamp signed jars"/>
+    <echo message="              See docs/building.html for more information." />
     <echo message="compileApplet - compiles all necessary files for Applet" />
     <echo message="makeApplet - compiles, then packages and obfuscates the Applet" />
     <echo message="testng - run jalview's tests via testNG. Default group is '${testng-groups}'" />
     </java>
   </target>
 
-  <target name="makefulldist" depends="makedist">
+    <target name="preparejnlp" depends="makedist">
     <copy todir="${packageDir}">
       <fileset dir="${resourceDir}/images">
         <include name="${WebStartImage}" />
         <association mime-type="application-x/ext-file" extensions="amsa"/>
         <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 -->
+      </target>
+  
+  <target name="-jarsignwithtsa" depends="preparejnlp" if="timestamp">
     <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="SHA1withRSA"
       tsaurl="${jalview.tsaurl}">
       <fileset dir="${packageDir}">
         <include name="*.jar" />
-      </fileset>
-      
+      </fileset>      
     </signjar>
   </target>
+  <target name="-jarsignnotsa" depends="preparejnlp" unless="timestamp">
+    <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="makefulldist" depends="-jarsignwithtsa,-jarsignnotsa">
+    <!-- and sign the jars -->
+    <!-- the default keystore details might need to be edited here -->
+  </target>
 
   <target name="runenv" depends="init">
     <path id="run.classpath">