Skip to content

Commit 5027151

Browse files
committed
Added an Ant target to zip/tar/gzip/checksum a distribution.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/codec/trunk@130257 13f79535-47bb-0310-9956-ffa450edef68
1 parent 9d632c2 commit 5027151

3 files changed

Lines changed: 65 additions & 2 deletions

File tree

.cvsignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ velocity.log
66
.clover
77
.classpath
88
.project
9+
pub

build.xml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<project name="Codec" default="compile" basedir=".">
22
<!--
33
"Codec" component of the Jakarta Commons Subproject
4-
$Id: build.xml,v 1.10 2003/11/13 06:37:19 ggregory Exp $
4+
$Id: build.xml,v 1.11 2003/11/14 01:43:38 ggregory Exp $
55
-->
66
<!-- ========== Initialize Properties ===================================== -->
77
<property file="${user.home}/${component.name}.build.properties"/>
@@ -49,6 +49,7 @@
4949
<target name="clean" description="Clean build and distribution directories">
5050
<delete dir="${build.home}"/>
5151
<delete dir="${dist.home}"/>
52+
<delete dir="${pub.home}"/>
5253
</target>
5354
<target name="all" depends="clean,compile" description="Clean and compile all components"/>
5455
<target name="javadoc" depends="compile" description="Create component Javadoc documentation">
@@ -91,6 +92,64 @@
9192
</fileset>
9293
</copy>
9394
</target>
95+
<target name="pub-bin" depends="dist" description="Create binary distribution (compressed) ready for publication">
96+
<mkdir dir="${pub.home}"/>
97+
<!-- Binary properties -->
98+
<property name="final.path" value="${pub.home}/${final.name}"/>
99+
<property name="zip.path" value="${final.path}.zip"/>
100+
<property name="tar.path" value="${final.path}.tar"/>
101+
<property name="gz.path" value="${tar.path}.gz"/>
102+
<!-- Zip binary dist -->
103+
<zip destfile="${zip.path}">
104+
<zipfileset dir="${dist.home}" prefix="${final.name}/"/>
105+
</zip>
106+
<checksum algorithm="md5" file="${zip.path}" fileext=".md5"/>
107+
<checksum algorithm="sha" file="${zip.path}" fileext=".sha"/>
108+
<!-- Tar & gzip binary dist -->
109+
<tar tarfile="${tar.path}" basedir="${dist.home}"/>
110+
<gzip zipfile="${gz.path}" src="${tar.path}"/>
111+
<checksum algorithm="md5" file="${gz.path}" fileext=".md5"/>
112+
<checksum algorithm="sha" file="${gz.path}" fileext=".sha"/>
113+
<delete file="${tar.path}"/>
114+
<!-- Delete old signatures -->
115+
<delete file="${zip.path}.asc"/>
116+
<delete file="${gz.path}.asc"/>
117+
</target>
118+
<target name="pub-src" depends="dist" description="Create source distribution (compressed) ready for publication based on your LOCAL CVS sources">
119+
<mkdir dir="${pub.home}"/>
120+
<echo>Warning: The source files used to create this source distribution come from your local copy of the source files.</echo>
121+
<!-- Source properties -->
122+
<property name="final-src.path" value="${pub.home}/${final.name}-src"/>
123+
<property name="zip-src.path" value="${final-src.path}.zip"/>
124+
<property name="tar-src.path" value="${final-src.path}.tar"/>
125+
<property name="gz-src.path" value="${tar-src.path}.gz"/>
126+
<property name="excludes" value="${pub.home}/**, ${dist.home}/**, target/**, xdocs/**"/>
127+
<!-- Zip source dist -->
128+
<zip destfile="${zip-src.path}">
129+
<zipfileset dir="src" prefix="${final.name}/src/"/>
130+
<zipfileset dir="." includes="build.xml" prefix="${final.name}/"/>
131+
<zipfileset dir="." includes="checkstyle.xml" prefix="${final.name}/"/>
132+
<zipfileset dir="." includes="default.properties" prefix="${final.name}/"/>
133+
<zipfileset dir="." includes="LICENSE.TXT" prefix="${final.name}/"/>
134+
<zipfileset dir="." includes="maven.xml" prefix="${final.name}/"/>
135+
<zipfileset dir="." includes="project.properties" prefix="${final.name}/"/>
136+
<zipfileset dir="." includes="project.xml" prefix="${final.name}/"/>
137+
<zipfileset dir="." includes="RELEASE-NOTES.txt" prefix="${final.name}/"/>
138+
</zip>
139+
<checksum algorithm="md5" file="${zip-src.path}" fileext=".md5"/>
140+
<checksum algorithm="sha" file="${zip-src.path}" fileext=".sha"/>
141+
<!-- Tar & gzip source dist -->
142+
<tar tarfile="${tar-src.path}" basedir="." excludes="${excludes}" excludesfile=".cvsignore"/>
143+
<gzip zipfile="${gz-src.path}" src="${tar-src.path}"/>
144+
<checksum algorithm="md5" file="${gz-src.path}" fileext=".md5"/>
145+
<checksum algorithm="sha" file="${gz-src.path}" fileext=".sha"/>
146+
<delete file="${tar-src.path}"/>
147+
<!-- Delete old signatures -->
148+
<delete file="${zip-src.path}.asc"/>
149+
<delete file="${gz-src.path}.asc"/>
150+
</target>
151+
<target name="pub" depends="pub-bin, pub-src" description="Create binary and source distribution (compressed) ready for publication">
152+
</target>
94153
<!-- ========== Unit Test Targets ========================================= -->
95154
<target name="compile.tests" depends="compile" description="Compile unit test cases">
96155
<javac srcdir="${test.home}" destdir="${build.home}/tests" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}">

default.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: default.properties,v 1.6 2003/11/08 01:52:25 ggregory Exp $
1+
#$Id: default.properties,v 1.7 2003/11/14 01:43:38 ggregory Exp $
22

33
# The pathname of the "junit.jar" JAR file
44
junit.jar = ${junit.home}/junit-3.7.jar
@@ -27,6 +27,9 @@ conf.home = src/conf
2727
# The base directory for distribution targets
2828
dist.home = dist
2929

30+
# The base directory for distribution targets to published in compressed format
31+
pub.home = pub
32+
3033
# The base directory for component sources
3134
source.home = src/java
3235

0 commit comments

Comments
 (0)