Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-904: The "package" targets in build.xml now also generate .md5 checksum files

Michael Busch0fe4946a60dc
diff --git a/CHANGES.txt b/CHANGES.txt
index ab3a579d0ab..5a85aa2cbdf 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -256,6 +256,9 @@ Build
4. LUCENE-894: Add custom build file for binary distributions that includes
targets to build the demos. (Chris Hostetter, Michael Busch)
+ 5. LUCENE-904: The "package" targets in build.xml now also generate .md5
+ checksum files. (Chris Hostetter, Michael Busch)
+
======================= Release 2.1.0 2007-02-14 =======================
Changes in runtime behavior
diff --git a/build.xml b/build.xml
index f48fd4d6699..f5e47f8367f 100644
--- a/build.xml
+++ b/build.xml
@@ -12,6 +12,9 @@
<property name="demo.war.name" value="luceneweb"/>
<property name="javadoc.link" value="http://java.sun.com/j2se/1.4/docs/api/"/>
+ <!-- Type of checksum to compute for distribution files -->
+ <property name="checksum.algorithm" value="md5" />
+
<!-- Build classpath -->
<path id="classpath">
<pathelement location="${build.dir}/classes/java"/>
@@ -190,6 +193,7 @@
<patternset refid="binary.build.dist.patterns"/>
</zipfileset>
</zip>
+ <lucene-checksum file="${dist.dir}/lucene-${version}.zip"/>
</target>
<!-- ================================================================== -->
@@ -215,6 +219,7 @@
<gzip zipfile="${dist.dir}/lucene-${version}.tar.gz"
src="${build.dir}/lucene-${version}.tar"
/>
+ <lucene-checksum file="${dist.dir}/lucene-${version}.tar.gz"/>
</target>
<!-- ================================================================== -->
@@ -253,6 +258,7 @@
<patternset refid="src.dist.patterns"/>
</zipfileset>
</zip>
+ <lucene-checksum file="${dist.dir}/lucene-${version}-src.zip"/>
</target>
<!-- ================================================================== -->
@@ -274,6 +280,7 @@
<gzip zipfile="${dist.dir}/lucene-${version}-src.tar.gz"
src="${build.dir}/lucene-${version}-src.tar"
/>
+ <lucene-checksum file="${dist.dir}/lucene-${version}-src.tar.gz"/>
</target>
<!-- ================================================================== -->
@@ -492,6 +499,32 @@
</sequential>
</macrodef>
-
-
+
+ <!-- Macro for building checksum files
+ This is only needed until the "format" option is supported
+ by ant's built in checksum task
+ -->
+ <macrodef name="lucene-checksum">
+ <attribute name="file"/>
+ <!-- NOTE: we use the value of @{file} in the names any properties
+ set because macro's don't have variables, and otherwise we
+ wouldn't be able to checksum more then one file per build
+ -->
+ <sequential>
+ <checksum file="@{file}"
+ property="@{file}.sum"
+ algorithm="${checksum.algorithm}" />
+ <basename file="@{file}" property="@{file}.base" />
+ <concat destfile="@{file}.${checksum.algorithm}"
+ force="yes"
+ append="false"
+ fixlastline="yes">
+ <header trimleading="yes">${@{file}.sum} </header>
+ <!-- empty fileset to trick concat -->
+ <fileset dir="." excludes="**" />
+ <footer trimleading="yes">${@{file}.base}
+ </footer>
+ </concat>
+ </sequential>
+ </macrodef>
</project>