generate SHA-512 checksums as well

git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/common/trunk@773603 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/build.xml b/build.xml
index 516b08e..5945eb1 100644
--- a/build.xml
+++ b/build.xml
@@ -17,6 +17,9 @@
 -->
 <project name="common">
 
+  <dirname property="common.basedir" file="${ant.file.common}"/>
+  <import file="${common.basedir}/common-tasks.xml"/>
+
   <target name="setup-properties">
     <property file="build.properties"/>
     <!--load in an optional file containing versions of things-->
@@ -109,8 +112,9 @@
 
   <target name="checksum-target-jar"
           description="checksum our jar" depends="antlib">
-    <checksum file="${target.jar}" algorithm="md5"/>
-    <checksum file="${target.jar}" algorithm="sha1"/>
+    <checksums>
+      <file file="${target.jar}"/>
+    </checksums>
   </target>
   
   <target name="determine-test-types">
@@ -232,7 +236,6 @@
     <copy file="${jarname}" todir="${ant.home}/lib"/>
   </target>  
 
-  <dirname property="common.basedir" file="${ant.file.common}"/>
   <import file="${common.basedir}/m2.xml"/>
   <import file="${common.basedir}/ivy.xml"/>
 
@@ -353,27 +356,19 @@
       </fileset>
       <mapper type="glob" from="*.jar" to="*-${version}.jar"/>
     </copy>
-    <checksum fileext=".md5">
+    <checksums>
       <fileset dir="${java-repository.dir}" includes="*${version}.jar"/>
-    </checksum>
-    <checksum fileext=".sha1" algorithm="SHA">
-      <fileset dir="${java-repository.dir}" includes="*${version}.jar"/>
-    </checksum-->
+    </checksums-->
 
-    <checksum fileext=".md5">
+    <checksums>
       <fileset dir="${dist.base.binaries}/">
         <include name="**/*"/>
         <exclude name="**/*.asc"/>
         <exclude name="**/*.md5"/>
+        <exclude name="**/*.sha1"/>
+        <exclude name="**/*.sha512"/>
       </fileset>
-    </checksum>
-    <checksum fileext=".sha1" algorithm="SHA">
-      <fileset dir="${dist.base.binaries}/">
-        <include name="**/*"/>
-        <exclude name="**/*.asc"/>
-        <exclude name="**/*.md5"/>
-      </fileset>
-    </checksum>
+    </checksums>
 
     <delete dir="${dist.name}"/>
     <antcall target="src-dist" inheritall="false">
@@ -397,20 +392,15 @@
       src="${dist.base.source}/${dist.name}-src.tar"/>
     <delete file="${dist.base.source}/${dist.name}-src.tar"/>
     <delete dir="${dist.name}"/>
-    <checksum fileext=".md5">
+    <checksums>
       <fileset dir="${dist.base.source}/">
         <include name="**/*"/>
         <exclude name="**/*.asc"/>
         <exclude name="**/*.md5"/>
+        <exclude name="**/*.sha1"/>
+        <exclude name="**/*.sha512"/>
       </fileset>
-    </checksum>
-    <checksum fileext=".sha1" algorithm="SHA">
-      <fileset dir="${dist.base.source}/">
-        <include name="**/*"/>
-        <exclude name="**/*.asc"/>
-        <exclude name="**/*.md5"/>
-      </fileset>
-    </checksum>
+    </checksums>
   </target>
 
   <target name="check-contributors">
diff --git a/common-tasks.xml b/common-tasks.xml
index bb6e26a..9922f23 100644
--- a/common-tasks.xml
+++ b/common-tasks.xml
@@ -26,4 +26,20 @@
       </filterchain>
     </copy>
   </presetdef>
+
+  <!-- create checksums -->
+  <macrodef name="checksums">
+    <element name="resources" implicit="true"/>
+    <sequential>
+      <checksum algorithm="md5">
+        <resources/>
+      </checksum>
+      <checksum algorithm="sha1">
+        <resources/>
+      </checksum>
+      <checksum fileext=".sha512" algorithm="sha-512">
+        <resources/>
+      </checksum>
+    </sequential>
+  </macrodef>
 </project>
diff --git a/ivy.xml b/ivy.xml
index e3520fa..a5610d1 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -72,8 +72,9 @@
   </target>
 
   <target name="ivy.xml" depends="copy-ivy.xml,make-ivy.xml">
-    <checksum file="${target.ivy.xml}" algorithm="md5"/>
-    <checksum file="${target.ivy.xml}" algorithm="sha1"/>
+    <checksums>
+      <file file="${target.ivy.xml}"/>
+    </checksums>
   </target>
 
-</project>
\ No newline at end of file
+</project>
diff --git a/m2.xml b/m2.xml
index 57473a5..5b82a02 100644
--- a/m2.xml
+++ b/m2.xml
@@ -66,8 +66,9 @@
   </target>
 
   <target name="m2-pom" depends="m2-copy-pom,m2-make-pom">
-    <checksum file="${target.pom}" algorithm="md5"/>
-    <checksum file="${target.pom}" algorithm="sha1"/>
+    <checksums>
+      <file file="${target.pom}"/>
+    </checksums>
   </target>
 
-</project>
\ No newline at end of file
+</project>