/[pkg-java]/trunk/ant/build.xml
ViewVC logotype

Contents of /trunk/ant/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 125 - (show annotations) (download) (as text)
Sat Apr 12 14:17:16 2003 UTC (10 years, 1 month ago) by tora
File MIME type: text/xml
File size: 55361 byte(s)
new upstream.
use j2sdk1.4 by mpkg-j2sdk.
1 <?xml version="1.0"?>
2
3 <!--
4 =======================================================================
5 Apache Ant own build file
6
7 Copyright (c) 2000-2003 The Apache Software Foundation. All rights
8 reserved.
9
10 =======================================================================
11 -->
12 <project default="main" basedir=".">
13
14 <!-- Give user a chance to override without editing this file
15 (and without typing -D each time it compiles it) -->
16 <property file=".ant.properties"/>
17 <property file="${user.home}/.ant.properties"/>
18 <property environment="env"/>
19
20
21 <property name="Name" value="Apache Ant"/>
22 <property name="name" value="ant"/>
23 <property name="version" value="1.5.3"/>
24 <property name="manifest-version" value="1.5.3"/>
25
26 <property name="debug" value="true"/>
27 <property name="chmod.fail" value="true"/>
28 <property name="deprecation" value="false"/>
29 <property name="optimize" value="true"/>
30 <property name="javac.target" value="1.1"/>
31 <property name="build.compiler" value="jikes"/>
32 <property name="junit.fork" value="false"/>
33 <property name="junit.filtertrace" value="off"/>
34 <property name="junit.summary" value="no"/>
35
36 <!--
37 ===================================================================
38 Set the properties related to the source tree
39 ===================================================================
40 -->
41 <property name="src.dir" value="src"/>
42 <property name="java.dir" value="${src.dir}/main"/>
43 <property name="script.dir" value="${src.dir}/script"/>
44 <property name="lib.dir" value="lib"/>
45 <property name="docs.dir" value="docs"/>
46 <property name="etc.dir" value="src/etc"/>
47 <property name="tests.dir" value="src/testcases"/>
48 <property name="tests.etc.dir" value="src/etc/testcases"/>
49
50 <property name="ant.package" value="org/apache/tools/ant"/>
51 <property name="optional.package" value="${ant.package}/taskdefs/optional"/>
52 <property name="optional.type.package" value="${ant.package}/types/optional"/>
53 <property name="util.package" value="${ant.package}/util"/>
54 <property name="regexp.package" value="${util.package}/regexp"/>
55
56 <property name="manifest" value="src/etc/manifest"/>
57
58 <property name="unfiltered.files" value="**/*.gif,**/*.jpg,**/*.ico,**/*.pdf"/>
59
60
61 <!--
62 ===================================================================
63 Set the properties for the build area
64 ===================================================================
65 -->
66 <property name="build.dir" value="build"/>
67 <property name="bootstrap.dir" value="bootstrap"/>
68 <property name="build.classes" value="${build.dir}/classes"/>
69 <property name="build.lib" value="${build.dir}/lib"/>
70 <property name="build.javadocs" value="${build.dir}/javadocs"/>
71 <property name="build.tests" value="${build.dir}/testcases"/>
72 <property name="build.tests.javadocs" value="${build.dir}/javadocs.test/"/>
73
74 <path id="classpath">
75 </path>
76
77 <!-- empty for JDK 1.2+, contains classes.zip otherwise -->
78 <path id="classes.zip">
79 <fileset dir="${java.home}" includes="lib/classes.zip"/>
80 </path>
81
82 <path id="tests-classpath">
83 <pathelement location="${build.classes}"/>
84 <pathelement location="${build.tests}"/>
85 <!--
86 include the test source and test data dirs
87 so that we can pick resources via getResource(AsStream)
88 -->
89 <pathelement location="${tests.dir}"/>
90 <pathelement location="${tests.etc.dir}"/>
91 <path refid="classpath"/>
92 </path>
93 <!-- turn this path into a string which is passed to the tests -->
94 <property name="tests-classpath.value"
95 refid="tests-classpath"/>
96
97 <!--
98 ===================================================================
99 Set up properties for the distribution area
100 ===================================================================
101 -->
102 <property name="dist.name" value="apache-${name}-${version}"/>
103 <property name="dist.base" value="distribution"/>
104 <property name="dist.dir" value="dist"/>
105 <property name="dist.bin" value="${dist.dir}/bin"/>
106 <property name="dist.lib" value="${dist.dir}/lib"/>
107 <property name="dist.docs" value="${dist.dir}/docs"/>
108 <property name="dist.etc" value="${dist.dir}/etc"/>
109 <property name="dist.javadocs" value="${dist.dir}/docs/manual/api"/>
110
111 <property name="src.dist.dir" value="dist-src"/>
112 <property name="src.dist.src" value="${src.dist.dir}/src"/>
113 <property name="src.dist.docs" value="${src.dist.dir}/docs"/>
114 <property name="src.dist.lib" value="${src.dist.dir}/lib"/>
115
116
117
118 <!--
119 ===================================================================
120 Set up patternsets to be used by javac and junit to exclude
121 files that have dependencies that are not available
122 ===================================================================
123 -->
124 <!-- depends on JDK version -->
125 <patternset id="needs.jdk1.2+">
126 <exclude name="${optional.package}/extension/**/*.java"
127 unless="jdk1.2+"/>
128 <exclude name="${util.package}/optional/NoExitSecurityManager.java"
129 unless="jdk1.2+"/>
130 <exclude name="${optional.package}/Javah.java"
131 unless="jdk1.2+"/>
132 <exclude name="${optional.package}/metamata/*.java"
133 unless="jdk1.2+"/>
134 <exclude name="${optional.package}/ejb/EjbJar.java"
135 unless="jdk1.2+"/>
136 <exclude name="${optional.package}/ejb/*DeploymentTool.java"
137 unless="jdk1.2+"/>
138 <exclude name="${optional.package}/ejb/IPlanet*.java"
139 unless="jdk1.2+"/>
140 <exclude name="${optional.package}/ejb/Borland*.java"
141 unless="jdk1.2+"/>
142 <exclude name="${optional.package}/j2ee/*.java"
143 unless="jdk1.2+"/>
144 <!-- uses the context classloader -->
145 <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
146 unless="jdk1.2+"/>
147 <!-- use various 1.2 methods -->
148 <exclude name="${optional.package}/sitraka/**/*.java"
149 unless="jdk1.2+"/>
150 <exclude name="${optional.package}/ide/VAJ*.java"
151 unless="jdk1.2+"/>
152 <exclude name="${optional.package}/starteam/*.java"
153 unless="jdk1.2+"/>
154 </patternset>
155 <patternset id="needs.jdk1.3+">
156 <exclude name="${ant.package}/taskdefs/TestProcess.java"
157 unless="jdk1.3+"/>
158 </patternset>
159 <patternset id="needs.jdk1.4+">
160 <exclude name="${regexp.package}/Jdk14Regexp*.java"
161 unless="jdk1.4+"/>
162 </patternset>
163
164 <!-- classes that should be present in Sun based JVMs, but not in
165 Kaffe for example -->
166 <patternset id="needs.sun.tools">
167 <exclude name="${optional.package}/Native2Ascii.java"
168 unless="sun.tools.present"/>
169 <exclude name="${optional.package}/Javah.java"
170 unless="sun.tools.present"/>
171 </patternset>
172 <patternset id="needs.sun.uue">
173 <exclude name="${ant.package}/taskdefs/email/UUMailer.java"
174 unless="sunuue.present"/>
175 </patternset>
176 <patternset id="needs.sun.b64">
177 <exclude name="${optional.package}/splash/SplashTask.java"
178 unless="base64.present"/>
179 </patternset>
180
181 <!-- depends on external libraries -->
182 <patternset id="needs.trax">
183 <exclude name="${optional.package}/TraXLiaison*.java"
184 unless="trax.present"/>
185 <exclude name="${optional.package}/sitraka/**"
186 unless="trax.present"/>
187 <exclude name="${optional.package}/metamata/MMetrics*"
188 unless="trax.present"/>
189 <exclude name="${optional.package}/XsltTest.java"
190 unless="trax.present"/>
191 <exclude name="${ant.package}/types/XMLCatalogBuildFileTest.java"
192 unless="trax.present"/>
193 </patternset>
194 <patternset id="needs.xalan1">
195 <exclude name="${optional.package}/XalanLiaison*.java"
196 unless="xalan.present"/>
197 <exclude name="${optional.package}/junit/Xalan1Executor.java"
198 unless="xalan.present"/>
199 </patternset>
200 <patternset id="needs.xalan2">
201 <exclude name="${optional.package}/junit/Xalan2Executor.java"
202 unless="xalan2.present"/>
203 </patternset>
204 <patternset id="needs.xslp">
205 <exclude name="${optional.package}/XslpLiaison*.java"
206 unless="xslp.present"/>
207 </patternset>
208 <patternset id="needs.junit">
209 <exclude name="${optional.package}/junit/*.java" unless="junit.present"/>
210 </patternset>
211 <patternset id="needs.jakarta.regexp">
212 <exclude name="${regexp.package}/JakartaRegexp*.java"
213 unless="jakarta.regexp.present"/>
214 </patternset>
215 <patternset id="needs.jakarta.oro">
216 <exclude name="${regexp.package}/JakartaOro*.java"
217 unless="jakarta.oro.present"/>
218 <exclude name="${optional.package}/perforce/*.java"
219 unless="jakarta.oro.present"/>
220 <exclude name="${optional.package}/metamata/MAudit*.java"
221 unless="jakarta.oro.present"/>
222 </patternset>
223 <patternset id="needs.jakarta.bcel">
224 <exclude name="${ant.package}/filters/util/JavaClassHelper.java"
225 unless="bcel.present"/>
226 <exclude name="${util.package}/depend/bcel/*.java"
227 unless="bcel.present"/>
228 <exclude name="${optional.type.package}/depend/ClassFileSetTest.java"
229 unless="bcel.present"/>
230 </patternset>
231 <patternset id="needs.jakarta.log4j">
232 <exclude name="${ant.package}/listener/Log4jListener.java"
233 unless="log4j.present"/>
234 </patternset>
235 <patternset id="needs.commons.logging">
236 <exclude name="${ant.package}/listener/CommonsLoggingListener.java"
237 unless="commons.logging.present"/>
238 </patternset>
239 <patternset id="needs.bsf">
240 <exclude name="${optional.package}/Script.java"
241 unless="bsf.present"/>
242 </patternset>
243 <patternset id="needs.stylebook">
244 <exclude name="${optional.package}/StyleBook.java"
245 unless="stylebook.present"/>
246 </patternset>
247 <patternset id="needs.javamail">
248 <exclude name="${ant.package}/taskdefs/email/MimeMailer.java"
249 unless="javamail.complete"/>
250 </patternset>
251 <patternset id="needs.icontract">
252 <exclude name="${optional.package}/IContract.java"
253 unless="icontract.present"/>
254 </patternset>
255 <patternset id="needs.netrexx">
256 <exclude name="${optional.package}/NetRexxC.java"
257 unless="netrexx.present"/>
258 </patternset>
259 <patternset id="needs.weblogic.ejbc">
260 <exclude name="${optional.package}/ejb/Ejbc*.java"
261 unless="ejb.ejbc.present"/>
262 </patternset>
263 <patternset id="needs.weblogic.ddcreator">
264 <exclude name="${optional.package}/ejb/DDCreator*.java"
265 unless="ejb.DDCreator.present"/>
266 </patternset>
267 <patternset id="needs.weblogic.server">
268 <exclude name="${optional.package}/ejb/WLRun.java"
269 unless="ejb.wls.present"/>
270 <exclude name="${optional.package}/ejb/WLStop.java"
271 unless="ejb.wls.present"/>
272 </patternset>
273 <patternset id="needs.netcomponents">
274 <exclude name="${optional.package}/net/FTP.java"
275 unless="netcomp.present"/>
276 <exclude name="${optional.package}/net/TelnetTask.java"
277 unless="netcomp.present"/>
278 </patternset>
279 <patternset id="needs.starteam">
280 <exclude name="${optional.package}/scm/AntStarTeam*.java"
281 unless="starteam.present"/>
282 <exclude name="${optional.package}/starteam/*.java"
283 unless="starteam.present"/>
284 </patternset>
285 <patternset id="needs.vaj">
286 <exclude name="${optional.package}/ide/VAJ*.java"
287 unless="vaj.present"/>
288 </patternset>
289 <patternset id="needs.antlr">
290 <exclude name="${optional.package}/ANTLR*.java" unless="antlr.present"/>
291 </patternset>
292 <patternset id="needs.servletapi">
293 <exclude name="${optional.package}/ide/VAJ*Servlet.java"
294 unless="servlet.present"/>
295 </patternset>
296 <patternset id="needs.jmf">
297 <exclude name="${optional.package}/sound/*.java" unless="jmf.present"/>
298 </patternset>
299 <patternset id="needs.jdepend">
300 <exclude name="${optional.package}/jdepend/*" unless="jdepend.present"/>
301 </patternset>
302 <patternset id="onlinetests">
303 <exclude name="**/GetTest.java" if="offline"/>
304 </patternset>
305 <patternset id="needs.swing">
306 <exclude name="${optional.package}/splash/*.java" unless="swing.present"/>
307 </patternset>
308 <patternset id="teststhatfail">
309 </patternset>
310
311 <!--
312 ===================================================================
313 Set up a patternsets that matches the parts of our JUnit testsuite
314 that may be useful for task developers.
315 ===================================================================
316 -->
317 <patternset id="useful.tests">
318 <include name="${ant.package}/BuildFileTest*"/>
319 <include name="${regexp.package}/RegexpMatcherTest*"/>
320 <include name="${regexp.package}/RegexpTest*"/>
321 <include name="${optional.package}/AbstractXSLTLiaisonTest*"/>
322 <include name="${ant.package}/types/AbstractFileSetTest*"/>
323 </patternset>
324
325 <!--
326 ===================================================================
327 Set up a patternsets that matches the parts of our site that
328 should not be part of the distribution.
329 ===================================================================
330 -->
331 <patternset id="site.excludes">
332 <exclude name="bindownload.html"/>
333 <exclude name="srcdownload.html"/>
334 <exclude name="*.cgi"/>
335 </patternset>
336
337 <!--
338 ===================================================================
339 Check to see what optional dependencies are available
340 ===================================================================
341 -->
342 <target name="check_for_optional_packages">
343 <available property="jdk1.2+" classname="java.lang.ThreadLocal"/>
344 <available property="jdk1.3+" classname="java.lang.StrictMath"/>
345 <available property="jdk1.4+" classname="java.lang.CharSequence"/>
346 <available property="kaffe" classname="kaffe.util.NotImplemented"/>
347 <available property="bsf.present"
348 classname="com.ibm.bsf.BSFManager"
349 classpathref="classpath"/>
350 <condition property="netrexx.present">
351 <and>
352 <isset property="jdk1.2+"/>
353 <available classname="netrexx.lang.Rexx"
354 classpathref="classpath"/>
355 </and>
356 </condition>
357 <available property="trax.present"
358 classname="javax.xml.transform.Transformer"
359 classpathref="classpath"/>
360 <condition property="trax.impl.present">
361 <or>
362 <and>
363 <isset property="javax.xml.transform.TransformerFactory"/>
364 <available classname="${javax.xml.transform.TransformerFactory}"
365 classpathref="classpath"/>
366 </and>
367 <available resource="META-INF/services/javax.xml.transform.TransformerFactory"/>
368 </or>
369 </condition>
370 <available property="xslp.present"
371 classname="com.kvisco.xsl.XSLProcessor"
372 classpathref="classpath"/>
373 <available property="xalan.present"
374 classname="org.apache.xalan.xslt.XSLTProcessorFactory"
375 classpathref="classpath"/>
376 <available property="xalan2.present"
377 classname="org.apache.xalan.transformer.TransformerImpl"
378 classpathref="classpath"/>
379 <available property="ejb.ejbc.present"
380 classname="weblogic.ejbc"
381 classpathref="classpath"/>
382 <available property="ejb.DDCreator.present"
383 classname="weblogic.ejb.utils.DDCreator"
384 classpathref="classpath"/>
385 <available property="ejb.wls.present"
386 classname="weblogic.Server"
387 classpathref="classpath"/>
388 <available property="junit.present"
389 classname="junit.framework.TestCase"
390 classpathref="classpath"/>
391 <available property="netcomp.present"
392 classname="com.oroinc.net.ftp.FTPClient"
393 classpathref="classpath"/>
394 <available property="starteam.present"
395 classname="com.starbase.util.Platform"
396 classpathref="classpath"/>
397 <available property="antlr.present"
398 classname="antlr.Tool"
399 classpathref="classpath"/>
400 <available property="vaj.present"
401 classname="com.ibm.ivj.util.base.Workspace"
402 classpathref="classpath"/>
403 <available property="stylebook.present"
404 classname="org.apache.stylebook.Engine"
405 classpathref="classpath"/>
406 <available property="jakarta.regexp.present"
407 classname="org.apache.regexp.RE"
408 classpathref="classpath"/>
409 <available property="jakarta.oro.present"
410 classname="org.apache.oro.text.regex.Perl5Matcher"
411 classpathref="classpath"/>
412 <available property="jmf.present"
413 classname="javax.sound.sampled.Clip"
414 classpathref="classpath"/>
415 <condition property="icontract.present">
416 <and>
417 <isset property="jdk1.2+"/>
418 <available classname="com.reliablesystems.iContract.IContracted"
419 classpathref="classpath"/>
420 </and>
421 </condition>
422 <available property="jdepend.present"
423 classname="jdepend.framework.JDepend"
424 classpathref="classpath"/>
425 <available property="log4j.present"
426 classname="org.apache.log4j.Category"
427 classpathref="classpath"/>
428 <available property="commons.logging.present"
429 classname="org.apache.commons.logging.LogFactory"
430 classpathref="classpath"/>
431 <available property="xalan.envcheck"
432 classname="org.apache.xalan.xslt.EnvironmentCheck"
433 classpathref="classpath"/>
434 <available property="which.present"
435 classname="org.apache.env.Which"
436 classpathref="classpath"/>
437
438 <available property="servlet.present"
439 classname="javax.servlet.Servlet"
440 classpathref="classpath"/>
441
442 <available property="xerces.present"
443 classname="org.apache.xerces.parsers.SAXParser"
444 classpathref="classpath"/>
445 <condition property="bcel.present">
446 <and>
447 <isset property="jdk1.2+"/>
448 <available classname="org.apache.bcel.Constants"
449 classpathref="classpath"/>
450 </and>
451 </condition>
452 <available property="sunuue.present"
453 classname="sun.misc.UUEncoder"
454 classpathref="classpath"/>
455
456 <condition property="javamail.complete">
457 <and>
458 <available classname="javax.activation.DataHandler"
459 classpathref="classpath"/>
460 <available classname="javax.mail.Transport"
461 classpathref="classpath"/>
462 </and>
463 </condition>
464
465 <condition property="some.regexp.support">
466 <or>
467 <isset property="jdk1.4+"/>
468 <isset property="jakarta.regexp.present"/>
469 <isset property="jakarta.oro.present"/>
470 </or>
471 </condition>
472
473 <condition property="tests.and.ant.share.classloader">
474 <or>
475 <equals arg1="${junit.fork}" arg2="true"/>
476 <equals arg1="${build.sysclasspath}" arg2="only"/>
477 </or>
478 </condition>
479
480 <condition property="sun.tools.present">
481 <and>
482 <available classname="sun.tools.native2ascii.Main"/>
483 <available classname="com.sun.tools.javah.Main"/>
484 </and>
485 </condition>
486
487 <available property="base64.present" classname="sun.misc.BASE64Encoder"/>
488
489 <property name="build.tests.resolved" location="${build.tests}"/>
490 <condition property="tests.are.on.system.classpath">
491 <or>
492 <!-- relative paths in CLASSPATH -->
493 <contains string="${java.class.path}"
494 substring="${build.tests}"/>
495 <!-- absolute paths in CLASSPATH -->
496 <contains string="${java.class.path}"
497 substring="${build.tests.resolved}"/>
498 </or>
499 </condition>
500
501 <condition property="jasper.present">
502 <and>
503 <available classname="org.apache.jasper.compiler.Compiler"/>
504 <available classname="org.apache.jasper.JasperException"/>
505 </and>
506 </condition>
507
508 <condition property="swing.present">
509 <or>
510 <and>
511 <isset property="jdk1.2+"/>
512 <not>
513 <isset property="kaffe"/>
514 </not>
515 </and>
516 <available classname="javax.swing.ImageIcon"
517 classpathref="classpath"/>
518 </or>
519 </condition>
520
521 <condition property="wsdl.found">
522 <or>
523 <available file="wsdl" filepath="${env.PATH}"/>
524 <available file="wsdl.exe" filepath="${env.PATH}"/>
525 <available file="wsdl.exe" filepath="${env.Path}"/>
526 </or>
527 </condition>
528 <echo level="verbose"> wsdl.found=${wsdl.found}</echo>
529 <condition property="csc.found">
530 <or>
531 <available file="csc" filepath="${env.PATH}"/>
532 <available file="csc.exe" filepath="${env.PATH}"/>
533 <available file="csc.exe" filepath="${env.Path}"/>
534 </or>
535 </condition>
536 <echo level="verbose"> csc.found=${csc.found}</echo>
537 <condition property="dotnetapps.found">
538 <and>
539 <isset property="csc.found"/>
540 <isset property="wsdl.found"/>
541 </and>
542 </condition>
543 <echo level="verbose"> csc.found=${csc.found}</echo>
544
545 <available property="rhino.present"
546 classname="org.mozilla.javascript.Scriptable"
547 classpathref="classpath"/>
548 <available property="beanshell.present"
549 classname="bsh.StringUtil"
550 classpathref="classpath"/>
551 </target>
552
553
554 <!--
555 ===================================================================
556 Prepare the build
557 ===================================================================
558 -->
559 <target name="prepare">
560 <tstamp>
561 <format property="year" pattern="yyyy"/>
562 </tstamp>
563 <filterchain id="ant.filters">
564 <replacetokens>
565 <token key="VERSION" value="${version}"/>
566 <token key="DATE" value="${TODAY}"/>
567 <token key="TIME" value="${TSTAMP}"/>
568 </replacetokens>
569 </filterchain>
570 </target>
571
572 <!--
573 ===================================================================
574 Build the code
575 ===================================================================
576 -->
577 <target name="build"
578 depends="prepare, check_for_optional_packages"
579 description="--> compiles the source code">
580 <mkdir dir="${build.dir}"/>
581 <mkdir dir="${build.classes}"/>
582 <mkdir dir="${build.lib}"/>
583
584 <javac srcdir="${java.dir}"
585 destdir="${build.classes}"
586 debug="${debug}"
587 deprecation="${deprecation}"
588 target="${javac.target}"
589 optimize="${optimize}" >
590 <classpath refid="classpath"/>
591
592 <patternset refid="needs.jdk1.2+"/>
593 <patternset refid="needs.jdk1.3+"/>
594 <patternset refid="needs.jdk1.4+"/>
595
596 <patternset refid="needs.jakarta.regexp"/>
597 <patternset refid="needs.jakarta.oro"/>
598 <patternset refid="needs.jakarta.log4j"/>
599 <patternset refid="needs.commons.logging"/>
600 <patternset refid="needs.sun.uue"/>
601 <patternset refid="needs.javamail"/>
602 <patternset refid="needs.icontract"/>
603 <patternset refid="needs.bsf"/>
604 <patternset refid="needs.stylebook"/>
605 <patternset refid="needs.netrexx"/>
606 <patternset refid="needs.trax"/>
607 <patternset refid="needs.xslp"/>
608 <patternset refid="needs.xalan1"/>
609 <patternset refid="needs.weblogic.ejbc"/>
610 <patternset refid="needs.weblogic.ddcreator"/>
611 <patternset refid="needs.weblogic.server"/>
612 <patternset refid="needs.junit"/>
613 <patternset refid="needs.netcomponents"/>
614 <patternset refid="needs.starteam"/>
615 <patternset refid="needs.antlr"/>
616 <patternset refid="needs.vaj"/>
617 <patternset refid="needs.servletapi"/>
618 <patternset refid="needs.jmf"/>
619 <patternset refid="needs.xalan2"/>
620 <patternset refid="needs.jdepend"/>
621 <patternset refid="needs.sun.tools"/>
622 <patternset refid="needs.sun.b64"/>
623 <patternset refid="needs.jakarta.bcel"/>
624 <patternset refid="needs.swing"/>
625 </javac>
626
627 <copy todir="${build.classes}">
628 <fileset dir="${java.dir}">
629 <include name="**/*.properties"/>
630 <include name="**/*.dtd"/>
631 </fileset>
632 </copy>
633
634 <copy todir="${build.classes}"
635 overwrite="true" encoding="UTF-8">
636 <fileset dir="${java.dir}">
637 <include name="**/version.txt"/>
638 <include name="**/defaultManifest.mf"/>
639 </fileset>
640 <filterchain refid="ant.filters"/>
641 </copy>
642
643 <copy todir="${build.classes}/${optional.package}/junit/xsl">
644 <fileset dir="${etc.dir}">
645 <include name="junit-frames.xsl"/>
646 <include name="junit-noframes.xsl"/>
647 </fileset>
648 </copy>
649
650 </target>
651
652 <!--
653 ===================================================================
654 Create the Apache Ant jars: ant.jar and optional.jar
655 ===================================================================
656 -->
657 <target name="jars"
658 depends="build"
659 description="--> creates the Apache Ant jars">
660
661 <copy todir="${build.dir}">
662 <fileset dir=".">
663 <include name="LICENSE"/>
664 <include name="LICENSE.xerces"/>
665 <include name="LICENSE.dom"/>
666 <include name="LICENSE.sax"/>
667 </fileset>
668 <mapper type="glob" from="*" to="*.txt"/>
669 </copy>
670
671 <jar destfile="${build.lib}/${name}.jar"
672 basedir="${build.classes}"
673 manifest="${manifest}">
674 <exclude name="${optional.package}/**"/>
675 <exclude name="${optional.type.package}/**"/>
676 <exclude name="${util.package}/depend/**"/>
677 <exclude name="${util.package}/optional/**"/>
678 <exclude name="${util.package}/regexp/Jakarta*"/>
679 <exclude name="${util.package}/regexp/Jdk*"/>
680 <exclude name="${ant.package}/listener/Log4jListener.class"/>
681 <exclude name="${ant.package}/listener/CommonsLoggingListener.class"/>
682 <exclude name="${ant.package}/taskdefs/email/UUMailer.class"/>
683 <exclude name="${ant.package}/taskdefs/email/MimeMailer.class"/>
684 <metainf dir="${build.dir}" includes="LICENSE.txt"/>
685
686 <manifest>
687 <section name="${ant.package}/">
688 <attribute name="Extension-name"
689 value="org.apache.tools.ant"/>
690 <attribute name="Specification-Title"
691 value="Apache Ant"/>
692 <attribute name="Specification-Version"
693 value="${manifest-version}"/>
694 <attribute name="Specification-Vendor"
695 value="Apache Software Foundation"/>
696 <attribute name="Implementation-Title"
697 value="org.apache.tools.ant"/>
698 <attribute name="Implementation-Version"
699 value="${manifest-version}"/>
700 <attribute name="Implementation-Vendor"
701 value="Apache Software Foundation"/>
702 </section>
703 </manifest>
704
705 <fileset dir="${docs.dir}">
706 <include name="images/ant_logo_large.gif"/>
707 </fileset>
708 </jar>
709
710 <jar destfile="${build.lib}/optional.jar"
711 basedir="${build.classes}"
712 manifest="${manifest}">
713 <include name="${optional.package}/**"/>
714 <include name="${optional.type.package}/**"/>
715 <include name="${util.package}/depend/**"/>
716 <include name="${util.package}/optional/**"/>
717 <include name="${util.package}/regexp/Jakarta*"/>
718 <include name="${util.package}/regexp/Jdk*"/>
719 <include name="${ant.package}/listener/Log4jListener.class"/>
720 <include name="${ant.package}/listener/CommonsLoggingListener.class"/>
721 <include name="${ant.package}/taskdefs/email/UUMailer.class"/>
722 <include name="${ant.package}/taskdefs/email/MimeMailer.class"/>
723 <metainf dir="${build.dir}" includes="LICENSE.txt"/>
724
725 <manifest>
726 <section name="${optional.package}/">
727 <attribute name="Extension-name"
728 value="org.apache.tools.ant.taskdefs.optional"/>
729 <attribute name="Specification-Title"
730 value="Apache Ant Optional Tasks"/>
731 <attribute name="Specification-Version"
732 value="${manifest-version}"/>
733 <attribute name="Specification-Vendor"
734 value="Apache Software Foundation"/>
735 <attribute name="Implementation-Title"
736 value="org.apache.tools.ant.taskdefs.optional"/>
737 <attribute name="Implementation-Version"
738 value="${manifest-version}"/>
739 <attribute name="Implementation-Vendor"
740 value="Apache Software Foundation"/>
741 </section>
742 </manifest>
743 </jar>
744
745 </target>
746
747 <!-- Creates jar of test utility classes -->
748 <target name="test-jar"
749 depends="compile-tests"
750 description="--> creates the Apache Ant Test Utilties jar">
751
752 <jar destfile="${build.lib}/${name}-testutil.jar"
753 basedir="${build.tests}">
754 <patternset refid="useful.tests"/>
755 </jar>
756 </target>
757
758 <!--
759 ===================================================================
760 Create the essential distribution that can run Apache Ant
761 ===================================================================
762 -->
763 <target name="dist-lite"
764 depends="jars"
765 description="--> creates a minimum distribution to run Apache Ant">
766
767 <mkdir dir="${dist.dir}"/>
768 <mkdir dir="${dist.bin}"/>
769 <mkdir dir="${dist.lib}"/>
770
771 <copy todir="${dist.lib}">
772 <fileset dir="${build.lib}"/>
773 </copy>
774
775 <copy todir="${dist.bin}">
776 <fileset dir="${script.dir}/"/>
777 </copy>
778
779 <fixcrlf srcdir="${dist.bin}" eol="crlf" includes="*.bat"/>
780 <fixcrlf srcdir="${dist.bin}" eol="lf">
781 <include name="ant"/>
782 <include name="antRun"/>
783 <include name="*.pl"/>
784 </fixcrlf>
785
786 <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
787 failonerror="${chmod.fail}"/>
788 <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
789 failonerror="${chmod.fail}"/>
790 <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
791 <fileset dir="${dist.bin}">
792 <include name="**/ant"/>
793 <include name="**/antRun"/>
794 <include name="**/*.pl"/>
795 <include name="**/*.py"/>
796 </fileset>
797 </chmod>
798
799 </target>
800
801 <!--
802 ===================================================================
803 Create the complete distribution
804 ===================================================================
805 -->
806 <target name="dist" description="--> creates a complete distribution">
807 <antcall inheritAll="false" target="internal_dist">
808 <param name="dist.dir" value="${dist.name}"/>
809 </antcall>
810 </target>
811
812 <target name="dist_javadocs" depends="javadocs">
813 <mkdir dir="${dist.javadocs}"/>
814 <copy todir="${dist.javadocs}" overwrite="true">
815 <fileset dir="${build.javadocs}"/>
816 </copy>
817 </target>
818
819
820 <target name="internal_dist" depends="dist-lite,dist_javadocs">
821 <mkdir dir="${dist.docs}"/>
822 <mkdir dir="${dist.etc}"/>
823
824 <copy todir="${dist.lib}">
825 <fileset dir="${lib.dir}">
826 <include name="*.jar"/>
827 <include name="*.zip"/>
828 </fileset>
829 </copy>
830
831 <copy todir="${dist.lib}" file="${lib.dir}/README"/>
832
833 <copy todir="${dist.docs}">
834 <fileset dir="${docs.dir}" excludes="${unfiltered.files}">
835 <patternset refid="site.excludes"/>
836 </fileset>
837 <filterchain refid="ant.filters"/>
838 </copy>
839
840 <copy todir="${dist.docs}" filtering="false">
841 <fileset dir="${docs.dir}" includes="${unfiltered.files}">
842 <patternset refid="site.excludes"/>
843 </fileset>
844 </copy>
845
846 <copy todir="${dist.dir}">
847 <fileset dir=".">
848 <include name="README"/>
849 <include name="LICENSE"/>
850 <include name="LICENSE.xerces"/>
851 <include name="LICENSE.dom"/>
852 <include name="LICENSE.sax"/>
853 <include name="TODO"/>
854 <include name="WHATSNEW"/>
855 <include name="KEYS"/>
856 <include name="welcome.html"/>
857 </fileset>
858 </copy>
859
860 <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
861 failonerror="${chmod.fail}"/>
862 <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
863 failonerror="${chmod.fail}"/>
864 <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
865 <fileset dir="${dist.bin}">
866 <include name="**/ant"/>
867 <include name="**/antRun"/>
868 <include name="**/*.pl"/>
869 <include name="**/*.py"/>
870 </fileset>
871 </chmod>
872
873 <!-- publish some useful stylesheets -->
874 <copy todir="${dist.etc}">
875 <fileset dir="${etc.dir}">
876 <include name="junit-frames.xsl"/>
877 <include name="junit-noframes.xsl"/>
878 <include name="coverage-frames.xsl"/>
879 <include name="maudit-frames.xsl"/>
880 <include name="mmetrics-frames.xsl"/>
881 <include name="changelog.xsl"/>
882 <include name="jdepend.xsl"/>
883 <include name="jdepend-frames.xsl"/>
884 <include name="checkstyle-frames.xsl"/>
885 <include name="log.xsl"/>
886 <include name="tagdiff.xsl"/>
887 </fileset>
888 </copy>
889
890 </target>
891
892
893 <!--
894 ===================================================================
895 Target to create bootstrap build
896 ===================================================================
897 -->
898 <target name="bootstrap" description="--> creates a bootstrap build">
899 <antcall inheritAll="false" target="dist-lite">
900 <param name="dist.dir" value="${bootstrap.dir}"/>
901 </antcall>
902 </target>
903
904
905 <!--
906 ===================================================================
907 Create the source distribution
908 ===================================================================
909 -->
910 <target name="src-dist"
911 description="--> creates a source distribution">
912
913 <mkdir dir="${src.dist.dir}"/>
914
915 <copy todir="${src.dist.lib}">
916 <fileset dir="${lib.dir}">
917 <include name="*.jar"/>
918 <include name="*.zip"/>
919 <include name="README"/>
920 </fileset>
921 </copy>
922
923 <copy todir="${src.dist.src}">
924 <fileset dir="${src.dir}"/>
925 </copy>
926
927 <copy todir="${src.dist.docs}">
928 <fileset dir="${docs.dir}">
929 <exclude name="manual/api/**"/>
930 <patternset refid="site.excludes"/>
931 </fileset>
932 </copy>
933
934 <copy todir="${src.dist.dir}">
935 <fileset dir=".">
936 <include name="README"/>
937 <include name="LICENSE"/>
938 <include name="LICENSE.xerces"/>
939 <include name="LICENSE.dom"/>
940 <include name="LICENSE.sax"/>
941 <include name="TODO"/>
942 <include name="WHATSNEW"/>
943 <include name="KEYS"/>
944 <include name="build.bat"/>
945 <include name="build.sh"/>
946 <include name="bootstrap.bat"/>
947 <include name="bootstrap.sh"/>
948 <include name="build.xml"/>
949 <include name="welcome.html"/>
950 </fileset>
951 </copy>
952
953 <fixcrlf srcdir="${src.dist.dir}" eol="crlf" includes="*.bat"/>
954 <fixcrlf srcdir="${src.dist.dir}" eol="lf">
955 <include name="**/*.sh"/>
956 <include name="**/*.pl"/>
957 <include name="**/ant"/>
958 <include name="**/antRun"/>
959 </fixcrlf>
960 <fixcrlf srcdir="${src.dist.dir}">
961 <include name="**/*.java"/>
962 <exclude name="src/etc/testcases/taskdefs/fixcrlf/expected/Junk?.java"/>
963 <exclude name="src/etc/testcases/taskdefs/fixcrlf/input/Junk?.java"/>
964 </fixcrlf>
965
966 <chmod perm="ugo+x" dir="${src.dist.dir}" type="dir"
967 failonerror="${chmod.fail}"/>
968 <chmod perm="ugo+r" dir="${src.dist.dir}" failonerror="${chmod.fail}"/>
969 <chmod perm="ugo+x" failonerror="${chmod.fail}">
970 <fileset dir="${src.dist.dir}">
971 <include name="**/.sh"/>
972 <include name="**/.pl"/>
973 <include name="**/.py"/>
974 <include name="**/ant"/>
975 <include name="**/antRun"/>
976 </fileset>
977 </chmod>
978
979 </target>
980
981 <!--
982 ===================================================================
983 Create the binary distribution
984 ===================================================================
985 -->
986 <target name="main_distribution"
987 description="--> creates the zip and tar distributions">
988 <delete dir="${dist.name}"/>
989 <mkdir dir="${dist.base}"/>
990 <mkdir dir="${dist.base}/src"/>
991 <mkdir dir="${dist.base}/bin"/>
992
993 <antcall inheritAll="false" target="internal_dist">
994 <param name="dist.dir" value="${dist.name}"/>
995 </antcall>
996 <zip destfile="${dist.base}/bin/${dist.name}-bin.zip">
997 <zipfileset dir="${dist.name}/.." filemode="755">
998 <include name="${dist.name}/bin/ant"/>
999 <include name="${dist.name}/bin/antRun"/>
1000 <include name="${dist.name}/bin/*.pl"/>
1001 <include name="${dist.name}/bin/*.py"/>
1002 </zipfileset>
1003 <fileset dir="${dist.name}/..">
1004 <include name="${dist.name}/**"/>
1005 <exclude name="${dist.name}/bin/ant"/>
1006 <exclude name="${dist.name}/bin/antRun"/>
1007 <exclude name="${dist.name}/bin/*.pl"/>
1008 <exclude name="${dist.name}/bin/*.py"/>
1009 </fileset>
1010 </zip>
1011 <tar longfile="gnu"
1012 destfile="${dist.base}/bin/${dist.name}-bin.tar">
1013 <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
1014 <include name="${dist.name}/bin/ant"/>
1015 <include name="${dist.name}/bin/antRun"/>
1016 <include name="${dist.name}/bin/*.pl"/>
1017 <include name="${dist.name}/bin/*.py"/>
1018 </tarfileset>
1019 <tarfileset dir="${dist.name}/.." username="ant" group="ant">
1020 <include name="${dist.name}/**"/>
1021 <exclude name="${dist.name}/bin/ant"/>
1022 <exclude name="${dist.name}/bin/antRun"/>
1023 <exclude name="${dist.name}/bin/*.pl"/>
1024 <exclude name="${dist.name}/bin/*.py"/>
1025 </tarfileset>
1026 </tar>
1027 <gzip zipfile="${dist.base}/bin/${dist.name}-bin.tar.gz"
1028 src="${dist.base}/bin/${dist.name}-bin.tar"/>
1029 <bzip2 zipfile="${dist.base}/bin/${dist.name}-bin.tar.bz2"
1030 src="${dist.base}/bin/${dist.name}-bin.tar"/>
1031 <delete file="${dist.base}/bin/${dist.name}-bin.tar"/>
1032 <delete dir="${dist.name}"/>
1033 <checksum fileext=".md5">
1034 <fileset dir="${dist.base}/bin/">
1035 <include name="**/*"/>
1036 <exclude name="**/*.asc"/>
1037 <exclude name="**/*.md5"/>
1038 </fileset>
1039 </checksum>
1040
1041 <antcall inheritAll="false" target="src-dist">
1042 <param name="src.dist.dir" value="${dist.name}"/>
1043 </antcall>
1044 <zip destfile="${dist.base}/src/${dist.name}-src.zip">
1045 <zipfileset dir="${dist.name}/.." filemode="755">
1046 <include name="${dist.name}/bootstrap.sh"/>
1047 <include name="${dist.name}/build.sh"/>
1048 </zipfileset>
1049 <fileset dir="${dist.name}/..">
1050 <include name="${dist.name}/**"/>
1051 <exclude name="${dist.name}/bootstrap.sh"/>
1052 <exclude name="${dist.name}/build.sh"/>
1053 </fileset>
1054 </zip>
1055 <tar longfile="gnu"
1056 destfile="${dist.base}/src/${dist.name}-src.tar" >
1057 <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
1058 <include name="${dist.name}/bootstrap.sh"/>
1059 <include name="${dist.name}/build.sh"/>
1060 </tarfileset>
1061 <tarfileset dir="${dist.name}/.." username="ant" group="ant">
1062 <include name="${dist.name}/**"/>
1063 <exclude name="${dist.name}/bootstrap.sh"/>
1064 <exclude name="${dist.name}/build.sh"/>
1065 </tarfileset>
1066 </tar>
1067 <gzip zipfile="${dist.base}/src/${dist.name}-src.tar.gz"
1068 src="${dist.base}/src/${dist.name}-src.tar"/>
1069 <bzip2 zipfile="${dist.base}/src/${dist.name}-src.tar.bz2"
1070 src="${dist.base}/src/${dist.name}-src.tar"/>
1071 <delete file="${dist.base}/src/${dist.name}-src.tar"/>
1072 <delete dir="${dist.name}"/>
1073 <checksum fileext=".md5">
1074 <fileset dir="${dist.base}/src/">
1075 <include name="**/*"/>
1076 <exclude name="**/*.asc"/>
1077 <exclude name="**/*.md5"/>
1078 </fileset>
1079 </checksum>
1080 </target>
1081
1082 <target name="distribution" depends="main_distribution"
1083 description="--> creates the full Apache Ant distribution">
1084 </target>
1085
1086
1087 <!--
1088 ===================================================================
1089 Cleans up build and distribution directories
1090 ===================================================================
1091 -->
1092 <target name="clean"
1093 description="--> cleans up build and dist directories">
1094 <delete dir="${build.dir}"/>
1095 <delete dir="${dist.base}"/>
1096 <delete dir="${dist.dir}"/>
1097 <delete>
1098 <fileset dir="." includes="**/*~" defaultexcludes="no"/>
1099 </delete>
1100 </target>
1101
1102 <!--
1103 ===================================================================
1104 Cleans everything
1105 ===================================================================
1106 -->
1107 <target name="allclean"
1108 depends="clean"
1109 description="--> cleans up everything">
1110 <delete file="${bootstrap.dir}/bin/antRun"/>
1111 <delete file="${bootstrap.dir}/bin/antRun.bat"/>
1112 <delete file="${bootstrap.dir}/bin/*.pl"/>
1113 <delete file="${bootstrap.dir}/bin/*.py"/>
1114 </target>
1115
1116 <!--
1117 ===================================================================
1118 Installs Apache Ant
1119 ===================================================================
1120 -->
1121 <target name="install" if="ant.install">
1122 <antcall inheritAll="false" target="internal_dist">
1123 <param name="dist.dir" value="${ant.install}"/>
1124 </antcall>
1125 </target>
1126
1127 <target name="install-lite" if="ant.install">
1128 <antcall inheritAll="false" target="dist-lite">
1129 <param name="dist.dir" value="${ant.install}"/>
1130 </antcall>
1131 </target>
1132
1133 <!--
1134 ===================================================================
1135 Creates the API documentation
1136 ===================================================================
1137 -->
1138 <target name="javadoc_check">
1139 <uptodate property="javadoc.notrequired"
1140 targetfile="${build.javadocs}/packages.html" >
1141 <srcfiles dir= "${java.dir}" includes="**/*.java"/>
1142 </uptodate>
1143 <uptodate property="tests.javadoc.notrequired"
1144 targetfile="${build.tests.javadocs}/packages.html" >
1145 <srcfiles dir= "${tests.dir}">
1146 <patternset refid="useful.tests"/>
1147 </srcfiles>
1148 </uptodate>
1149 </target>
1150
1151 <target name="javadocs" depends="prepare, javadoc_check"
1152 unless="javadoc.notrequired"
1153 description="--> creates the API documentation">
1154 <mkdir dir="${build.javadocs}"/>
1155 <javadoc useexternalfile="yes"
1156 destdir="${build.javadocs}"
1157 author="true"
1158 version="true"
1159 locale="en"
1160 windowtitle="${Name} API"
1161 doctitle="${Name}">
1162
1163 <packageset dir="${java.dir}"/>
1164
1165 <tag name="todo" description="To do:" scope="all"/>
1166 <tag name="ant.task" enabled="false" description="Task:" scope="types"/>
1167 <tag name="ant.datatype" enabled="false" description="Data type:" scope="types"/>
1168 <group title="Apache Ant Core" packages="org.apache.tools.ant*"/>
1169 <group title="Core Tasks" packages="org.apache.tools.ant.taskdefs*"/>
1170 <group title="Core Types" packages="org.apache.tools.ant.types*"/>
1171 <group title="Optional Tasks" packages="org.apache.tools.ant.taskdefs.optional*"/>
1172 <group title="Optional Types" packages="org.apache.tools.ant.types.optional*"/>
1173 <group title="Ant Utilities" packages="org.apache.tools.ant.util*"/>
1174
1175 <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
1176 </javadoc>
1177 </target>
1178
1179 <target name="test-javadocs" depends="prepare, javadoc_check"
1180 unless="tests.javadoc.notrequired"
1181 description="--> creates the API documentation for test utilities">
1182 <mkdir dir="${build.tests.javadocs}"/>
1183 <javadoc useexternalfile="yes"
1184 destdir="${build.tests.javadocs}"
1185 author="true"
1186 version="true"
1187 locale="en"
1188 windowtitle="${Name} Test Utilities"
1189 doctitle="${Name}">
1190
1191 <fileset dir="${tests.dir}">
1192 <patternset refid="useful.tests"/>
1193 </fileset>
1194
1195 <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
1196 </javadoc>
1197 </target>
1198
1199 <!--
1200 ===================================================================
1201 Compile testcases
1202 ===================================================================
1203 -->
1204 <target name="compile-tests" depends="build" if="junit.present">
1205 <mkdir dir="${build.tests}"/>
1206
1207 <javac srcdir="${tests.dir}"
1208 destdir="${build.tests}"
1209 debug="${debug}"
1210 target="${javac.target}"
1211 deprecation="${deprecation}" >
1212 <classpath refid="tests-classpath"/>
1213
1214 <patternset refid="needs.antlr"/>
1215
1216 <patternset refid="needs.jdk1.2+"/>
1217 <patternset refid="needs.jdk1.3+"/>
1218 <patternset refid="needs.jdk1.4+"/>
1219
1220 <patternset refid="needs.jakarta.regexp"/>
1221 <patternset refid="needs.jakarta.oro"/>
1222
1223 <patternset refid="needs.swing"/>
1224 <patternset refid="needs.trax"/>
1225 <patternset refid="needs.xslp"/>
1226 <patternset refid="needs.xalan1"/>
1227 <patternset refid="needs.jakarta.bcel"/>
1228 </javac>
1229 </target>
1230
1231 <target name="dump-info" depends="dump-sys-properties,run-which"/>
1232
1233 <target name="dump-sys-properties" unless="which.present"
1234 depends="xml-check">
1235 <echo message="java.vm.info=${java.vm.info}"/>
1236 <echo message="java.vm.name=${java.vm.name}"/>
1237 <echo message="java.vm.vendor=${java.vm.vendor}"/>
1238 <echo message="java.vm.version=${java.vm.version}"/>
1239 <echo message="os.arch=${os.arch}"/>
1240 <echo message="os.name=${os.name}"/>
1241 <echo message="os.version=${os.version}"/>
1242 <echo message="file.encoding=${file.encoding}"/>
1243 <echo message="user.language=${user.language}"/>
1244 </target>
1245
1246 <!-- helper class from Xalan2 to check for jar versioning of xml/xsl processors -->
1247 <target name="xml-check" depends="check_for_optional_packages"
1248 if="xalan.envcheck" unless="which.present">
1249 <java classname="org.apache.xalan.xslt.EnvironmentCheck"/>
1250 </target>
1251
1252 <target name="run-which" depends="check_for_optional_packages"
1253 if="which.present">
1254 <java classname="org.apache.env.Which" taskname="which"/>
1255 </target>
1256
1257 <!-- test to see if we are online or not. can take a while when we are off line, so
1258 setting the property is a good shortcut-->
1259 <target name="probe-offline">
1260 <condition property="offline">
1261 <or>
1262 <isset property="offline"/>
1263 <not>
1264 <http url="http://www.apache.org/"/>
1265 </not>
1266 </or>
1267 </condition>
1268 <echo level="verbose" > offline=${offline}</echo>
1269 </target>
1270
1271 <!--
1272 ===================================================================
1273 Run testcase
1274 ===================================================================
1275 -->
1276 <target name="test" depends="run-tests" description="--> run JUnit tests"/>
1277
1278 <target name="run-tests" depends="dump-info,compile-tests,probe-offline" if="junit.present">
1279
1280 <condition property="run.junitreport">
1281 <or>
1282 <isset property="xalan2.present"/>
1283 <and>
1284 <isset property="xalan.present"/>
1285 <isset property="bsf.present"/>
1286 </and>
1287 </or>
1288 </condition>
1289
1290 <junit printsummary="${junit.summary}" haltonfailure="yes"
1291 filtertrace="${junit.filtertrace}"
1292 fork="${junit.fork}">
1293 <!-- <jvmarg value="-classic"/> -->
1294 <classpath refid="tests-classpath"/>
1295 <classpath refid="classes.zip"/>
1296
1297 <sysproperty key="ant.home" value="${ant.home}"/>
1298 <sysproperty key="build.tests" value="${build.tests}"/>
1299 <sysproperty key="tests-classpath.value"
1300 value="${tests-classpath.value}"/>
1301
1302 <formatter type="brief" usefile="false"/>
1303
1304 <batchtest>
1305 <fileset dir="${tests.dir}">
1306 <include name="**/*Test*"/>
1307
1308 <!-- abstract classes, not testcases -->
1309 <exclude name="${ant.package}/taskdefs/TaskdefsTest.java"/>
1310 <exclude name="${ant.package}/BuildFileTest.java"/>
1311 <exclude name="${regexp.package}/RegexpMatcherTest.java"/>
1312 <exclude name="${regexp.package}/RegexpTest.java"/>
1313 <exclude name="${optional.package}/AbstractXSLTLiaisonTest.java"/>
1314 <exclude name="${ant.package}/types/AbstractFileSetTest.java"/>
1315 <exclude name="${ant.package}/types/selectors/BaseSelectorTest.java"/>
1316
1317 <!-- helper classes, not testcases -->
1318 <exclude name="org/example/**"/>
1319 <exclude name="${ant.package}/taskdefs/TaskdefTest*Task.java"/>
1320
1321 <!-- interactive tests -->
1322 <exclude name="${ant.package}/taskdefs/TestProcess.java"/>
1323 <exclude name="${optional.package}/splash/SplashScreenTest.java"/>
1324
1325 <!-- only run these tests if their required libraries are
1326 installed -->
1327 <patternset refid="needs.jdk1.2+"/>
1328 <patternset refid="needs.jdk1.4+"/>
1329 <patternset refid="needs.jakarta.regexp"/>
1330 <patternset refid="needs.jakarta.oro"/>
1331 <patternset refid="needs.vaj"/>
1332 <patternset refid="needs.antlr"/>
1333 <patternset refid="needs.xalan1"/>
1334 <patternset refid="needs.xslp"/>
1335 <patternset refid="needs.jakarta.bcel"/>
1336 <patternset refid="needs.trax"/>
1337 <!-- fails under 1.1 -->
1338 <exclude name="${optional.package}/perforce/P4ChangeTest.java"
1339 unless="jdk1.2+"/>
1340
1341 <!-- tests excluded if the test is run in offline mode -->
1342 <patternset refid="onlinetests"/>
1343
1344 <!-- failing tests excluded unless run.failing.tests is set -->
1345 <patternset refid="teststhatfail"/>
1346
1347 <!-- runtime dependencies that are different from compile
1348 time dependencies -->
1349 <exclude name="${optional.package}/ReplaceRegExpTest.java"
1350 unless="some.regexp.support"/>
1351 <exclude name="${optional.package}/sitraka/*.java"
1352 unless="some.regexp.support"/>
1353 <exclude name="${optional.package}/RhinoScriptTest.java"
1354 unless="bsf.present"/>
1355 <exclude name="${optional.package}/RhinoScriptTest.java"
1356 unless="rhino.present"/>
1357 <exclude name="${optional.package}/BeanShellScriptTest.java"
1358 unless="bsf.present"/>
1359 <exclude name="${optional.package}/BeanShellScriptTest.java"
1360 unless="beanshell.present"/>
1361
1362 <!-- fail if testcases can be loaded from the system classloader -->
1363 <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
1364 if="tests.are.on.system.classpath"/>
1365 <exclude name="${optional.package}/sitraka/XMLReportTest.java"
1366 if="tests.are.on.system.classpath"/>
1367
1368 <!-- these tests need to be localised before being ran???? -->
1369 <exclude name="${optional.package}/PvcsTest.java"/>
1370
1371 <!-- These tests need a TraX implementation like xalan2 or saxon -->
1372 <exclude name="${optional.package}/TraXLiaisonTest.java"
1373 unless="trax.impl.present"/>
1374 <exclude name="${optional.package}/XsltTest.java"
1375 unless="trax.impl.present"/>
1376 <exclude name="${ant.package}/types/XMLCatalogBuildFileTest.java"
1377 unless="trax.impl.present"/>
1378 <exclude name="${optional.package}/junit/JUnitReportTest.java"
1379 unless="run.junitreport"/>
1380
1381 <!-- needs BSF to work -->
1382 <exclude name="${optional.package}/XalanLiaisonTest.java"
1383 unless="bsf.present"/>
1384
1385 <!--
1386 XXX need to figure out what's causing this InvocationTargetException
1387 -->
1388 <exclude name="${optional.package}/junit/JUnitTestRunnerTest.java"
1389 unless="jdk1.2+"/>
1390 <!-- DateTime handling seems to be broken in JDK 1.1 -->
1391 <exclude name="${util.package}/DateUtilsTest.java"
1392 unless="jdk1.2+"/>
1393
1394 <exclude name="${optional.package}/JspcTest.java"/>
1395 <!-- misc oneoff tests -->
1396 <exclude name="${optional.package}/WsdlToDotnetTest.java"
1397 unless="dotnetapps.found"/>
1398
1399 <!-- These tests only passes if testcases and Ant classes have
1400 been loaded by the same classloader - will throw
1401 IllegalAccessExceptions otherwise. -->
1402 <exclude name="${ant.package}/taskdefs/SQLExecTest.java"
1403 unless="tests.and.ant.share.classloader"/>
1404 <exclude name="${optional.package}/sos/SOSTest.java"
1405 unless="tests.and.ant.share.classloader"/>
1406 <exclude name="${optional.package}/TraXLiaisonTest.java"
1407 unless="tests.and.ant.share.classloader"/>
1408 <exclude name="${optional.package}/metamata/MAuditParserTest.java"
1409 unless="tests.and.ant.share.classloader"/>
1410
1411 <!-- can only run if cvs is installed on your machine
1412 enable by setting the property have.cvs
1413 -->
1414 <exclude name="${ant.package}/taskdefs/AbstractCvsTaskTest.java"
1415 unless="have.cvs"/>
1416
1417 </fileset>
1418 </batchtest>
1419 <test name="org.apache.tools.ant.taskdefs.optional.JspcTest"
1420 if="jasper.present"/>
1421 </junit>
1422 </target>
1423
1424 <target name="run-single-test" if="testcase" depends="compile-tests"
1425 description="--> runs the single unit test defined in the testcase property">
1426
1427
1428 <junit printsummary="${junit.summary}"
1429 haltonfailure="yes"
1430 fork="${junit.fork}"
1431 filtertrace="${junit.filtertrace}">
1432 <!-- <jvmarg value="-classic"/> -->
1433 <sysproperty key="ant.home" value="${ant.home}"/>
1434 <sysproperty key="build.tests" value="${build.tests}"/>
1435 <sysproperty key="tests-classpath.value"
1436 value="${tests-classpath.value}"/>
1437 <classpath refid="classes.zip"/>
1438 <classpath refid="tests-classpath"/>
1439 <formatter type="plain" usefile="false"/>
1440 <test name="${testcase}"/>
1441 </junit>
1442 </target>
1443
1444 <target name="interactive-tests" description="--> runs interactive tests"
1445 depends="compile-tests"
1446 if="jdk1.3+">
1447 <java classpathref="tests-classpath"
1448 classname="org.apache.tools.ant.taskdefs.TestProcess"
1449 fork="true"/>
1450 </target>
1451
1452 <!--
1453 ===================================================================
1454 Main target - runs dist-lite by default
1455 ===================================================================
1456 -->
1457 <target name="main"
1458 description="--> creates a minimum distribution in ./dist"
1459 depends="dist-lite"/>
1460
1461 </project>

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.5