~ubuntu-branches/ubuntu/trusty/libcommons-validator-java/trusty

« back to all changes in this revision

Viewing changes to build.xml

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2004-11-19 13:35:53 UTC
  • Revision ID: james.westby@ubuntu.com-20041119133553-qtl7whjkjv9q1rbd
Tags: upstream-1.3
ImportĀ upstreamĀ versionĀ 1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--
 
2
   Copyright 2003-2004 The Apache Software Foundation
 
3
 
 
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
 
7
 
 
8
       http://www.apache.org/licenses/LICENSE-2.0
 
9
 
 
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.
 
15
-->
 
16
<project name="Validator" default="dist" basedir=".">
 
17
 
 
18
 
 
19
<!--
 
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 $
 
22
-->
 
23
 
 
24
 
 
25
<!-- ========== Initialize Properties ===================================== -->
 
26
 
 
27
 
 
28
  <property file="build.properties"/>                <!-- Component local   -->
 
29
  <property file="../build.properties"/>             <!-- Commons local     -->
 
30
  <property file="${user.home}/build.properties"/>   <!-- User local        -->
 
31
 
 
32
 
 
33
<!-- ========== External Dependencies ===================================== -->
 
34
 
 
35
 
 
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"/>
 
44
 
 
45
 
 
46
<!-- ========== Derived Values ============================================ -->
 
47
 
 
48
 
 
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"/>
 
55
 
 
56
 
 
57
<!-- ========== Component Declarations ==================================== -->
 
58
 
 
59
 
 
60
  <!-- The name of this component -->
 
61
  <property name="component.name"          value="validator"/>
 
62
 
 
63
  <!-- The primary package name of this component -->
 
64
  <property name="component.package"       value="org.apache.commons.validator"/>
 
65
 
 
66
  <!-- The title of this component -->
 
67
  <property name="component.title"         value="Validator"/>
 
68
 
 
69
  <!-- The current version number of this component -->
 
70
  <property name="component.version"       value="1.1.3-dev"/>
 
71
 
 
72
  <!-- The base directory for compilation targets -->
 
73
  <property name="build.home"              value="target"/>
 
74
 
 
75
  <!-- The base directory for component configuration files -->
 
76
  <property name="conf.home"               value="conf/share"/>
 
77
 
 
78
  <!-- The base directory for distribution targets -->
 
79
  <property name="dist.home"               value="dist"/>
 
80
 
 
81
  <!-- The base directory for release targets -->
 
82
  <property name="release.home"            value="release" />
 
83
 
 
84
  <!-- The base directory for component sources -->
 
85
  <property name="source.home"             value="src/share"/>
 
86
 
 
87
  <!-- The base directory for javascript sources -->
 
88
  <property name="javascript.home"             value="src/javascript"/>
 
89
 
 
90
  <!-- The base directory for unit test sources -->
 
91
  <property name="test.home"               value="src/test"/>
 
92
 
 
93
  <!-- The base directory for example sources -->
 
94
  <property name="example.home"            value="src/example"/>
 
95
 
 
96
  <!-- Directory where binary release files are staged -->
 
97
  <property name="stage.bin.dir"           value="${release.home}/stage/bin"/>
 
98
 
 
99
  <!-- Directory where source release files are staged -->
 
100
  <property name="stage.src.dir"           value="${release.home}/stage/src"/>
 
101
 
 
102
  <!-- Directory where release builds are prepared for upload -->
 
103
  <property name="upload.dir"              value="${release.home}/upload"/>
 
104
 
 
105
  <!-- Base file name for upload files -->
 
106
  <property name="upload.file.base"        value="${component.name}-${component.version}"/>
 
107
 
 
108
 
 
109
<!-- ========== Compiler Defaults ========================================= -->
 
110
 
 
111
 
 
112
  <!-- Should Java compilations set the 'debug' compiler option? -->
 
113
  <property name="compile.debug"           value="true"/>
 
114
 
 
115
  <!-- Should Java compilations set the 'deprecation' compiler option? -->
 
116
  <property name="compile.deprecation"     value="false"/>
 
117
 
 
118
  <!-- Should Java compilations set the 'optimize' compiler option? -->
 
119
  <property name="compile.optimize"        value="true"/>
 
120
 
 
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}"/>
 
129
  </path>
 
130
 
 
131
 
 
132
<!-- ========== Test Execution Defaults =================================== -->
 
133
 
 
134
 
 
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}"/>
 
146
  </path>
 
147
 
 
148
  <!-- Should all tests fail if one does? -->
 
149
  <property name="test.failonerror"        value="true"/>
 
150
 
 
151
  <!-- The test runner to execute -->
 
152
  <property name="test.runner"             value="junit.textui.TestRunner"/>
 
153
 
 
154
 
 
155
<!-- ========== Example Execution Defaults ================================ -->
 
156
 
 
157
 
 
158
  <!-- Construct example classpath -->
 
159
   <path id="example.classpath">
 
160
      <path refid="test.classpath"/>
 
161
      <pathelement location="${build.home}/example" />
 
162
   </path>
 
163
   
 
164
 
 
165
<!-- ========== Executable Targets ======================================== -->
 
166
 
 
167
 
 
168
  <target name="init"
 
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}"/>
 
174
  </target>
 
175
 
 
176
 
 
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"/>
 
183
  </target>
 
184
 
 
185
 
 
186
  <target name="static" depends="prepare"
 
187
   description="Copy static files to build directory">
 
188
    <tstamp/>
 
189
    <copy  todir="${build.home}/conf" filtering="on">
 
190
      <fileset dir="${conf.home}" includes="*.MF"/>
 
191
    </copy>
 
192
  </target>
 
193
 
 
194
 
 
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"/>
 
203
    </javac>
 
204
    <copy    todir="${build.home}/classes" filtering="on">
 
205
      <fileset dir="${source.home}"
 
206
          excludes="**/*.java"/>
 
207
    </copy>
 
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}"
 
216
          includes="**/*.js"/>
 
217
    </copy>
 
218
  </target>
 
219
 
 
220
 
 
221
  <target name="clean"
 
222
   description="Clean build and distribution directories">
 
223
    <delete    dir="${build.home}"/>
 
224
    <delete    dir="${dist.home}"/>
 
225
    <delete    dir="${release.home}"/>
 
226
  </target>
 
227
 
 
228
 
 
229
  <target name="all" depends="clean,compile"
 
230
   description="Clean and compile all components"/>
 
231
 
 
232
 
 
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.*"
 
241
                 author="true"
 
242
                private="true"
 
243
                version="true"
 
244
               doctitle="&lt;h1&gt;${component.title} (Version ${component.version})&lt;/h1&gt;"
 
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 ' "/>
 
250
    </exec>
 
251
  </target>
 
252
  
 
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/"/>
 
259
    </style>
 
260
  </target>
 
261
 
 
262
 
 
263
 
 
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"/>
 
277
  </target>
 
278
 
 
279
 
 
280
<!-- ========== Unit Test Targets ========================================= -->
 
281
 
 
282
 
 
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"/>
 
291
    </javac>
 
292
    <copy    todir="${build.home}/tests" filtering="on">
 
293
      <fileset dir="${test.home}" excludes="**/*.java"/>
 
294
    </copy>
 
295
  </target>
 
296
 
 
297
 
 
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"/>
 
305
    </java>
 
306
  </target>
 
307
 
 
308
 
 
309
<!-- ========== Example Targets =========================================== -->
 
310
 
 
311
 
 
312
  <target name="prepare.example" depends="compile"
 
313
   description="Prepare example directory">
 
314
    <mkdir dir="${build.home}/example"/>
 
315
  </target>
 
316
 
 
317
 
 
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"/>
 
326
    </javac>
 
327
    <copy    todir="${build.home}/example" filtering="on">
 
328
      <fileset dir="${example.home}" excludes="**/*.java"/>
 
329
    </copy>
 
330
  </target>
 
331
 
 
332
 
 
333
   <target name="example" depends="compile.example"
 
334
    description="Run example application">
 
335
      <java fork="yes"
 
336
       classname="org.apache.commons.validator.example.ValidateExample" 
 
337
        taskname="main" failonerror="true">
 
338
        <classpath refid="example.classpath" />
 
339
      </java>
 
340
   </target>
 
341
 
 
342
 
 
343
<!-- ========== Release Targets =========================================== -->
 
344
 
 
345
 
 
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}"/>
 
352
        </copy>
 
353
        <copy todir="${stage.src.dir}/${upload.file.base}-src">
 
354
            <fileset dir=".">
 
355
                <exclude name="build.properties"/>
 
356
                <exclude name="target/**"/>
 
357
                <exclude name="dist/**"/>
 
358
                <exclude name="release/**"/>
 
359
            </fileset>
 
360
        </copy>
 
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}"
 
368
             longfile="gnu"/>
 
369
        <tar  tarfile="${upload.dir}/${upload.file.base}-src.tar"
 
370
              basedir="${stage.src.dir}"
 
371
             longfile="gnu"/>
 
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"/>
 
376
    </target>
 
377
 
 
378
      
 
379
</project>
 
380