source: release-kits/shared/apache-ant-1.6.5/build.xml@ 15024

Last change on this file since 15024 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

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