2
Copyright 2003-2004 The Apache Software Foundation
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
8
http://www.apache.org/licenses/LICENSE-2.0
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
16
<project name="Validator" default="dist" basedir=".">
20
"Validator" component of the Jakarta Commons Subproject
21
$Id: build.xml,v 1.32.2.1 2004/04/13 05:52:15 rleland Exp $
25
<!-- ========== Initialize Properties ===================================== -->
28
<property file="build.properties"/> <!-- Component local -->
29
<property file="../build.properties"/> <!-- Commons local -->
30
<property file="${user.home}/build.properties"/> <!-- User local -->
33
<!-- ========== External Dependencies ===================================== -->
36
<!-- The directories corresponding to your necessary dependencies -->
37
<property name="junit.home" value="/usr/local/junit3.8.1"/>
38
<property name="commons.home" value="../../jakarta-commons"/>
39
<property name="sandbox.home" value="../../jakarta-commons-sandbox"/>
40
<property name="beanutils.home" value="${commons.home}/beanutils"/>
41
<property name="collections.home" value="${commons.home}/collections"/>
42
<property name="digester.home" value="${commons.home}/digester"/>
43
<property name="logging.home" value="${commons.home}/logging"/>
46
<!-- ========== Derived Values ============================================ -->
49
<!-- The locations of necessary jar files -->
50
<property name="junit.jar" value="${junit.home}/junit.jar"/>
51
<property name="commons-beanutils.jar" value="${beanutils.home}/dist/commons-beanutils.jar"/>
52
<property name="commons-collections.jar" value="${collections.home}/dist/commons-collections.jar"/>
53
<property name="commons-digester.jar" value="${digester.home}/dist/commons-digester.jar"/>
54
<property name="commons-logging.jar" value="${logging.home}/dist/commons-logging.jar"/>
57
<!-- ========== Component Declarations ==================================== -->
60
<!-- The name of this component -->
61
<property name="component.name" value="validator"/>
63
<!-- The primary package name of this component -->
64
<property name="component.package" value="org.apache.commons.validator"/>
66
<!-- The title of this component -->
67
<property name="component.title" value="Validator"/>
69
<!-- The current version number of this component -->
70
<property name="component.version" value="1.1.3-dev"/>
72
<!-- The base directory for compilation targets -->
73
<property name="build.home" value="target"/>
75
<!-- The base directory for component configuration files -->
76
<property name="conf.home" value="conf/share"/>
78
<!-- The base directory for distribution targets -->
79
<property name="dist.home" value="dist"/>
81
<!-- The base directory for release targets -->
82
<property name="release.home" value="release" />
84
<!-- The base directory for component sources -->
85
<property name="source.home" value="src/share"/>
87
<!-- The base directory for javascript sources -->
88
<property name="javascript.home" value="src/javascript"/>
90
<!-- The base directory for unit test sources -->
91
<property name="test.home" value="src/test"/>
93
<!-- The base directory for example sources -->
94
<property name="example.home" value="src/example"/>
96
<!-- Directory where binary release files are staged -->
97
<property name="stage.bin.dir" value="${release.home}/stage/bin"/>
99
<!-- Directory where source release files are staged -->
100
<property name="stage.src.dir" value="${release.home}/stage/src"/>
102
<!-- Directory where release builds are prepared for upload -->
103
<property name="upload.dir" value="${release.home}/upload"/>
105
<!-- Base file name for upload files -->
106
<property name="upload.file.base" value="${component.name}-${component.version}"/>
109
<!-- ========== Compiler Defaults ========================================= -->
112
<!-- Should Java compilations set the 'debug' compiler option? -->
113
<property name="compile.debug" value="true"/>
115
<!-- Should Java compilations set the 'deprecation' compiler option? -->
116
<property name="compile.deprecation" value="false"/>
118
<!-- Should Java compilations set the 'optimize' compiler option? -->
119
<property name="compile.optimize" value="true"/>
121
<!-- Construct compile classpath -->
122
<path id="compile.classpath">
123
<pathelement location="${build.home}/classes"/>
124
<pathelement location="${commons-beanutils.jar}"/>
125
<pathelement location="${commons-collections.jar}"/>
126
<pathelement location="${commons-digester.jar}"/>
127
<pathelement location="${commons-logging.jar}"/>
128
<pathelement location="${oro.jar}"/>
132
<!-- ========== Test Execution Defaults =================================== -->
135
<!-- Construct unit test classpath -->
136
<path id="test.classpath">
137
<pathelement location="${build.home}/classes"/>
138
<pathelement location="${build.home}/tests"/>
139
<pathelement location="${commons-beanutils.jar}"/>
140
<pathelement location="${commons-collections.jar}"/>
141
<pathelement location="${commons-digester.jar}"/>
142
<pathelement location="${commons-logging.jar}"/>
143
<pathelement location="${oro.jar}"/>
144
<pathelement location="${junit.jar}"/>
145
<pathelement location="${xerces.jar}"/>
148
<!-- Should all tests fail if one does? -->
149
<property name="test.failonerror" value="true"/>
151
<!-- The test runner to execute -->
152
<property name="test.runner" value="junit.textui.TestRunner"/>
155
<!-- ========== Example Execution Defaults ================================ -->
158
<!-- Construct example classpath -->
159
<path id="example.classpath">
160
<path refid="test.classpath"/>
161
<pathelement location="${build.home}/example" />
165
<!-- ========== Executable Targets ======================================== -->
169
description="Initialize and evaluate conditionals">
170
<echo message="-------- ${component.name} ${component.version} --------"/>
171
<filter token="name" value="${component.name}"/>
172
<filter token="package" value="${component.package}"/>
173
<filter token="version" value="${component.version}"/>
177
<target name="prepare" depends="init"
178
description="Prepare build directory">
179
<mkdir dir="${build.home}"/>
180
<mkdir dir="${build.home}/classes"/>
181
<mkdir dir="${build.home}/conf"/>
182
<mkdir dir="${build.home}/tests"/>
186
<target name="static" depends="prepare"
187
description="Copy static files to build directory">
189
<copy todir="${build.home}/conf" filtering="on">
190
<fileset dir="${conf.home}" includes="*.MF"/>
195
<target name="compile" depends="static"
196
description="Compile shareable components">
197
<javac srcdir="${source.home}"
198
destdir="${build.home}/classes"
199
debug="${compile.debug}"
200
deprecation="${compile.deprecation}"
201
optimize="${compile.optimize}">
202
<classpath refid="compile.classpath"/>
204
<copy todir="${build.home}/classes" filtering="on">
205
<fileset dir="${source.home}"
206
excludes="**/*.java"/>
208
<copy todir="${build.home}/classes/org/apache/commons/validator/resources/"
209
file="${conf.home}/validator_1_0.dtd"/>
210
<copy todir="${build.home}/classes/org/apache/commons/validator/resources/"
211
file="${conf.home}/validator_1_0_1.dtd"/>
212
<copy todir="${build.home}/classes/org/apache/commons/validator/resources/"
213
file="${conf.home}/validator_1_1.dtd"/>
214
<copy todir="${build.home}/classes/">
215
<fileset dir="${javascript.home}"
222
description="Clean build and distribution directories">
223
<delete dir="${build.home}"/>
224
<delete dir="${dist.home}"/>
225
<delete dir="${release.home}"/>
229
<target name="all" depends="clean,compile"
230
description="Clean and compile all components"/>
233
<target name="javadoc" depends="compile"
234
description="Create component Javadoc documentation">
235
<mkdir dir="${dist.home}"/>
236
<mkdir dir="${dist.home}/docs"/>
237
<mkdir dir="${dist.home}/docs/api"/>
238
<javadoc sourcepath="${source.home}"
239
destdir="${dist.home}/docs/api"
240
packagenames="org.apache.commons.*"
244
doctitle="<h1>${component.title} (Version ${component.version})</h1>"
245
windowtitle="${component.title} (Version ${component.version})"
246
bottom="Copyright (c) 2001-2004 Apache Software Foundation"
247
classpathref="compile.classpath" />
248
<exec executable="bash" failifexecutionfails="false">
249
<arg line="-c 'etc/jsdoc.sh ${jsdoc.home} ${javascript.home} ${dist.home}/docs/api ' "/>
253
<target name="change-log" >
254
<cvschangelog destfile="changelog.xml" start="${cvs.start}" />
255
<style in="changelog.xml" out="changelog.html" style="${ant.home}/etc/changelog.xsl">
256
<param name="title" expression="Validator ChangeLog"/>
257
<param name="module" expression="commons"/>
258
<param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/>
264
<target name="dist" depends="compile,javadoc"
265
description="Create binary distribution">
266
<mkdir dir="${dist.home}"/>
267
<copy file="LICENSE.txt"
268
todir="${dist.home}"/>
269
<copy file="RELEASE-NOTES.readme"
270
todir="${dist.home}"/>
271
<mkdir dir="${build.home}/classes/META-INF"/>
272
<copy file="LICENSE.txt"
273
tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
274
<jar jarfile="${dist.home}/commons-${component.name}.jar"
275
basedir="${build.home}/classes"
276
manifest="${build.home}/conf/MANIFEST.MF"/>
280
<!-- ========== Unit Test Targets ========================================= -->
283
<target name="compile.tests" depends="compile"
284
description="Compile unit test cases">
285
<javac srcdir="${test.home}"
286
destdir="${build.home}/tests"
287
debug="${compile.debug}"
288
deprecation="${compile.deprecation}"
289
optimize="${compile.optimize}">
290
<classpath refid="test.classpath"/>
292
<copy todir="${build.home}/tests" filtering="on">
293
<fileset dir="${test.home}" excludes="**/*.java"/>
298
<target name="test" depends="compile.tests"
299
description="Run all unit test cases">
300
<echo message="Running tests ..."/>
301
<java classname="${test.runner}" fork="yes"
302
failonerror="${test.failonerror}">
303
<arg value="org.apache.commons.validator.ValidatorTestSuite"/>
304
<classpath refid="test.classpath"/>
309
<!-- ========== Example Targets =========================================== -->
312
<target name="prepare.example" depends="compile"
313
description="Prepare example directory">
314
<mkdir dir="${build.home}/example"/>
318
<target name="compile.example" depends="prepare.example"
319
description="Compile example application">
320
<javac srcdir="${example.home}"
321
destdir="${build.home}/example"
322
debug="${compile.debug}"
323
deprecation="${compile.deprecation}"
324
optimize="${compile.optimize}">
325
<classpath refid="example.classpath"/>
327
<copy todir="${build.home}/example" filtering="on">
328
<fileset dir="${example.home}" excludes="**/*.java"/>
333
<target name="example" depends="compile.example"
334
description="Run example application">
336
classname="org.apache.commons.validator.example.ValidateExample"
337
taskname="main" failonerror="true">
338
<classpath refid="example.classpath" />
343
<!-- ========== Release Targets =========================================== -->
346
<target name="release" depends="clean,dist"
347
description="Construct release distribution">
348
<mkdir dir="${stage.bin.dir}/${upload.file.base}"/>
349
<mkdir dir="${stage.src.dir}/${upload.file.base}-src"/>
350
<copy todir="${stage.bin.dir}/${upload.file.base}">
351
<fileset dir="${dist.home}"/>
353
<copy todir="${stage.src.dir}/${upload.file.base}-src">
355
<exclude name="build.properties"/>
356
<exclude name="target/**"/>
357
<exclude name="dist/**"/>
358
<exclude name="release/**"/>
361
<mkdir dir="${upload.dir}"/>
362
<zip zipfile="${upload.dir}/${upload.file.base}.zip"
363
basedir="${stage.bin.dir}"/>
364
<zip zipfile="${upload.dir}/${upload.file.base}-src.zip"
365
basedir="${stage.src.dir}"/>
366
<tar tarfile="${upload.dir}/${upload.file.base}.tar"
367
basedir="${stage.bin.dir}"
369
<tar tarfile="${upload.dir}/${upload.file.base}-src.tar"
370
basedir="${stage.src.dir}"
372
<gzip src="${upload.dir}/${upload.file.base}.tar"
373
zipfile="${upload.dir}/${upload.file.base}.tar.gz"/>
374
<gzip src="${upload.dir}/${upload.file.base}-src.tar"
375
zipfile="${upload.dir}/${upload.file.base}-src.tar.gz"/>