From 5337488612953eb072e38cb99e6b5d60999297da Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Tue, 13 Feb 2001 12:32:01 +0000 Subject: [PATCH] Merge of 1.3 branch changes into the main branch git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268652 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 33 +- bootstrap.bat | 4 +- bootstrap.sh | 4 +- build.xml | 26 +- docs/ant_in_anger.html | 44 +- docs/ejb.html | 514 -- docs/frames-index.html | 12 - docs/frames-toc.html | 32 - docs/index.html | 6774 ----------------- docs/manual/CoreTasks/ant.html | 69 + docs/manual/CoreTasks/antcall.html | 49 + docs/manual/CoreTasks/antstructure.html | 43 + docs/manual/CoreTasks/apply.html | 131 + docs/manual/CoreTasks/available.html | 91 + docs/manual/CoreTasks/chmod.html | 122 + docs/manual/CoreTasks/copy.html | 121 + docs/manual/CoreTasks/copydir.html | 120 + docs/manual/CoreTasks/copyfile.html | 59 + docs/manual/CoreTasks/cvs.html | 97 + docs/manual/CoreTasks/delete.html | 110 + docs/manual/CoreTasks/deltree.html | 40 + docs/manual/CoreTasks/echo.html | 51 + docs/manual/CoreTasks/exec.html | 144 + docs/manual/CoreTasks/execon.html | 138 + docs/manual/CoreTasks/fail.html | 50 + docs/manual/CoreTasks/filter.html | 63 + docs/manual/CoreTasks/fixcrlf.html | 168 + docs/manual/CoreTasks/genkey.html | 103 + docs/manual/CoreTasks/get.html | 77 + docs/manual/CoreTasks/gunzip.html | 59 + docs/manual/CoreTasks/gzip.html | 42 + docs/manual/CoreTasks/jar.html | 150 + docs/manual/CoreTasks/java.html | 135 + docs/manual/CoreTasks/javac.html | 250 + docs/manual/CoreTasks/javadoc.html | 464 ++ docs/manual/CoreTasks/mail.html | 64 + docs/manual/CoreTasks/mkdir.html | 38 + docs/manual/CoreTasks/move.html | 117 + docs/manual/CoreTasks/patch.html | 77 + docs/manual/CoreTasks/property.html | 129 + docs/manual/CoreTasks/rename.html | 49 + docs/manual/CoreTasks/replace.html | 164 + docs/manual/CoreTasks/rmic.html | 158 + docs/manual/CoreTasks/signjar.html | 91 + docs/{ => manual/CoreTasks}/sql.html | 101 +- docs/manual/CoreTasks/style.html | 152 + docs/manual/CoreTasks/tar.html | 168 + docs/manual/CoreTasks/taskdef.html | 56 + docs/manual/CoreTasks/touch.html | 57 + docs/manual/CoreTasks/tstamp.html | 75 + docs/manual/CoreTasks/untar.html | 52 + docs/manual/CoreTasks/unzip.html | 45 + docs/manual/CoreTasks/uptodate.html | 62 + docs/manual/CoreTasks/war.html | 149 + docs/manual/CoreTasks/zip.html | 161 + docs/manual/CoreTypes/fileset.html | 92 + docs/manual/CoreTypes/mapper.html | 335 + docs/manual/CoreTypes/patternset.html | 84 + docs/manual/Integration/Antidote.html | 253 + docs/{ => manual/Integration}/VAJAntTool.html | 18 +- docs/{ => manual/Integration}/anttool1.gif | Bin docs/{ => manual/Integration}/toolmenu.gif | Bin docs/manual/LICENSE | 48 + docs/{ => manual/OptionalTasks}/antlr.html | 10 +- docs/manual/OptionalTasks/cab.html | 130 + .../{ => manual/OptionalTasks}/clearcase.html | 61 +- docs/manual/OptionalTasks/depend.html | 163 + docs/{ => manual/OptionalTasks}/dotnet.html | 274 +- docs/manual/OptionalTasks/ejb.html | 857 +++ docs/manual/OptionalTasks/ftp.html | 224 + docs/{ => manual/OptionalTasks}/javacc.html | 10 +- docs/manual/OptionalTasks/jjtree.html | 178 + docs/{ => manual/OptionalTasks}/jlink.html | 4 +- docs/{ => manual/OptionalTasks}/junit.html | 41 +- docs/manual/OptionalTasks/junitreport.html | 118 + docs/manual/OptionalTasks/mparse.html | 83 + .../OptionalTasks}/native2ascii.html | 10 +- docs/manual/OptionalTasks/netrexxc.html | 277 + docs/{ => manual/OptionalTasks}/perforce.html | 43 +- .../OptionalTasks}/propertyfile.html | 100 +- .../OptionalTasks/renameextensions.html | 108 + docs/manual/OptionalTasks/script.html | 121 + docs/manual/OptionalTasks/sound.html | 95 + docs/manual/OptionalTasks/stylebook.html | 63 + docs/manual/OptionalTasks/telnet.html | 100 + docs/manual/OptionalTasks/test.html | 72 + docs/manual/OptionalTasks/vssget.html | 91 + docs/manual/coretasklist.html | 70 + docs/manual/credits.html | 45 + docs/manual/develop.html | 204 + docs/manual/dirtasks.html | 168 + docs/manual/feedback.html | 31 + docs/manual/ide.html | 23 + docs/manual/index.html | 17 + docs/manual/install.html | 378 + docs/manual/intro.html | 54 + docs/manual/optionaltasklist.html | 40 + docs/manual/resources.html | 25 + docs/manual/toc.html | 26 + docs/manual/using.html | 468 ++ lib/optional/README | 17 +- .../org/apache/tools/ant/DefaultLogger.java | 12 +- .../apache/tools/ant/taskdefs/Available.java | 19 +- .../apache/tools/ant/taskdefs/Execute.java | 6 + .../apache/tools/ant/taskdefs/Javadoc.java | 30 +- .../org/apache/tools/ant/taskdefs/Tar.java | 12 +- .../ant/taskdefs/optional/depend/Depend.java | 2 +- .../optional/ejb/EJBDeploymentTool.java | 2 - .../ant/taskdefs/optional/ejb/EjbJar.java | 9 +- .../optional/ejb/GenericDeploymentTool.java | 22 +- .../ant/taskdefs/optional/ejb/WLStop.java | 20 +- .../optional/ejb/WeblogicDeploymentTool.java | 37 +- .../optional/ide/VAJLoadProjects.java | 2 +- .../optional/junit/AggregateTransformer.java | 53 +- .../optional/junit/XMLResultAggregator.java | 9 +- .../tools/ant/types/CommandlineJava.java | 4 +- .../tools/ant/types/CommandlineJavaTest.java | 9 +- 117 files changed, 10427 insertions(+), 7804 deletions(-) delete mode 100644 docs/ejb.html delete mode 100644 docs/frames-index.html delete mode 100644 docs/frames-toc.html delete mode 100644 docs/index.html create mode 100644 docs/manual/CoreTasks/ant.html create mode 100644 docs/manual/CoreTasks/antcall.html create mode 100644 docs/manual/CoreTasks/antstructure.html create mode 100644 docs/manual/CoreTasks/apply.html create mode 100644 docs/manual/CoreTasks/available.html create mode 100644 docs/manual/CoreTasks/chmod.html create mode 100644 docs/manual/CoreTasks/copy.html create mode 100644 docs/manual/CoreTasks/copydir.html create mode 100644 docs/manual/CoreTasks/copyfile.html create mode 100644 docs/manual/CoreTasks/cvs.html create mode 100644 docs/manual/CoreTasks/delete.html create mode 100644 docs/manual/CoreTasks/deltree.html create mode 100644 docs/manual/CoreTasks/echo.html create mode 100644 docs/manual/CoreTasks/exec.html create mode 100644 docs/manual/CoreTasks/execon.html create mode 100644 docs/manual/CoreTasks/fail.html create mode 100644 docs/manual/CoreTasks/filter.html create mode 100644 docs/manual/CoreTasks/fixcrlf.html create mode 100644 docs/manual/CoreTasks/genkey.html create mode 100644 docs/manual/CoreTasks/get.html create mode 100644 docs/manual/CoreTasks/gunzip.html create mode 100644 docs/manual/CoreTasks/gzip.html create mode 100644 docs/manual/CoreTasks/jar.html create mode 100644 docs/manual/CoreTasks/java.html create mode 100644 docs/manual/CoreTasks/javac.html create mode 100644 docs/manual/CoreTasks/javadoc.html create mode 100644 docs/manual/CoreTasks/mail.html create mode 100644 docs/manual/CoreTasks/mkdir.html create mode 100644 docs/manual/CoreTasks/move.html create mode 100644 docs/manual/CoreTasks/patch.html create mode 100644 docs/manual/CoreTasks/property.html create mode 100644 docs/manual/CoreTasks/rename.html create mode 100644 docs/manual/CoreTasks/replace.html create mode 100644 docs/manual/CoreTasks/rmic.html create mode 100644 docs/manual/CoreTasks/signjar.html rename docs/{ => manual/CoreTasks}/sql.html (72%) create mode 100644 docs/manual/CoreTasks/style.html create mode 100644 docs/manual/CoreTasks/tar.html create mode 100644 docs/manual/CoreTasks/taskdef.html create mode 100644 docs/manual/CoreTasks/touch.html create mode 100644 docs/manual/CoreTasks/tstamp.html create mode 100644 docs/manual/CoreTasks/untar.html create mode 100644 docs/manual/CoreTasks/unzip.html create mode 100644 docs/manual/CoreTasks/uptodate.html create mode 100644 docs/manual/CoreTasks/war.html create mode 100644 docs/manual/CoreTasks/zip.html create mode 100644 docs/manual/CoreTypes/fileset.html create mode 100644 docs/manual/CoreTypes/mapper.html create mode 100644 docs/manual/CoreTypes/patternset.html create mode 100644 docs/manual/Integration/Antidote.html rename docs/{ => manual/Integration}/VAJAntTool.html (93%) rename docs/{ => manual/Integration}/anttool1.gif (100%) rename docs/{ => manual/Integration}/toolmenu.gif (100%) create mode 100644 docs/manual/LICENSE rename docs/{ => manual/OptionalTasks}/antlr.html (86%) create mode 100644 docs/manual/OptionalTasks/cab.html rename docs/{ => manual/OptionalTasks}/clearcase.html (93%) create mode 100644 docs/manual/OptionalTasks/depend.html rename docs/{ => manual/OptionalTasks}/dotnet.html (65%) create mode 100644 docs/manual/OptionalTasks/ejb.html create mode 100644 docs/manual/OptionalTasks/ftp.html rename docs/{ => manual/OptionalTasks}/javacc.html (96%) create mode 100644 docs/manual/OptionalTasks/jjtree.html rename docs/{ => manual/OptionalTasks}/jlink.html (96%) rename docs/{ => manual/OptionalTasks}/junit.html (93%) create mode 100644 docs/manual/OptionalTasks/junitreport.html create mode 100644 docs/manual/OptionalTasks/mparse.html rename docs/{ => manual/OptionalTasks}/native2ascii.html (92%) create mode 100644 docs/manual/OptionalTasks/netrexxc.html rename docs/{ => manual/OptionalTasks}/perforce.html (92%) rename docs/{ => manual/OptionalTasks}/propertyfile.html (60%) create mode 100644 docs/manual/OptionalTasks/renameextensions.html create mode 100644 docs/manual/OptionalTasks/script.html create mode 100644 docs/manual/OptionalTasks/sound.html create mode 100644 docs/manual/OptionalTasks/stylebook.html create mode 100644 docs/manual/OptionalTasks/telnet.html create mode 100644 docs/manual/OptionalTasks/test.html create mode 100644 docs/manual/OptionalTasks/vssget.html create mode 100644 docs/manual/coretasklist.html create mode 100644 docs/manual/credits.html create mode 100644 docs/manual/develop.html create mode 100644 docs/manual/dirtasks.html create mode 100644 docs/manual/feedback.html create mode 100644 docs/manual/ide.html create mode 100644 docs/manual/index.html create mode 100644 docs/manual/install.html create mode 100644 docs/manual/intro.html create mode 100644 docs/manual/optionaltasklist.html create mode 100644 docs/manual/resources.html create mode 100644 docs/manual/toc.html create mode 100644 docs/manual/using.html diff --git a/WHATSNEW b/WHATSNEW index 6ffa91b9a..fa49b84f1 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1,4 +1,4 @@ -Changes from Ant 1.2 to the current sources +Changes from Ant 1.2 to Ant 1.3 Beta 1 =========================================== Changes that could break older environments: @@ -19,10 +19,12 @@ Changes that could break older environments: Other changes: -------------- -* A GUI Frontend: Antidote. This is currently in development. +* A GUI Frontend: Antidote. This is currently in development. At this + time, this is not part of the Ant release, although the source is + included if you are interested. * New tasks: stylebook, propertyfile, depend, antlr, telnet, csc, - ilasm, apply, javah, several clearcase tasks, junitreport + ilasm, apply, javah, several clearcase tasks, junitreport, sound * Added output attribute to . @@ -51,10 +53,6 @@ Other changes: * Style tasks will now support TraX compliant XSL processors if one is present in your classpath. -* Ant now prints a warning when an attempt is made to use a property which has - not been set. Any build files which rely on non-set properties being passed - through untranslated will now break. - * Added a failonerror to the javac task. If set to false, the build will continue even if there are compilation errors. @@ -66,6 +64,14 @@ Other changes: * ${} property expansion will now be performed on the patterns read from files specified as includesfile or excludesfile attributes. + +* The and tasks now support GNU format for handling paths + which are greater than 100 characters in length. In addition the + task now supports nested filesets through which the file permissions + may be controlled. + +* wlrun, wlstop and ejbjar now support Weblogic 6.0 + Fixed bugs: ----------- @@ -82,9 +88,12 @@ Fixed bugs: * ejbjar now correctly ignores elements in the deployment descriptor. CMP files are included by parsing the weblogic deployment descriptor rather than relying on the naming convention used in ant 1.2 - Include super classes and super interfaces into the generated ejb jar files - nested element allows support classes to be included in the EJB jar - + +* ejbjar includes super classes and super interfaces into the generated ejb + jar files. The nested element allows support classes to be + included in the EJB jar. The toplink element should now correctly locate + the toplink descriptor. + * now correctly deals with spaces in arguments * fails early if a given manifest file doesn't exist @@ -109,6 +118,10 @@ Fixed bugs: * can now log to files whose name contains a comma as well. +* The AntClassLoader now refers to the loader which loaded it, any + requests it does not handle itself. Previously these went to the + primordial loader. + Changes from Ant 1.1 to Ant 1.2 =============================== diff --git a/bootstrap.bat b/bootstrap.bat index d40625542..8b1578ef5 100755 --- a/bootstrap.bat +++ b/bootstrap.bat @@ -21,7 +21,7 @@ echo ... Bootstrapping Ant Distribution if "%OS%" == "Windows_NT" if exist bootstrap rmdir/s/q bootstrap if not "%OS%" == "Windows_NT" if exist bootstrap deltree/y bootstrap -SET LOCALCLASSPATH=lib\parser.jar;lib\jaxp.jar +SET LOCALCLASSPATH=lib\parser.jar;lib\jaxp.jar;lib\optional\junit.jar if exist %JAVA_HOME%\lib\tools.jar call src\script\lcp.bat %JAVA_HOME%\lib\tools.jar if exist %JAVA_HOME%\lib\classes.zip call src\script\lcp.bat %JAVA_HOME%\lib\classes.zip @@ -29,7 +29,7 @@ if exist %JAVA_HOME%\lib\classes.zip call src\script\lcp.bat %JAVA_HOME%\lib\cla set TOOLS=src\main\org\apache\tools set CLASSDIR=classes -SET CLASSPATH=%LOCALCLASSPATH%;%CLASSDIR%;src\main; +SET CLASSPATH=%LOCALCLASSPATH%;%CLASSDIR%;src\main;%CLASSPATH% echo JAVA_HOME=%JAVA_HOME% echo JAVA=%JAVA% diff --git a/bootstrap.sh b/bootstrap.sh index 276769811..c50b50c4a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -2,8 +2,6 @@ # You will need to specify JAVA_HOME if compiling with 1.2 or later. -unset CLASSPATH - if [ "$JAVA_HOME" != "" ] ; then if [ -f $JAVA_HOME/lib/tools.jar ] ; then CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar @@ -43,7 +41,7 @@ if [ -d "bootstrap" ] ; then rm -r bootstrap fi -CLASSPATH=lib/parser.jar:lib/jaxp.jar:${CLASSPATH} +CLASSPATH=lib/parser.jar:lib/jaxp.jar:lib/optional/junit.jar:${CLASSPATH} TOOLS=src/main/org/apache/tools CLASSDIR=classes diff --git a/build.xml b/build.xml index e1e8c8942..2addb4073 100644 --- a/build.xml +++ b/build.xml @@ -15,7 +15,6 @@ - @@ -196,9 +195,9 @@ + unless="xalan.present" /> + unless="xalan.present" /> @@ -294,11 +293,11 @@ - - + + @@ -346,6 +345,7 @@ + @@ -400,16 +400,16 @@ excludes="${dist.name}/lib/optional.jar"/> - + - - + + - + @@ -426,15 +426,15 @@ includes="${dist.name}/**"/> - + - - + + - + diff --git a/docs/ant_in_anger.html b/docs/ant_in_anger.html index bd4363177..da6bef7f1 100644 --- a/docs/ant_in_anger.html +++ b/docs/ant_in_anger.html @@ -106,7 +106,7 @@ And of course, the ubiquitous clean target. With standard target names, it is easy to build encompassing ant build files which just hand off the work to the classes below using the -ant +ant task. For example. the clean target could be handed down to the intf and impl subdirectories from a parent directory @@ -126,9 +126,9 @@ impl subdirectories from a parent directory If ant does not do what you want, you can use the -exec and -java tasks or -inline scripting to extend it. In a +exec and +java tasks or +inline scripting to extend it. In a project with many build.xml files, you soon find that having a single central place for implementing the functionality keeps maintenance overhead down. Implementing task extensions through java code seems @@ -153,7 +153,7 @@ Embrace Automated Testing (alternatively "recriminate early, recriminate often")

-Ant lets you call JUnit tasks, which unit test +Ant lets you call JUnit tasks, which unit test the code your team has written. Automated testing may seem like extra work at first, but JUnit makes writing unit tests so easy that you have almost no reason not to. Invest the time in learning how to use @@ -175,7 +175,7 @@ choice. System tests are harder to automate than unit tests, but if you can write java code to stress large portions of the system -even if the code -can not run as JUnit tasks- then the java +can not run as JUnit tasks- then the java task can be used to invoke them. It is best to specify that you want a new JVM for these tests, so that a significant crash does not break the full build. @@ -198,8 +198,8 @@ The common barriers to cross-platform ant are the use of command line tools (exec tasks) which are not portable, path issues, and hard coding in the location of things. -

Command Line apps: Exec/ ExecOn

+

Command Line apps: Exec/ ExecOn

The trouble with external invocation is that not all functions are found cross platform, and those that are often have different names -DOS @@ -260,14 +260,14 @@ not have a class 'ExampleThree' implemented in "examplethree.java".

-Some tasks only work on one platform - +Some tasks only work on one platform - Chmod being a classic example. These tasks usually result in just a warning message on an unsupported platform -the rest of the target's tasks will still be called. Other tasks degrade their functionality on platforms or Java versions. In particular, any task which adjusts the timestamp of files can not do so properly on Java 1.1. Tasks which can -do that - Get, Touch and +do that - Get, Touch and Unjar/Unwar/Unzip for example, degrade their functionality on Java1.1, usually resorting to the current timestamp instead. @@ -318,14 +318,14 @@ evolved in ant. That is because we all have to do it these days, so many people have put in the effort to make the tasks easier.

-Ant can Jar, -Tar or Zip files for deployment, while -the War task extends the jar task for +Ant can Jar, +Tar or Zip files for deployment, while +the War task extends the jar task for better servlet deployment. Jlink is a jar generation file which lets you merge multiple sub jars. This is ideal for a build process in which separate jars are generated by sub projects, yet the final output is a merged jar. Cab can be used on Win32 boxes to build a cab file +"manual/OptionalTasks/cab.html">Cab can be used on Win32 boxes to build a cab file which is useful if you have to target IE deployment.

@@ -333,7 +333,7 @@ which is useful if you have to target IE deployment. The ftp task lets you move stuff up to a server. Beware of putting the ftp password in the build file -a property file with tight access control is slightly better. The FixCRLF task is often a useful interim step if +"manual/CoreTasks/fixcrlf.html">FixCRLF task is often a useful interim step if you need to ensure that files have unix file extensions before upload. A WebDav task has long been discussed, which would provide a more secure upload to web servers, but it is still in the todo list. If DAV is your @@ -341,7 +341,7 @@ required upload mechanism, why not take up the challenge?

-EJB deployment is aided by the ejb tasks. At the +EJB deployment is aided by the ejb tasks. At the time of writing, only WebLogic was supported with these tasks -if your EJB server is not supported, extending the ejb tasks would benefit your project and the rest of the ant community. @@ -349,9 +349,9 @@ project and the rest of the ant community.

Finally, there are of course the fallbacks of just copying files to a -destination using Copy and Copy and Copydir , or just sending them to a person or -process using Mail. +process using Mail.

Directory Structures

@@ -527,7 +527,7 @@ Tips and Tricks get
-The get task can fetch any URL, so be used +The get task can fetch any URL, so be used to trigger remote server side code during the build process, from remote server restarts to sending SMS/pager messages to the developer cellphones @@ -538,7 +538,7 @@ i18n Internationalisation is always trouble. Ant helps here with the native2ascii task which can escape out all non +"manual/OptionalTasks/native2ascii.html">native2ascii task which can escape out all non ascii characters into unicode. You can use this to write java files which include strings (and indeed comments) in your own non-ASCII language and then use native2ascii to convert to ascii prior to feeding @@ -604,7 +604,7 @@ Implement complex Ant builds through XSL
XSLT can be used to dynamically generate build.xml files from a source -xml file, with the Style task controlling +xml file, with the Style task controlling the transform. This is the current recommended strategy for creating complex build files dynamically. diff --git a/docs/ejb.html b/docs/ejb.html deleted file mode 100644 index 39235ff89..000000000 --- a/docs/ejb.html +++ /dev/null @@ -1,514 +0,0 @@ - - - - -Ant EJB Tasks - - - - - -

Ant EJB Tasks User Manual

-

by

- - - -

Version 1.1 - 2000/07/18

-
-

Table of Contents

- - -
-

Introduction

-

Ant provides a number of optional tasks for developing -Enterprise Java Beans (EJBs). -In general these tasks are specific to the particular vendor's EJB Server. At present the tasks support -Weblogic 4.5.1 and 5.1 EJB servers. Over time we expect further optional tasks -to support additional EJB Servers. - -


-

EJB Tasks

- - - - - - - -
TaskApplication Servers
ddcreatorWeblogic 4.5.1
ejbcWeblogic 4.5.1
wlrunWeblogic 4.5.1 and 5.1
wlstopWeblogic 4.5.1 and 5.1
ejbjarWeblogic 5.1
- -
-

ddcreator

-

Description:

-

ddcreator will compile a set of Weblogic text-based deployment descriptors into a serialized -EJB deployment descriptor. The selection of which of the text-based descriptors are to be compiled -is based on the standard Ant include and exclude selection mechanisms. - - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
descriptorsThis is the base directory from which descriptors are selected.Yes
destThe directory where the serialised deployment descriptors will be writtenYes
classpathThis is the classpath to use to run the underlying weblogic ddcreator tool. - This must include the weblogic.ejb.utils.DDCreator classNo
-

Examples

-
<ddcreator descriptors="${dd.dir}" 
-           dest="${gen.classes}" 
-           classpath="${descriptorbuild.classpath}">
-  <include name="*.txt" />
-</ddcreator>
-
- -
-

ejbc

-

Description:

-

The ejbc task will run Weblogic's ejbc tool. This tool will take a serialised deployment descriptor, -examine the various EJB interfaces and bean classes and then generate the required support classes -necessary to deploy the bean in a Weblogic EJB container. This will include the RMI stubs and skeletons -as well as the classes which implement the bean's home and remote interfaces. -

-The ant task which runs this tool is able to compile several beans in a single operation. The beans to be -compiled are selected by including their serialised deployment descriptors. The standard ant -include and exclude constructs can be used to select the deployment descriptors -to be included. -

-Each descriptor is examined to determiune whether the generated classes are out of date and need to be -regenerated. The deployment descriptor is de-serialized to discover the home, remote and -implementation classes. The corresponding source files are determined and checked to see their -modification times. These times and the modification time of the serialised descriptor itself are -compared with the modification time of the generated classes. If the generated classes are not present -or are out of date, the ejbc tool is run to generate new versions. -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
descriptorsThis is the base directory from which the serialised deployment descriptors are selected.Yes
destThe base directory where the generated classes, RIM stubs and RMI skeletons are writtenYes
manifestThe name of a manifest file to be written. This manifest will contain an entry for each EJB processedYes
srcThe base directory of the source tree containing the source files of the home interface, - remote interface and bean implementation classes.Yes
classpathThis classpath must include both the weblogic.ejbc class and the - classfiles of the bean, home interface, remote interface, etc of the bean being - processed.No
-

Examples

-
<ejbc descriptors="${gen.classes}"
-           src="${src.dir}" 
-           dest="${gen.classes}"
-           manifest="${build.manifest}" 
-           classpath="${descriptorbuild.classpath}">
-  <include name="*.ser" />
-</ejbc>
-
- -
-

wlrun

-

Description:

-

The wlrun task is used to start a weblogic server. The task runs -a weblogic instance in a separate Java Virtual Machine. A number of parameters -are used to control the operation of the weblogic instance. Note that the task, -and hence ant, will not complete until the weblogic instance is stopped. - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
homeThe location of the weblogic home that is to be used. This is the location - where weblogic is installed.Yes
classpathThe classpath to be used with the Java Virtual Machine that runs the Weblogic - Server. This is typically set to the Weblogic boot classpath.Yes
wlclasspathThe weblogic classpath used by the Weblogic Server.No
propertiesThe name of the server's properties file within the weblogic home directory - used to control the weblogic instance.Yes
nameThe name of the weblogic server within the weblogic home which is to be run. - This defaults to "myserver"No
policyThe name of the security policy file within the weblogic home directory that - is to be used. If not specified, the default policy file weblogic.policy - is used.No
jvmargsAdditional argument string passed to the Java Virtual Machine used to run the - Weblogic instance.No
argsAdditional argument string passed to the Weblogic instance.No
- - -
-

wlstop

-

Description:

-

The wlstop task is used to stop a weblogic instance which is currently running. -To shut down an instance you must supply both a username and a password. These will be stored -in the clear in the build script used to stop the instance. For security reasons, this task is -therefore only appropriate in a development environment. - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
classpathThe classpath to be used with the Java Virtual Machine that runs the Weblogic - Shutdown comment.Yes
userThe username of the account which will be used to shutdown the serverYes
passwordThe password for the account specified in the user parameter.Yes
urlThe URL which describes the port to which the server is listening for T3 connections. - For example, t3://localhost:7001Yes
delayThe delay in seconds after which the server will stop. This defaults to an - immediate shutdown.No
- - -
-

ejbjar

-

Description:

-

This task is designed to support building of arbitrary EJB1.1 jar files. Support is currently - provided for 'vanilla' EJB1.1 jar files - i.e. those containing only the user generated class - files and the standard deployment descriptor. Nested elements provide support for vendor - specific deployment tools. Currently, a nested element is provided for building Weblogic 5.1 - session/entity beans using the weblogic.ejbc tool as well as a nested element for building - TOPLink for WebLogic 2.5.1-enabled entity beans.

- -

This task supports two approaches to creating ejb jar files. The first approach assumes a particular - naming convention for deployment descriptor files. For an Account bean, for example, the deployment - descriptor would be named Account-ejb-jar.xml. This naming convention allows the task to - distinguish deployment descriptors without relying on their positioning within a source tree. It is - also used to derive the name of the .jar file which is generated. For the example this would be - Account.jar. Vendor specific files are assumed to be named in a similar fashion. The - deployment descriptor file which defines additional weblogic specific information for the above bean - would be Account-weblogic-ejb-jar.xml. - The second approach does not require a naming convention. This approach uses a specified a jar name - for the resultant ejb jar. If the jar name is present, then no naming convention is required. If the - jar name is not specified, then the default naming convention is expected for the deployment descriptor - files. - -

The task works as a directory scanning task, and performs an action for each deployment descriptor - found. As such the includes and excludes should be set to ensure that all desired EJB1.1 - descriptors are found, but no application server descriptors are found. For each descriptor - found, ejbjar will parse the deployment descriptor to determine the necessary class files which - implement the bean. These files are assembled along with the deployment descriptors into a well - formed EJB jar file. Note that support classes used by the bean but which are not part of the - bean's interfaces are not included in the assembled jar. These need to be collected into a - separate support jar file.

- -

If no nested vendor-specific deployment elements are present, the task will simply generate a - generic EJB jar. Such jars are typically used as the input to vendor-specific deployment tools. - For each nested deployment element, a vendor specific deployment tool is run to generate a jar file - ready for deployment in that vendor's EJB container. Note that at this time the only supported tool is - Weblogic's ejbc tool. - -

The jar files are only built if they are out of date. Each deployment tool element will examine - its target jar file and determine if it is out of date with respect to the class files and - deployment descriptors that make up the bean. If any of these files are newer than the jar file - the jar will be rebuilt otherwise a message is logged that the jar file is up to date.

- -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
descriptordirThe base directory under which to scan for EJB deployment descriptors. If this - attribute is not specified, then the deployment descriptors must be located in - the directory specified by the 'srcdir' attribute.No
srcdirThe base directory containing the .class files that make up the bean. - Note that this can be the same as the descriptordir if all files are - in the same directory tree.Yes
destdirThe base directory into which generated jar files are deposited. Jar files are deposited in - directories correpsonding to their location within the descriptordir namespace. Note that - this attribute is only used if the task is generating generic jars (i.e. no vendor-specific - deployment elements have been specified).Yes
basejarnameThe base name that is used for the generated jar files. If this attribute is specified, the - generic jar file name will use this value as the prefix (followed by the value specified in - the 'genericjarsuffix' attibute) and the resultant ejb jar file (followed by any suffix specified - in the nested element).No
basenameterminatorString value used to substring out a string from the name of each deployment descriptor found, - which is then used to locate related deployment descriptors (e.g. the WebLogic descriptors). - For example, a basename of '.' and a deployment descriptor called 'FooBean.ejb-jar.xml' would - result in a basename of 'FooBean' which would then be used to find FooBean.weblogic-ejb-jar.xml - and FooBean.weblogic-cmp-rdbms-jar.xml, as well as to create the filenames of the jar files as - FooBean-generic.jar and FooBean-wl.jar. This attribute is not used if the 'basejarname' attribute - is specified.No, defaults to '-'.
genericjarsuffixString value appended to the basename of the deployment descriptor to create the filename of the - generic EJB jar file.No, defaults to '-generic.jar'.
- -

Vendor-specific deployment elements

- -Each vendor-specific nested element controls the generation of a deployable jar specific to that vendor's -EJB container. The parameters for each supported deployment element are detailed here. - -

Weblogic element

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
destdirThe base directory into which the generated weblogic ready jar files are deposited. - Jar files are deposited in directories correpsonding to their location within the - descriptordir namespace. Yes
genericjarsuffixA generic jar is generated as an intermeditate step in build the weblogic deployment - jar. The suffix used to generate the generic jar file is not particularly important - unless it is desired to keep the generic jar file. It should not, however, be the same - as the suffix setting.No, defaults to '-generic.jar'.
suffixString value appended to the basename of the deployment descriptor to create the filename of the - WebLogic EJB jar file.No, defaults to '.jar'.
classpathThe classpath to be used when running the weblogic ejbc tool. Note that this tool - typically requires the classes that make up the bean to be available on the classpath. - Currently, however, this will cause the ejbc tool to be run in a separate VMNo
keepgenericThis controls whether the generic fiule used as input to ejbc is retained.No, defaults to false
- -

TOPLink for Weblogic element

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
destdirThe base directory into which the generated weblogic ready jar files are deposited. - Jar files are deposited in directories correpsonding to their location within the - descriptordir namespace. Yes
genericjarsuffixA generic jar is generated as an intermeditate step in build the weblogic deployment - jar. The suffix used to generate the generic jar file is not particularly important - unless it is desired to keep the generic jar file. It should not, however, be the same - as the suffix setting.No, defaults to '-generic.jar'.
suffixString value appended to the basename of the deployment descriptor to create the filename of the - WebLogic EJB jar file.No, defaults to '.jar'.
classpathThe classpath to be used when running the weblogic ejbc tool. Note that this tool - typically requires the classes that make up the bean to be available on the classpath. - Currently, however, this will cause the ejbc tool to be run in a separate VMNo
keepgenericThis controls whether the generic file used as input to ejbc is retained.No, defaults to false
toplinkdescriptorThis specifes the name of the TOPLink deployment descriptor file contained in the - 'descriptordir' directory.Yes
toplinkdtdThis specifies the location of the TOPLink DTD file. This can be a file path or - a file URL. This attribute is not required, but using a local DTD is recommended.No, defaults to dtd file at www.objectpeople.com.
- - -

Examples

-This example shows ejbjar being used to generate deployment jars using a Weblogic EJB container. This example -requires the naming standard to be used for the deployment descriptors. Using this format will create a ejb -jar file for each variation of '*-ejb-jar.xml' that is found in the deployment descriptor directory. -
-    <ejbjar srcdir="${build.classes}"
-            descriptordir="${descriptor.dir}">
-      <weblogic destdir="${deploymentjars.dir}"
-                classpath="${descriptorbuild.classpath}"/>
-      <include name="**/*-ejb-jar.xml"/>
-      <exclude name="**/*weblogic*.xml"/>
-    </ejbjar>
-
- -This example shows ejbjar being used to generate a single deployment jar using a Weblogic EJB container. This example -does not require the deployment descriptors to use the naming standard. This will create only one ejb jar file - -'TheEJBJar.jar'. -
-    <ejbjar srcdir="${build.classes}"
-            descriptordir="${descriptor.dir}"
-            basejarname="TheEJBJar">
-      <weblogic destdir="${deploymentjars.dir}"
-                classpath="${descriptorbuild.classpath}"/>
-      <include name="**/ejb-jar.xml"/>
-      <exclude name="**/weblogic*.xml"/>
-    </ejbjar>
-
- -This example shows ejbjar being used to generate deployment jars for a TOPLink-enabled entity bean using a -Weblogic EJB container. This example does not require the deployment descriptors to use the naming standard. -This will create only one TOPLink-enabled ejb jar file - 'Address.jar'. -
-    <ejbjar srcdir="${build.dir}"
-            destdir="${solant.ejb.dir}"
-            descriptordir="${descriptor.dir}"
-            basejarname="Address">
-            <weblogictoplink destdir="${solant.ejb.dir}"
-                    classpath="${java.class.path}"
-                    keepgeneric="false"
-                    toplinkdescriptor="Address.xml"
-                    toplinkdtd="file:///dtdfiles/toplink-cmp_2_5_1.dtd"
-                    suffix=".jar"/>
-            <include name="**/ejb-jar.xml"/>
-            <exclude name="**/weblogic-ejb-jar.xml"/>
-    </ejbjar>
-
- - - - - - diff --git a/docs/frames-index.html b/docs/frames-index.html deleted file mode 100644 index a86981b23..000000000 --- a/docs/frames-index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Ant User Manual - - - - - - - - diff --git a/docs/frames-toc.html b/docs/frames-toc.html deleted file mode 100644 index 729b1913a..000000000 --- a/docs/frames-toc.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Ant User Manual - - - -

Table of Contents

- -
-

Copyright © 2000,2001 Apache Software Foundation. All rights -Reserved.

- - - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 33702ec10..000000000 --- a/docs/index.html +++ /dev/null @@ -1,6774 +0,0 @@ - - - - -Ant User Manual - - - - -
-

Ant User Manual

-

by

-
- - - -
-

Version: @VERSION@
-$Id$

-
- -
-

Table of Contents

- - -
-

Introduction

-

Ant is a Java-based build tool. In theory, it is kind of like -make, without make's wrinkles.

-

Why?

-

Why another build tool when there is already -make, -gnumake, -nmake, -jam, -and -others? Because all those tools have limitations that Ant's original author -couldn't live with when developing software across multiple platforms. -Make-like -tools are inherently shell-based: they evaluate a set of dependencies, -then execute commands not unlike what you would issue on a shell. -This means that you -can easily extend these tools by using or writing any program for the OS that -you are working on; however, this also means that you limit yourself to the OS, -or at least the OS type, such as Unix, that you are working on.

-

Makefiles are inherently evil as well. Anybody who has worked on them for any -time has run into the dreaded tab problem. "Is my command not executing -because I have a space in front of my tab?!!" said the original author of -Ant way too many times. Tools like Jam took care of this to a great degree, but -still have yet another format to use and remember.

-

Ant is different. Instead of a model where it is extended with shell-based -commands, Ant is extended using Java classes. Instead of writing shell commands, -the configuration files are XML-based, calling out a target tree where various -tasks get executed. Each task is run by an object that implements a particular -Task interface.

-

Granted, this removes some of the expressive power that is inherent in being -able to construct a shell command such as -`find . -name foo -exec rm {}`, but it -gives you the ability to be cross-platform – to work anywhere and -everywhere. And -hey, if you really need to execute a shell command, Ant has an -<exec> task that -allows different commands to be executed based on the OS it is executing -on.

- -
-

Getting Ant

-

Binary edition

-

The latest stable version of Ant can be downloaded from -http://jakarta.apache.org/builds/ant/release/v1.2/bin/. -If you like living on the edge, you can download the latest version from http://jakarta.apache.org/builds/ant/nightly/.

-

Source Edition

-

If you prefer the source edition, you can download Ant from -http://jakarta.apache.org/builds/ant/release/v1.2/src/ -(latest stable) or from http://jakarta.apache.org/from-cvs/jakarta-ant/ -(current). See the section Building Ant on how to -build Ant from the source code.

- -
-

System Requirements

-

-To build and use Ant, you must have a JAXP-compliant XML parser installed and available on your classpath. -

-Both the binary and source distributions of Ant include the reference implementation of JAXP 1.0. -Please see http://java.sun.com/xml/ for more information. -If you wish to use a different JAXP-compliant parser, you should remove -jaxp.jar and parser.jar -from Ant's lib/core directory. -You can then either put the jars from your preferred parser into Ant's -lib/core directory or put the jars on the system classpath. -

-For the current version of Ant, you will also need a JDK installed on -your system, version 1.1 or later. A future version of Ant will require -JDK 1.2 or later. -

- -
-

Installing Ant

-

The binary distribution of Ant consists of four directories: -bin, -docs, -lib and -src. Only the bin -and lib directories are required for running Ant. To run Ant, the -following must be done:

-
    -
  • Add the bin directory to your path.
  • -
  • Set the ANT_HOME environment variable. -This should be set to the directory -that contains the bin and lib directories.
  • -
  • (Optionally) Set the JAVA_HOME environment variable. -(See the Advanced section below.) -This should be set to the directory where the JDK is installed.
  • -
-

Windows

-

Assume Ant is installed in c:\ant\. The following sets up the -environment:

-
set ANT_HOME=c:\ant
-set JAVA_HOME=c:\jdk1.2.2
-set PATH=%PATH%;%ANT_HOME%\bin
-

Unix (bash)

-

Assume Ant is installed in /usr/local/ant. The following sets up -the environment:

-
export ANT_HOME=/usr/local/ant
-export JAVA_HOME=/usr/local/jdk-1.2.2
-export PATH=${PATH}:${ANT_HOME}/bin
- -

Advanced

-
-

There are lots of variants that can be used to run Ant. What you need is at -least the following:

-
-The classpath for Ant must contain ant.jar and any jars/classes -needed for your chosen JAXP-compliant XML parser.

-

When you need JDK functionality -(such as for the javac task or the -rmic task), then for JDK 1.1, the classes.zip -file of the JDK must be added to the classpath; for JDK 1.2 or JDK 1.3, tools.jar -must be added. The scripts supplied with Ant, -in the bin directory, will add -the required JDK classes automatically, if the JAVA_HOME -environment variable is set.

-

When you are executing platform-specific applications (such as the exec task or the cvs task), the property ant.home -must be set to the directory containing -the antRun shell script necessary to run exec's on Unix.

-
-
-

Building Ant

-

To build Ant, you should install the Ant source distribution. -While the binary distribution -includes the Ant source code, it is intended for reference purposes only. -The bootstrap and build scripts used to build Ant itself are not included -in the binary distribution. -

-

Once you have installed the source distribution, go to the -jakarta-ant directory.

-

Set the JAVA_HOME environment variable -to the directory where the JDK is installed. -See Installing Ant -for examples on how to do this for your operating system.

-

Make sure you have downloaded any auxilliary jars required to -build tasks you are interested in. These should either be available -on the classpath or added to Ant's lib -directory. The list of auxilliary tasks and requirements is in -lib/README.

- -

Run bootstrap.bat (Windows) or bootstrap.sh (UNIX) -to build a bootstrap version of Ant.

-

When finished, use:

-
-

build -Ddist.dir=<directory_to_contain_Ant_distribution> dist    (Windows)

-

build.sh -Ddist.dir=<directory_to_contain_Ant_distribution> dist    (Unix)

-
-

to create a binary distribution of Ant. This distribution can be -found in the directory you specified.

- -If you wish to install the build into the current ANT_HOME -directory, you can use: -
-

build install    (Windows)

-

build.sh install    (Unix)

-
- -You can avoid the lengthy Javadoc step, if desired, with: -
-

build mininstall    (Windows)

-

build.sh mininstall    (Unix)

-
-This will only install the bin and lib directories. -

Both the install and -mininstall targets will overwrite -the current Ant version in ANT_HOME. - -


-

Running Ant

-

Running Ant is simple, when you installed it as described in the previous -section. Just type ant.

-

When nothing is specified, Ant looks for a build.xml -file in the current directory. If found, it uses that file as the -buildfile. If you use the -find option, -Ant will search for a buildfile in -the parent directory, and so on, until the root of the filesystem -has been reached. To make Ant use -another buildfile, use the command-line -option -buildfile file, -where file is the buildfile you want to use.

-

You can also set properties that override properties specified in the -buildfile (see the property task). -This can be done with -the -Dproperty=value option, -where property is the name of the property, -and value is the value for that property. -This can also be used to have access to your environment variables -(and is the only way, since Java cannot access them). -Just pass -DMYVAR=%MYVAR% (Windows) or --DMYVAR=$MYVAR (Unix) -to Ant – you can then access -these variables inside your buildfile as ${MYVAR}.

-

Two more options are: -quiet, -which instructs Ant to print less -information on the console when running, and --verbose, which causes Ant to print -additional information to the console.

-

It is also possible to specify one or more targets that should be executed. -When omitted, the target that is specified in the -default attribute of the <project> tag is -used.

-

The -projecthelp -option gives a list of this project's -targets. First those with a description, then those without one.

-

Command-line option summary:

-
ant [options] [target [target2 [target3] ...]]
-Options:
--help                  print this message
--projecthelp           print project help information
--version               print the version information and exit
--quiet                 be extra quiet
--verbose               be extra verbose
--debug                 print debugging information
--emacs                 produce logging information without adornments
--logfile file          use given file for log output
--logger classname      the class that is to perform logging
--listener classname    add an instance of class as a project listener
--buildfile file        use specified buildfile
--find file             search for buildfile towards the root of the filesystem and use the first one found
--Dproperty=value       set property to value
-
-

Examples

-
-
ant
-
-

runs Ant using the build.xml file in the current directory, on -the default target.

-
-
ant -buildfile test.xml
-
-

runs Ant using the test.xml file in the current directory, on -the default target.

-
-
ant -buildfile test.xml dist
-
-

runs Ant using the test.xml file in the current directory, on a -target called dist.

-
-
ant -buildfile test.xml -Dbuild=build/classes dist
-
-

runs Ant using the test.xml file in the current directory, on a -target called dist, setting the build property to the -value build/classes.

- -

Running Ant by Hand

-

If you have installed Ant in the do-it-yourself way, Ant can be started -with:

-
-
java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]
-
- -

These instructions actually do exactly the same as the ant -command. The options and target are the same as when running Ant with the ant -command. This example assumes you have set your classpath to include: -

    -
  • ant.jar -
  • jars/classes for your XML parser -
  • the JDK's required jar/zip files -
-
-

Writing a Simple Buildfile

-

Ant's buildfiles are written in XML. Each buildfile contains one project.

-

Each task element of the buildfile can have an id attribute and -can later be referred to by the value supplied to this. The value has -to be unique. (For additional information, see the - Tasks section below.)

-

Projects

-

A project has three attributes:

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
namethe name of the project.No
defaultthe default target to use when no target is supplied.Yes
basedirthe base directory from which all path calculations are - done. This attribute might be overridden by setting - the "basedir" - property beforehand. When this is done, it must be omitted in the - project tag. If neither the attribute nor the property have - been set, the parent directory of the buildfile will be used.No
-

Each project defines one or more targets. -A target is a set of tasks you want -to be executed. When starting Ant, you can select which target(s) you -want to have executed. When no target is given, -the project's default is used.

- -

Targets

-

A target can depend on other targets. You might have a target for compiling, -for example, and a target for creating a distributable. You can only build a -distributable when you have compiled first, so the distribute target -depends on the compile target. Ant resolves these dependencies.

-

It should be noted, however, that Ant's depends attribute -only specifies the order in which targets should be executed – it -does not affect whether the target that specifies the dependency(s) gets -executed if the dependent target(s) did not (need to) run. -

-

Ant tries to execute the targets in the depends -attribute in the order -they appear (from left to right). Keep in mind that it is possible that a target -can get executed earlier when an earlier target depends on it:

-
-
<target name="A"/>
-<target name="B" depends="A"/>
-<target name="C" depends="B"/>
-<target name="D" depends="C,B,A"/>
-
-

Suppose we want to execute target D. From its -depends attribute, you -might think that first target C, then B and then A is executed. -Wrong! C depends on B, and B depends on A, so first A is executed, then B, then C, and finally D.

-

A target gets executed only once, even when more than one target -depends on it (see the previous example).

-

A target also has the ability to perform its execution if (or -unless) a property has been set. This allows, for example, better -control on the building process depending on the state of the system -(java version, OS, command-line property defines, etc.). To make a target -sense this property, you should add the if (or -unless) attribute with the name of the property that the target -should react to. For example:

-
-
<target name="build-module-A" if="module-A-present"/>
-
<target name="build-own-fake-module-A" unless="module-A-present"/>
-
-

If no if and no unless attribute is present, -the target will always be executed.

-

The optional description attribute can be used to provide a one-line description of this target, which is printed by the --projecthelp command-line option.

-

It is a good practice to place your tstamp tasks in a so-called -initialization target, on which -all other targets depend. Make sure that target is always the first one in -the depends list of the other targets. In this manual, most initialization targets -have the name "init".

-

A target has the following attributes:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
namethe name of the target.Yes
dependsa comma-separated list of names of targets on which this - target depends.No
ifthe name of the property that must be set in order for this - target to execute.No
unlessthe name of the property that must not be set in order - for this target to execute.No
descriptiona short description of this target's function.No
- - -

Tasks

-
-

A task is a piece of code that can be executed.

-

A task can have multiple attributes (or arguments, if you prefer). The value -of an attribute might contain references to a property. These references will be -resolved before the task is executed.

-

Tasks have a common structure:

-
-
<name attribute1="value1" attribute2="value2" ... />
-
-

where name is the name of the task, -attributeN is the attribute name, and -valueN is the value for this attribute.

-

There is a set of built-in tasks, along with a -number of - optional tasks, but it is also very -easy to write your own.

-

All tasks share a task name attribute. The value of -this attribute will be used in the logging messages generated by -Ant.

-Tasks can be assigned an id attribute: -
-
<taskname id="taskID" ... />
-
-where taskname is the name of the task, and taskID is -a unique name for this task. -You can refer to the -corresponding task object in scripts or other tasks via this name. -For example, in scripts you could do: -
-
-<script ... >
-  task1.setFoo("bar");
-</script>
-
-
-to set the foo attribute of this particular task instance. -In another task (written in Java), you can access the instance via -project.getReference("task1"). -

-Note1: If "task1" has not been run yet, then -it has not been configured (ie., no attributes have been set), and if it is -going to be configured later, anything you've done to the instance may -be overwritten. -

-

-Note2: Future versions of Ant will most likely not -be backward-compatible with this behaviour, since there will likely be no -task instances at all, only proxies. -

- -

Properties

-

A project can have a set of properties. These might be set in the buildfile -by the property task, or might be set outside Ant. A -property has a name and a value. Properties may be used in the value of -task attributes. This is done by placing the property name between -"${" and "}" in the -attribute value. For example, -if there is a "builddir" property with the value -"build", then this could be used in an attribute like this: -${builddir}/classes. -This is resolved as build/classes.

- -

Built-in Properties

-

Ant provides access to all system properties as if they had been -defined using a <property> task. -For example, ${os.name} expands to the -name of the operating system.

-

In addition, Ant has some built-in properties:

-
-basedir             the absolute path of the project's basedir (as set
-                    with the basedir attribute of <project>).
-ant.file            the absolute path of the buildfile.
-ant.project.name    the name of the project that is currently executing;
-                    it is set in the name attribute of <project>.
-ant.java.version    the JVM version Ant detected; currently it can hold
-                    the values "1.1", "1.2" and "1.3".
-
- -

Example

-
-<project name="MyProject" default="dist" basedir=".">
-
-  <!-- set global properties for this build -->
-  <property name="src" value="."/>
-  <property name="build" value="build"/>
-  <property name="dist"  value="dist"/>
-
-  <target name="init">
-    <!-- Create the time stamp -->
-    <tstamp/>
-    <!-- Create the build directory structure used by compile -->
-    <mkdir dir="${build}"/>
-  </target>
-
-  <target name="compile" depends="init">
-    <!-- Compile the java code from ${src} into ${build} -->
-    <javac srcdir="${src}" destdir="${build}"/>
-  </target>
-
-  <target name="dist" depends="compile">
-    <!-- Create the distribution directory -->
-    <mkdir dir="${dist}/lib"/>
-
-    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
-    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
-  </target>
-
-  <target name="clean">
-    <!-- Delete the ${build} and ${dist} directory trees -->
-    <delete dir="${build}"/>
-    <delete dir="${dist}"/>
-  </target>
-</project>
-
- -

Token Filters

-

A project can have a set of tokens that might be automatically expanded if -found when a file is copied, when the filtering-copy behavior is selected in the -tasks that support this. These might be set in the buildfile -by the filter task

-

Since this can potentially be a very harmful behavior, -the tokens in the files must -be of the form @token@, where -token is the token name that is set -in the filter task. This token syntax matches the syntax of other build systems -that perform such filtering and remains sufficiently orthogonal to most -programming and scripting languages, as well as with documentation systems.

-

Note: If a token with the format @token@ -is found in a file, but no -filter is associated with that token, no changes take place; -therefore, no escaping -method is available – but as long as you choose appropriate names for your -tokens, this should not cause problems.

- -

Path-like Structures

-

You can specify PATH- and CLASSPATH-type -references using both -":" and ";" as separator -characters. Ant will -convert the separator to the correct character of the current operating -system.

-

Wherever path-like values need to be specified, a nested element can -be used. This takes the general form of:

-
-    <classpath>
-      <pathelement path="${classpath}"/>
-      <pathelement location="lib/helper.jar"/>
-    </classpath>
-
-

The location attribute specifies a single file or -directory relative to the project's base directory (or an absolute -filename), while the path attribute accepts colon- -or semicolon-separated lists of locations. The path -attribute is intended to be used with predefined paths – in any other -case, multiple elements with location attributes should be -preferred.

-

As a shortcut, the <classpath> tag -supports path and -location attributes of its own, so:

-
-    <classpath>
-      <pathelement path="${classpath}"/>
-    </classpath>
-
-

can be abreviated to:

-
-    <classpath path="${classpath}"/>
-
-

In addition, FileSets can be specified via -nested <fileset> elements. The order in which the files -building up a fileset are added to the path-like structure is not -defined.

-
-    <classpath>
-      <pathelement path="${classpath}"/>
-      <fileset dir="lib">
-        <include name="**/*.jar"/>
-      </fileset>
-      <pathelement location="classes"/>
-    </classpath>
-
-

Builds a path that holds the value of ${classpath}, -followed by all jar files in the lib directory, followed -by the classes directory.

-

If you want to use the same path-like structure for several tasks, -you can define them with a <path> element at the -same level as targets, and reference them via their -id attribute – see References for an -example.

-

A path-like structure can include a reference to another path-like -structure via nested <path> elements:

-
-    <path id="base.path">
-      <pathelement path="${classpath}"/>
-      <fileset dir="lib">
-        <include name="**/*.jar"/>
-      </fileset>
-      <pathelement location="classes"/>
-    </path>
-
-    <path id="tests.path">
-      <path refid="base.path"/>
-      <pathelement location="testclasses"/>
-    </path>
-
- The shortcuts previously mentioned for <classpath> are also valid for <path>.For example: -
-    <path id="base.path">
-      <pathelement path="${classpath}"/>
-    </path>
-
-can be written as: -
-    <path id="base.path" path="${classpath}"/>
-
- -

Command-line Arguments

-

Several tasks take arguments that will be passed to another -process on the command line. To make it easier to specify arguments -that contain space characters, nested arg elements can be used.

- - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
valuea single command-line argument; can contain space - characters.Exactly one of these.
linea space-delimited list of command-line arguments.
fileThe name of a file as a single command-line - argument; will be replaced with the absolute filename of the file.
pathA string that will be treated as a path-like - string as a single command-line argument; you can use ; - or : as - path separators and Ant will convert it to the platform's local - conventions.
-

Examples

-
-  <arg value="-l -a"/>
-
-

is a single command-line argument containing a space character.

-
-  <arg line="-l -a"/>
-
-

represents two separate command-line arguments.

-
-  <arg path="/dir;/dir2:\dir3"/>
-
-

is a single command-line argument with the value -\dir;\dir2;\dir3 on DOS-based systems and -/dir:/dir2:/dir3 on Unix-like systems.

- -

References

-

The id attribute of the buildfile's elements can be -used to refer to them. This can useful if you are going to replicate -the same snippet of XML over and over again – using a -<classpath> structure more than once for -example.

-

The following example:

-
-<project ... >
-  <target ... >
-    <rmic ...>
-      <classpath>
-        <pathelement location="lib/"/>
-        <pathelement path="${java.class.path}/"/>
-        <pathelement path="${additional.path}"/>
-      </classpath>
-    </rmic>
-  </target>
-
-  <target ... >
-    <javac ...>
-      <classpath>
-        <pathelement location="lib/"/>
-        <pathelement path="${java.class.path}/"/>
-        <pathelement path="${additional.path}"/>
-      </classpath>
-    </javac>
-  </target>
-</project>
-
-

could be rewritten as:

-
-<project ... >
-  <path id="project.class.path">
-    <pathelement location="lib/"/>
-    <pathelement path="${java.class.path}/"/>
-    <pathelement path="${additional.path}"/>
-  </path>
-
-  <target ... >
-    <rmic ...>
-      <classpath refid="project.class.path"/>
-    </rmic>
-  </target>
-
-  <target ... >
-    <javac ...>
-      <classpath refid="project.class.path"/>
-    </javac>
-  </target>
-</project>
-
-

All tasks that use nested elements for PatternSets, FileSets or -path-like structures accept references to these -structures as well.

- -
-

Directory-based Tasks

-

Some tasks use directory trees for the task they perform. -For example, the javac task, which works upon a directory tree -with .java files. -Sometimes it can be very useful to work on a subset of that directory tree. This -section describes how you can select a subset of such a directory tree.

-

Ant gives you two ways to create a subset, both of which can be used at the same -time:

-
    -
  • Only include files/directories that match at least one pattern of a set of - patterns.
  • -
  • Exclude files/directories that match at least one pattern a set of - patterns.
  • -
-

When both inclusion and exclusion are used, only files/directories that match -the include patterns, and don't match the exclude patterns, are used.

-

Patterns can be specified inside the buildfile via task attributes or -nested elements and via external files. Each line of the external file -is taken as a pattern that is added to the list of include or exclude -patterns.

-

Patterns

-

As described earlier, patterns are used for the inclusion and exclusion. -These patterns look very much like the patterns used in DOS and UNIX:

-

'*' matches zero or more characters, '?' matches one character.

-

Examples:

-

-*.java  matches  .java, -x.java and FooBar.java, but -not FooBar.xml (does not end with .java).

-

-?.java  matches  x.java, -A.java, but not .java or xyz.java -(both don't have one character before .java).

-

-Combinations of *'s and ?'s are allowed.

-

Matching is done per-directory. This means that first the first directory in -the pattern is matched against the first directory in the path to match. Then -the second directory is matched, and so on. For example, when we have the pattern /?abc/*/*.java -and the path /xabc/foobar/test.java, -the first ?abc is matched with xabc, -then * is matched with foobar, -and finally *.java is matched with test.java. -They all match, so the path matches the pattern.

-

To make things a bit more flexible, we add one extra feature, which makes it -possible to match multiple directory levels. This can be used to match a -complete directory tree, or a file anywhere in the directory tree. -To do this, ** -must be used as the name of a directory. -When ** is used as the name of a -directory in the pattern, it matches zero or more directories. -For example: -/test/** matches all files/directories under /test/, -such as /test/x.java, -or /test/foo/bar/xyz.html, but not /xyz.xml.

-

There is one "shorthand" – if a pattern ends -with / -or \, then ** -is appended. -For example, mypackage/test/ is interpreted as if it were -mypackage/test/**.

-

Example patterns:

- - - - - - - - - - - - - - - - - - -
**/CVS/*Matches all files in CVS directories that can be located - anywhere in the directory tree.
- Matches: -
-      CVS/Repository
-      org/apache/CVS/Entries
-      org/apache/jakarta/tools/ant/CVS/Entries
-      
- But not: -
-      org/apache/CVS/foo/bar/Entries (foo/bar/ part does not match)
org/apache/jakarta/**Matches all files in the org/apache/jakarta directory tree.
- Matches: -
-      org/apache/jakarta/tools/ant/docs/index.html
-      org/apache/jakarta/test.xml
-      
- But not: -
-      org/apache/xyz.java
-      
- (jakarta/ part is missing).
org/apache/**/CVS/*Matches all files in CVS directories - that are located anywhere in the directory tree under - org/apache.
- Matches: -
-      org/apache/CVS/Entries
-      org/apache/jakarta/tools/ant/CVS/Entries
-      
- But not: -
-      org/apache/CVS/foo/bar/Entries
-      
- (foo/bar/ part does not match)
**/test/**Matches all files that have a test - element in their path, including test as a filename.
-

When these patterns are used in inclusion and exclusion, you have a powerful -way to select just the files you want.

- -

Examples

-
  
-<copy todir="${dist}">
-  <fileset dir="${src}" 
-           includes="**/images/*" 
-           excludes="**/*.gif" 
-  />
-</copy>
-

This copies all files in directories called images that are -located in the directory tree defined by ${src} to the -destination directory defined by ${dist}, -but excludes all *.gif files from the copy.

-

This example can also be expressed using nested elements: -

-<copy todir="${dist}">
-  <fileset dir="${src}"/>
-    <include name="**/images/*"/>
-    <exclude name="**/*.gif"/>
-  </fileset>
-</copy>
-
- -

Default Excludes

-

There are a set of definitions that are excluded by default from all directory-based tasks. -They are: -

-     **/*~
-     **/#*#
-     **/%*%
-     **/CVS
-     **/CVS/**
-     **/.cvsignore
-
-If you do not want these default excludes applied, you may disable them with the -defaultexcludes="no" attribute. -

PatternSets

-

Patterns can be grouped to sets and later be referenced by their -id -attribute. They are defined via a patternset element, -which can appear nested into a FileSet or a -directory-based task that constitutes an implicit FileSet. In addition, -patternsets can be defined at the same level as -target — i.e., as children of project.

-

Patterns can be specified by nested <include> or -<exclude> elements or the following attributes.

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescription
includescomma-separated list of patterns of files that must be - included. All files are included when omitted.
includesfilethe name of a file; each line of this file is - taken to be an include pattern.
excludescomma-separated list of patterns of files that must be - excluded; no files (except default excludes) are excluded when omitted.
excludesfilethe name of a file; each line of this file is - taken to be an exclude pattern.
- -

Examples

-
-<patternset id="non.test.sources" >
-  <include name="**/*.java"/>
-  <exclude name="**/*Test*"/>
-</patternset>
-
-

Builds a set of patterns that matches all .java files -that do not contain the text Test in their name. This set -can be referred to via -<patternset refid="non.test.sources"/>, -by tasks that support this feature, or by FileSets.

-

Note that while the includes and -excludes attributes accept -multiple elements separated by commas or spaces, the nested -<include> and <exclude> elements expect their name -attribute to hold a single pattern.

-

The nested <include> and <exclude> elements allow you to use -if and unless arguments to specify that the element should only be used if a -property is set, or that it should be used only if a property is not set.

-

For example

-
-<patternset id="sources" >
-  <include name="std/**/*.java"/>
-  <include name="prof/**/*.java" if="professional"/>
-  <exclude name="**/*Test*"/>
-</patternset>
-
-

will only include the files in the sub-directory prof if the property -professional is set to some value.

- -

FileSets

-

FileSets are groups of files. These files can be found in a -directory tree starting in a base directory and are matched by -patterns taken from a number of PatternSets. FileSets can appear inside tasks -that support this feature or at the same level as target -– i.e., as children of project.

-

PatternSets can be specified as nested -<patternset> -elements. In addition, FileSet holds an implicit PatternSet and -supports the nested <include> and -<exclude> elements of PatternSet directly, as well -as PatternSet's attributes.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
dirthe root of the directory tree of this FileSet.Yes
defaultexcludesindicates whether default excludes should be used or not - (yes | no); default excludes are used when omitted.No
includescomma-separated list of patterns of files that must be - included; all files are included when omitted.No
includesfilethe name of a file; each line of this file is - taken to be an include pattern.No
excludescomma-separated list of patterns of files that must be - excluded; no files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file; each line of this file is - taken to be an exclude pattern.No
- -

Examples

-
-<fileset dir="${server.src}" >
-  <patternset id="non.test.sources" >
-    <include name="**/*.java"/>
-    <exclude name="**/*Test*"/>
-  </patternset>
-</fileset>
-
-

Groups all files in directory ${server.src} that are Java -source files and don't have the text Test in their -name.

-
-<fileset dir="${client.src}" >
-  <patternset refid="non.test.sources"/>
-</fileset>
-
-

Groups all files in directory ${client.src}, using the -same patterns as the example above.

- -

Mapping File Names

-

Some tasks take source files and create target files. Depending on -the task, it may be quite obvious which name a target file will have -(using javac, you know there will be -.class files for your .java files) – in -other cases you may want to specify the target files, either to help -Ant or to get an extra bit of functionality.

-

While source files are usually specified as filesets, you don't specify target files directly – -instead, you tell Ant how to find the target file(s) for one source file. An -instance of org.apache.tools.ant.util.FileNameMapper is -responsible for this. It constructs target file names based on rules -that can be parameterized with from and to -attributes – the exact meaning of which is implementation-dependent.

-

These instances are defined in <mapper> elements -with the following attributes:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
typespecifies one of the built-in implementations.Exactly one of both
classnamespecifies the implementation by class name.
classpaththe classpath to use when looking up - classname.No
classpathrefthe classpath to use, given as reference to a path defined elsewhere.No
fromthe from attribute for the given - implementation.Depends on implementation.
tothe to attribute for the given - implementation.Depends on implementation.
-

The classpath can be specified via a nested -<classpath>, as well – that is, -a path-like structure.

-

The built-in mapper types are:

-

identity

-

The target file name is identical to the source file name. Both -to and from will be ignored.

-Examples: -
-<mapper type="identity"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaA.java
foo/bar/B.javafoo/bar/B.java
C.propertiesC.properties
Classes/dir/dir2/A.propertiesClasses/dir/dir2/A.properties
-

flatten

-

The target file name is identical to the source file name, with all -leading directory information stripped off. Both to and -from will be ignored.

-Examples: -
-<mapper type="flatten"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaA.java
foo/bar/B.javaB.java
C.propertiesC.properties
Classes/dir/dir2/A.propertiesA.properties
-

merge

-

The target file name will always be the same, as defined by -tofrom will be ignored.

-
Examples:
-
-<mapper type="merge" to="archive.tar"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaarchive.tar
foo/bar/B.javaarchive.tar
C.propertiesarchive.tar
Classes/dir/dir2/A.propertiesarchive.tar
-

glob

-

Both to and from define patterns that may -contain at most one *. For each source file that matches -the from pattern, a target file name will be constructed -from the to pattern by substituting the * in -the to pattern with the text that matches the -* in the from pattern. Source file names -that don't match the from pattern will be ignored.

-Examples: -
-<mapper type="glob" from="*.java" to="*.java.bak"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaA.java.bak
foo/bar/B.javafoo/bar/B.java.bak
C.propertiesignored
Classes/dir/dir2/A.propertiesignored
-
-<mapper type="glob" from="C*ies" to="Q*y"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaignored
foo/bar/B.javaignored
C.propertiesQ.property
Classes/dir/dir2/A.propertiesQlasses/dir/dir2/A.property
-

regexp

-

Both to and from define regular -expressions. If the source file name matches the from -pattern, the target file name will be constructed from the -to pattern, using \0 to \9 as -back-references for the full -match (\0) or the matches of the subexpressions in -parentheses. -Source -files not matching the from pattern will be ignored.

-

Note that you need to escape a dollar-sign ($) with -another dollar-sign in Ant.

-

The regexp mapper needs a supporting library and an implementation -of org.apache.tools.ant.util.regexp.RegexpMatcher that -hides the specifics of the library. Ant comes with implementations for -jakarta-regexp and jakarta-ORO. If you compile -from sources and plan to use one of them, make sure the libraries are -in your CLASSPATH. For information about using gnu.regexp or gnu.rex with Ant, see this -article.

-

Ant will choose the regular-expression library based on the -following algorithm: -

    -
  • If the system property -ant.regexp.matcherimpl has been set, it is taken as the -name of the class implementing -org.apache.tools.ant.util.regexp.RegexpMatcher that -should be used.
  • -
  • If it has not been set, first try jakarta-ORO; if that -cannot be found, try jakarta-regexp.
  • -
-

-Examples: -
-<mapper type="regexp" from="^(.*)\.java$$" to="\1.java.bak"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaA.java.bak
foo/bar/B.javafoo/bar/B.java.bak
C.propertiesignored
Classes/dir/dir2/A.propertiesignored
-
-<mapper type="regexp" from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\2/\2-\3"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaignored
foo/bar/B.javafoo/bar/bar-B.java
C.propertiesignored
Classes/dir/dir2/A.propertiesClasses/dir/dir2/dir2-A.properties
-
-<mapper type="regexp" from="^(.*)\.(.*)$$" to="\2.\1"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javajava.A
foo/bar/B.javajava.foo/bar/B
C.propertiesproperties.C
Classes/dir/dir2/A.propertiesproperties.Classes/dir/dir2/A
- -
-

Built-in Tasks

- -
-

Ant

-

Description

-

Runs Ant on a supplied buildfile. This can be used to build subprojects.

-

When the antfile attribute is omitted, the file "build.xml" -in the supplied directory (dir attribute) is used.

-

If no target attribute is supplied, the default target of the new project is -used.

-

The properties of the current project will be available in the new project. -These properties will override the properties that are set in the new project. -(See also the properties task). You can set properties -in the new project from the old project by using nested property tags. This -allows you to parameterize your subprojects.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
antfilethe buildfile to use. Defaults to "build.xml".No
dirthe directory to use as a basedir for the new Ant project. - Defaults to the current directory.No
targetthe target of the new Ant project that should be executed.No
outputFilename to write the ant output to. - No
-

Examples

-
-  <ant antfile="subproject/subbuild.xml" dir="subproject" target="compile"/>
-
-  <ant dir="subproject"/>
-
-  <ant antfile="subproject/property_based_subbuild.xml">
-    <property name="param1" value="version 1.x"/>
-    <property file="config/subproject/default.properties"/>
-  </ant>
-
-
-

AntCall

-

Description

-

Call another target within the same build-file optionally specifying some -properties (param's in this context)

-

Parameters

- - - - - - - - - - - -
AttributeDescriptionRequired
targetThe target to execute.Yes
-

Parameters specified as nested elements

-

param

-

Specifies the properties to set before running the specified target. See property for usage guidelines.

-

Examples

-
-  <target name="default">
-    <antcall target="doSomethingElse">
-      <param name="param1" value="value"/>
-    </antcall>
-  </target>
-
-  <target name="doSomethingElse">
-    <echo message="param1=${param1}"/>
-  </target>
-
-

Will run the target 'doSomethingElse' and echo 'param1=value'.

-
-

AntStructure

-

Description

-

Generates a DTD for Ant buildfiles which contains information -about all tasks currently known to Ant.

-

Note that the DTD generated by this task is incomplete, you can -always add XML entities using <taskdef>. See here for -a way to get around this problem.

-

This task doesn't know about required attributes, all will be -listed as #IMPLIED.

-

Parameters

- - - - - - - - - - - -
AttributeDescriptionRequired
outputfile to write the DTD to.Yes
-

Examples

-
-<antstructure output="project.dtd"/>
-
-
-

Apply

-

Description

-

Executes a system command. When the os attribute is specified, then -the command is only executed when Ant is run on one of the specified operating -systems.

-

The files and/or directories of a number of FileSets are passed as arguments to the system -command. The timestamp of each source file is compared to the -timestamp of a target file which is defined by a nested mapper element. At least one fileset and exactly -one mapper element are required.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
executablethe command to execute without any command line - arguments.Yes
destthe directory where the target files will be placed.Yes
dirthe directory in which the command should be executed.No
oslist of Operating Systems on which the command may be - executed.No
outputthe file to which the output of the command should be - redirected.No
timeoutStop the command if it doesn't finish within the - specified time (given in milliseconds).No
failonerrorStop the buildprocess if the command exits with a - returncode other than 0.No
parallelRun the command only once, appending all files as - arguments. If false, command will be executed once for every file. - Defaults to false. No
typeOne of file, dir or - both. If set to file, only the names of plain - files will be sent to the command. If set to dir, only - the names of directories are considered.No, default is file
-

Parameters specified as nested elements

-

fileset

-

You can use any number of nested <fileset> -elements to define the files for this task and refer to -<fileset>s defined elsewhere.

-

arg

-

Command line arguments should be specified as nested -<arg> elements. See Command line arguments.

-

srcfile

-

By default the file names of the source files will be added to the -end of the command line. If you need to place it somewhere different, -use a nested <srcfile> element between your -<arg> elements to mark the insertion point. -

targetfile

-

<targetfile> is similar to -<srcfile> and marks the position of the target -filename on the command line. If omitted, the target filenames will -not be added to the command line at all.

-

env

-

It is possible to specify environment variables to pass to the -system command via nested <env> elements. See the -description in the section about exec

-

Please note that the environment of the current Ant process is -not passed to the system command if you specify variables using -<env>.

-

Examples

-
-<apply executable="cc" dest="src/C" parallel="false">
-  <arg value="-c"/>
-  <arg value="-o"/>
-  <targetfile/>
-  <srcfile/>
-  <fileset dir="src/C" includes="*.c"/>
-  <mapper type="glob" from="*.c" to="*.o"/>
-</apply>
-
-

invokes cc -c -o TARGETFILE SOURCEFILE for each -.c file that is newer than the corresponding -.o, replacing TARGETFILE with the absolute filename of -the .o and SOURCEFILE with the absolute name of the -.c file.

-
-

Available

-

Description

-

Sets a property if a resource is available at runtime. This resource can be a -file resource, a class in classpath or a JVM system resource.

-

If the resource is present, the property value is set to true by -default, otherwise the property is not set. You can set the value to -something specific by using the value attribute.

-

Normally, this task is used to set properties that are useful to avoid target -execution depending on system parameters.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
propertythe name of the property to set.Yes
valuethe value to set the property to. Defaults to "true".No
classnamethe class to look for in classpath.Yes
resourcethe resource to look for in the JVM
filethe file to look for.
classpath the classpath to - use when looking up classname. No
classpathrefthe classpath to use, given as reference to a path defined elsewhere.No
-

Parameters specified as nested elements

-

classpath

-

Available's classpath attribute is a path-like structure and can also be set via a nested -classpath element.

-

Examples

-
  <available classname="org.whatever.Myclass" property="Myclass.present"/>
-

sets the property Myclass.present to the value "true" -if the class org.whatever.Myclass is found in Ant's classpath.

-
-<property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/>
-<available file="${jaxp.jar}" property="jaxp.jar.present"/>
-
-

sets the property jaxp.jar.present to the value "true" -if the file ./lib/jaxp11/jaxp.jar is found.

-
-...in project ...
-<property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/>
-<path id="jaxp" location="${jaxp.jar}"/>
-...in target ...
-<available classname="javax.xml.transform.Transformer" classpathref="jaxp" property="jaxp11.present"/>
-
-

sets the property jaxp11.present to the value "true" -if the class javax.xml.transform.Transformer is found in the classpath referenced by jaxp (in this case, it is ./lib/jaxp11/jaxp.jar). -

-
-

Chmod

-

Description

-

Changes the permissions of a file or all files inside specified directories. Right now it has effect only under Unix. -The permissions are also UNIX style, like the argument for the chmod command.

-

See the section on directory based -tasks, on how the inclusion/exclusion of files works, and how to -write patterns.

-

This task holds an implicit FileSet and -supports all of FileSet's attributes and nested elements -directly. More FileSets can be specified using nested -<fileset> elements.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
filethe file or single directory of which the permissions - must be changed.exactly one of the two or nested <fileset> elements.
dirthe directory which holds the files whose permissions - must be changed.
permthe new permissions.Yes
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
parallelprocess all specified files using a single - chmod command. Defaults to true.No
typeOne of file, dir or - both. If set to file, only the permissions of - plain files are going to be changed. If set to dir, only - the directories are considered.No, default is file
-

Examples

-
-

<chmod file="${dist}/start.sh" perm="ugo+rx"/>

-
-

makes the "start.sh" file readable and executable for anyone on a -UNIX system.

-
-
-    <chmod dir="${dist}/bin" perm="ugo+rx" includes="**/*.sh"/>
-
-
-

makes all ".sh" files below ${dist}/bin -readable and executable for anyone on a UNIX system.

-
-
-<chmod perm="g+w">
-  <fileset dir="shared/sources1">
-    <exclude name="**/trial/**"/>
-  </fileset>
-  <fileset refid="other.shared.sources"/>
-</chmod>
-
-
-

makes all files below shared/sources1 (except those -below any directory named trial) writable for members of the same -group on a UNIX system. In addition all files belonging to a FileSet -with id other.shared.sources get the same -permissions.

-
-

Copy

-

Description

-

Copies a file or Fileset to a new file or directory. Files are -only copied if the source file is newer than the destination file, -or when the destination file does not exist. However, you can explicitly -overwrite files with the overwrite attribute.

-

FileSets are used to select files to copy. -To use a fileset, the todir attribute must be set.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
fileThe file to copy.One of either file or - at least one nested fileset element.
preservelastmodifiedGive the copied files the same last modified - time as the original files. Defaults to "no".No
tofileThe file to copy to.With the file attribute, - either tofile or todir can be used. With nested filesets, - only todir is allowed.
todirThe directory to copy to.
overwriteOverwrite existing files even if the destination - files are newer. Defaults to "no".No
filteringIndicates whether token filtering should take place during - the copy. Defaults to "no".No
flattenIgnore directory structure of source directory, - copy all files into a single directory, specified by the todir - attribute. Defaults to "no". Note that you can achieve the - same effect by using a flatten mapperNo
includeEmptyDirsCopy empty directories included with the nested FileSet(s). - Defaults to "yes".No
-

Parameters specified as nested elements

-

mapper

-

You can define file name transformations by using a nested mapper element. The default mapper used by -<copy> is the identity.

-

Examples

-

Copy a single file

-
-  <copy file="myfile.txt" tofile="mycopy.txt"/>
-
-

Copy a file to a directory

-
-  <copy file="myfile.txt" todir="../some/dir/tree"/>
-
-

Copy a directory to another directory

-
-  <copy todir="../new/dir">
-    <fileset dir="src_dir"/>
-  </copy>
-
-

Copy a set of files to a directory

-
-  <copy todir="../dest/dir" >
-    <fileset dir="src_dir" >
-      <exclude name="**/*.java"/>
-    </fileset>
-  </copy>
-
-  <copy todir="../dest/dir" >
-    <fileset dir="src_dir" excludes="**/*.java"/>
-  </copy>
-
-

Copy a set of files to a directory appending -".bak" to the file name on the fly

-
-  <copy todir="../backup/dir" >
-    <fileset dir="src_dir" />
-    <mapper type="glob" from="*" to="*.bak"/>
-  </copy>
-
-
-

Copydir

-

Deprecated

-

This task has been deprecated. Use the Copy task instead.

-

Description

-

Copies a directory tree from the source to the destination.

-

It is possible to refine the set of files that are being copied. This can be -done with the includes, includesfile, excludes, excludesfile and defaultexcludes -attributes. With the includes or includesfile attribute you specify the files you want to -have included by using patterns. The exclude or excludesfile attribute is used to specify -the files you want to have excluded. This is also done with patterns. And -finally with the defaultexcludes attribute, you can specify whether you -want to use default exclusions or not. See the section on directory based tasks, on how the -inclusion/exclusion of files works, and how to write patterns.

-

This task forms an implicit FileSet and -supports all attributes of <fileset> -(dir becomes src) as well as the nested -<include>, <exclude> and -<patternset> elements.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
srcthe directory to copy.Yes
destthe directory to copy to.Yes
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
filteringindicates whether token filtering should take place during - the copyNo
flattenignore directory structure of source directory, - copy all files into a single directory, specified by the dest - attribute (default is false).No
forceoverwriteoverwrite existing files even if the destination - files are newer (default is false).No
-

Examples

-
  <copydir src="${src}/resources"
-           dest="${dist}"
-  />
-

copies the directory ${src}/resources to ${dist}.

-
  <copydir src="${src}/resources"
-           dest="${dist}"
-           includes="**/*.java"
-           excludes="**/Test.java"
-  />
-

copies the directory ${src}/resources to ${dist} -recursively. All java files are copied, except for files with the name Test.java.

-
  <copydir src="${src}/resources"
-           dest="${dist}"
-           includes="**/*.java"
-           excludes="mypackage/test/**"/>
-

copies the directory ${src}/resources to ${dist} -recursively. All java files are copied, except for the files under the mypackage/test -directory.

-
-

Copyfile

-

Deprecated

-

This task has been deprecated. Use the Copy task instead.

-

Description

-

Copies a file from the source to the destination. The file is only copied if -the source file is newer than the destination file, or when the destination file -does not exist.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
srcthe filename of the file to copy.Yes
destthe filename of the file where to copy to.Yes
filteringindicates whether token filtering should take place during - the copyNo
forceoverwriteoverwrite existing files even if the destination - files are newer (default is false).No
-

Examples

-
-

<copyfile src="test.java" dest="subdir/test.java" - />

-

<copyfile src="${src}/index.html" dest="${dist}/help/index.html" - />

-
-
-

Cvs

-

Description

-

Handles packages/modules retrieved from a -CVS repository.

-

When doing automated builds, the get task should be -preferred over the checkout command, because of speed.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
commandthe CVS command to execute.No, default "checkout"
cvsRootthe CVSROOT variable.No
destthe directory where the checked out files should be placed.No, default is project's basedir.
packagethe package/module to check out.No
tagthe tag of the package/module to check out.No
dateUse the most recent revision no later than the given dateNo
quietsuppress informational messages.No, default "false"
noexecreport only, don't change any files.No, default "false"
outputthe file to direct standard output from the command.No, default output to ANT Log as MSG_INFO.
errorthe file to direct standard error from the command.No, default error to ANT Log as MSG_WARN.
-

Examples

-
  <cvs cvsRoot=":pserver:anoncvs@jakarta.apache.org:/home/cvspublic"
-       package="jakarta-tools"
-       dest="${ws.dir}"
-  />
-

checks out the package/module "jakarta-tools" from the CVS -repository pointed to by the cvsRoot attribute, and stores the files in "${ws.dir}".

-
  <cvs dest="${ws.dir}" command="update"/>
-

updates the package/module that has previously been checked out into -"${ws.dir}".

-
  <cvs command="-q diff -u -N" output="patch.txt"/>
-

silently (-q) creates a file called patch.txt which contains a unified (-u) diff which includes new files added via "cvs add" (-N) and can be used as input to patch.

-
  <cvs command="update -A -d"/>
-

Updates from the head of repository ignoring sticky bits (-A) and creating any new directories as necessary (-d).

-

Note: the text of the command is passed to cvs "as-is" so any cvs options should appear before the command, and any command options should appear after the command as in the diff example above. See the cvs manual for details, specifically the Guide to CVS commands

-
-

Delete

-

Description

-

Deletes either a single file, all files in a specified directory and its -sub-directories, or a set of files specified by one or more FileSets. -When specifying a set of files, empty directories are not removed by default. -To remove empty directories, use the includeEmptyDirs atribute.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
fileThe file to delete.at least one of the two
dirThe directory to delete files from.
verboseShow name of each deleted file ("true"/"false"). - Default is "false" when omitted.No
quietIf the file does not exist, do not display a diagnostic - message or modify the exit status to reflect an error. - This means that if a file or directory cannot be deleted, - then no error is reported. This setting emulates the - -f option to the Unix "rm" command. - ("true"/"false"). - Default is "false" meaning things are "noisy".No
includeEmptyDirsSet to "true" to delete empty directores when - using filesets. Default is "false".No
includesDeprecated. Comma separated list of patterns of files that must be - deleted. All files are in the current directory - and any sub-directories are deleted when omitted.No
includesfileDeprecated. The name of a file. Each line of this file is - taken to be an include patternNo
excludesDeprecated. Comma separated list of patterns of files that must be - excluded from the deletion list. No files (except default excludes) are excluded when omitted.No
excludesfileDeprecated. The name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesDeprecated. Indicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
-

Examples

-
  <delete file="/lib/ant.jar"/>
-

deletes the file /lib/ant.jar.

-
  <delete dir="lib"/>
-

deletes the lib directory, including all files -and subdirectories of lib.

-
  <delete>
-    <fileset dir="." includes="**/*.bak"/>
-  </delete>
-
-

deletes all files with the extension ".bak" from the current directory -and any sub-directories.

-
  <delete includeEmptyDirs="true" >
-    <fileset dir="build" />
-  </delete>
-
-

deletes all files and subdirectories of build, but not -build itself.

-


-

Deltree

-

Deprecated

-

This task has been deprecated. Use the Delete task instead.

-

Description

-

Deletes a directory with all its files and subdirectories.

-

Parameters

- - - - - - - - - - - -
AttributeDescriptionRequired
dirthe directory to delete.Yes
-

Examples

-
  <deltree dir="dist"/>
-

deletes the directory dist, including its files and -subdirectories.

-
  <deltree dir="${dist}"/>
-

deletes the directory ${dist}, including its files and -subdirectories.

-
-

Echo

-

Description

-

Echoes a message to System.out or a file.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
messagethe message to echo.Yes, unless data is included in a - character section within this element.
filethe file to write the message to.No
appendAppend to an existing file?No – default is false.
-

Examples

-
  <echo message="Hello world"/>
-
  
-<echo>
-This is a longer message stretching over
-two lines.
-</echo>
-
-
-

Exec

-

Description

-

Executes a system command. When the os attribute is specified, then -the command is only executed when Ant is run on one of the specified operating -systems.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
commandthe command to execute with all command line - arguments. deprecated, use executable and nested - <arg> elements instead.Exactly one of the two.
executablethe command to execute without any command line - arguments.
dirthe directory in which the command should be executed.No
oslist of Operating Systems on which the command may be - executed.No
outputthe file to which the output of the command should be - redirected.No
timeoutStop the command if it doesn't finish within the - specified time (given in milliseconds).No
failonerrorStop the buildprocess if the command exits with a - returncode other than 0.No
newenvironmentDo not propagate old environment when new environment - variables are specified.No, default is false
-

Examples

-
-

-

-<exec dir="${src}" executable="cmd.exe" os="Windows 2000" output="dir.txt">
-  <arg line="/c dir"/>
-</exec>

-
-

Parameters specified as nested elements

-

arg

-

Command line arguments should be specified as nested -<arg> elements. See Command line arguments.

-

env

-

It is possible to specify environment variables to pass to the -system command via nested <env> elements.

-

Please note that the environment of the current Ant process is -not passed to the system command if you specify variables using -<env>.

- - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
keyThe name of the environment variable.Yes
valueThe literal value for the environment variable.Exactly one of these.
pathThe value for a PATH like environment - variable. You can use ; or : as path separators and Ant will - convert it to the platform's local conventions.
fileThe value for the environment variable. Will be - replaced by the absolute filename of the file by Ant.
-
Examples
-
-<exec executable="emacs" >
-  <env key="DISPLAY" value=":1.0"/>
-</exec>
-
-

starts emacs on display 1 of the X Window System.

-
-<exec ... >
-  <env key="PATH" path="${java.library.path}:${basedir}/bin"/>
-</exec>
-
-

adds ${basedir}/bin to the PATH of the -system command.

-

Note: Although it may work for you to specify arguments using -a simple arg-element and seperate them by spaces it may fail if you switch to -a newer version of the JDK. JDK < 1.2 will pass these as separate arguments -to the program you are calling, JDK >= 1.2 will pass them as a single -argument and cause most calls to fail.

-

Note2: If you are using Ant on Windows and a new DOS-Window pops up -for every command which is excuted this may be a problem of the JDK you are using. -This problem may occur with all JDK's < 1.2.

-
-

ExecOn

-

Description

-

Executes a system command. When the os attribute is specified, then -the command is only executed when Ant is run on one of the specified operating -systems.

-

The files and/or directories of a number of FileSets are passed as arguments to the system -command. At least one nested <fileset> is required.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
executablethe command to execute without any command line - arguments.Yes
dirthe directory in which the command should be executed.No
oslist of Operating Systems on which the command may be - executed.No
outputthe file to which the output of the command should be - redirected.No
timeoutStop the command if it doesn't finish within the - specified time (given in milliseconds).No
failonerrorStop the buildprocess if the command exits with a - returncode other than 0.No
newenvironmentDo not propagate old environment when new environment - variables are specified.No, default is false
parallelRun the command only once, appending all files as - arguments. If false, command will be executed once for every file. - Defaults to false. No
typeOne of file, dir or - both. If set to file, only the names of plain - files will be sent to the command. If set to dir, only - the names of directories are considered.No, default is file
-

Parameters specified as nested elements

-

fileset

-

You can use any number of nested <fileset> -elements to define the files for this task and refer to -<fileset>s defined elsewhere.

-

arg

-

Command line arguments should be specified as nested -<arg> elements. See Command line arguments.

-

srcfile

-

By default the file names of the source files will be added to the -end of the command line. If you need to place it somewhere different, -use a nested <srcfile> element between your -<arg> elements to mark the insertion point. -

env

-

It is possible to specify environment variables to pass to the -system command via nested <env> elements. See the -description in the section about exec

-

Please note that the environment of the current Ant process is -not passed to the system command if you specify variables using -<env>.

-

Examples

-
-<execon executable="ls" >
-  <arg value="-l"/>
-  <fileset dir="/tmp">
-    <patternset>
-      <exclude name="**/*.txt"/>
-    </patternset>
-  </fileset>
-  <fileset refid="other.files"/>
-</execon>
-
-

invokes ls -l, adding the absolute filenames of all -files below /tmp not ending in .txt and all -files of the FileSet with id other.files to -the command line.

-
-<execon executable="somecommand" parallel="false" >
-  <arg value="arg1"/>
-  <srfile/>
-  <arg value="arg2"/>
-  <fileset dir="/tmp"/>
-</execon>
-
-

invokes somecommand arg1 SOURCEFILENAME arg2 for each -file in /tmp replacing SOURCEFILENAME with the absolute -filename of each file in turn. If parallel had been set -to true, SOURCEFILENAME would be replaced with the absolute filenames -of all files separated by spaces.

-
-

Fail

-

Description

-

Exits the current build (just throwing a BuildException), optionally printing additional information.

-

Parameters

- - - - - - - - - - - -
AttributeDescriptionRequired
messageA message giving further information on why the build exitedNo
-

Examples

-
  <fail/>
-

will exit the current build with no further information given. -

-BUILD FAILED
-
-build.xml:4: No message
-
- -
  <fail message="Something wrong here."/>
-

will exit the current build and print something like the following to whereever -your output goes: -

-BUILD FAILED
-
-build.xml:4: Something wrong here.
-
- -
-

Filter

-

Description

-

Sets a token filter for this project or read multiple token filter from -an input file and sets these as filters. -Token filters are used by all tasks that perform file copying operations -through the Project commodity methods.

-

Note 1: the token string must not contain the separators chars (@).
-Note 2: Either token and value attributes must be provided, or only the -filterfile attribute.

- -

Parameters

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
tokenthe token string without @Yes*
valuethe string that should be put to replace the token when the - file is copiedYes*
filtersfileThe file from which the filters must be read. This file must be a formatted as a property file. Yes*
-

* see notes 1 and 2 above parameters table.

-

Examples

-
  <filter token="year" value="2000"/>
-  <copy todir="${dest.dir}">
-    <fileset dir="${src.dir}"/>
-  </copy>
-

will copy recursively all the files from the src.dir directory into -the dest.dir directory replacing all the occurencies of the string @year@ -with 2000.

-
  <filter filterfile="deploy_env.properties"/>
-will read all property entries from the deploy_env.properties file -and set these as filters. - -
-

FixCRLF

-

Description

-

Adjusts a text file to local.

-

It is possible to refine the set of files that are being adjusted. This can be -done with the includes, includesfile, excludes, excludesfile and defaultexcludes -attributes. With the includes or includesfile attribute you specify the files you want to -have included by using patterns. The exclude or excludesfile attribute is used to specify -the files you want to have excluded. This is also done with patterns. And -finally with the defaultexcludes attribute, you can specify whether you -want to use default exclusions or not. See the section on directory based tasks, on how the -inclusion/exclusion of files works, and how to write patterns.

-

This task forms an implicit FileSet and -supports all attributes of <fileset> -(dir becomes srcdir) as well as the nested -<include>, <exclude> and -<patternset> elements.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
srcDirWhere to find the files to be fixed up.Yes
destDirWhere to place the corrected files. Defaults to - srcDir (replacing the original file)No
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
crSpecifies how carriage return (CR) characters are to - be handled. Valid values for this property are: -
    -
  • add: ensure that there is a CR before every LF -
  • asis: leave CR characters alone -
  • remove: remove all CR characters -
- Default is based on the platform on which you are running this task. - For Unix platforms, the default is remove. For DOS based systems - (including Windows), the default is add. -

- Note: Unless this property is specified as "asis", extra CR characters - which do not precede a LF will be removed. -

No
tabSpecifies how tab characters are to be handled. Valid - values for this property are: -
    -
  • add: convert sequences of spaces which span a tab stop to tabs -
  • asis: leave tab and space characters alone -
  • remove: convert tabs to spaces -
- Default for this parameter is "asis". -

- Note: Unless this property is specified as "asis", extra spaces and - tabs after the last non-whitespace character on the line will be removed. -

No
tablengthThe number of characters a TAB stop corresponds to. - Must be a positive power of 2, default for this parameter is 8.No
eofSpecifies how DOS end of file (control-Z) characters are - to be handled. Valid values for this property are: -
    -
  • add: ensure that there is an EOF character at the end of the file -
  • asis: leave EOF characters alone -
  • remove: remove any EOF character found at the end -
- Default is based on the platform on which you are running this task. - For Unix platforms, the default is remove. For DOS based systems - (including Windows), the default is asis. -
No
-

Examples

-
  <fixcrlf srcdir="${src}"
-       cr="remove" eof="remove"
-       includes="**/*.sh"
-  />
-

Removes carriage return and eof characters from the shell scripts. Tabs and -spaces are left as is. -

  <fixcrlf srcdir="${src}"
-       cr="add"
-       includes="**/*.bat"
-  />
-

Ensures that there are carriage return characters prior to evey line feed. -Tabs and spaces are left as is. -EOF characters are left alone if run on -DOS systems, and are removed if run on Unix systems.

-
  <fixcrlf srcdir="${src}"
-       tabs="add"
-       includes="**/Makefile"
-  />
-

Adds or removes CR characters to match local OS conventions, and -converts spaces to tabs when appropriate. EOF characters are left alone if -run on DOS systems, and are removed if run on Unix systems. -Many versions of make require tabs prior to commands.

-
  <fixcrlf srcdir="${src}"
-       tabs="remove"
-       includes="**/README*"
-  />
-

Adds or removes CR characters to match local OS conventions, and -converts all tabs to spaces. EOF characters are left alone if run on -DOS systems, and are removed if run on Unix systems. -You never know what editor a user will use to browse README's.

-
-

GenKey

-

Description

-

Generates a key in keystore.

- -

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
aliasthe alias to add underYes.
storepasspassword for keystore integrity.Yes.
keystorekeystore locationNo
storetypekeystore typeNo
keypasspassword for private key (if different)No
sigalgthe algorithm to use in signingNo
keyalgthe method to use when generating name-value pairNo
verbose(true | false) verbose output when signingNo
dnameThe distinguished name for entityYes if dname element unspecified
validity(integer) indicates how many days certificate is validNo
keysize(integer) indicates the size of key generatedNo
- -

Alternatively you can specify the distinguished name by creating a sub-element named dname and populating it with param elements that have a name and a value. When using the subelement it is automatically encoded properly and , are replace -

The following two examples are identical:

- -

Examples

-
-

<genkey alias="apache-group" storepass="secret" - dname="CN=Ant Group, OU=Jakarta Division, O=Apache.org, C=US"/>

-
- -
-
<genkey alias="apache-group" storepass="secret" >
-  <dname>
-    <param name="CN" value="Ant Group"/>
-    <param name="OU" value="Jakarta Division"/>
-    <param name="O"  value="Apache.Org"/>
-    <param name="C"  value="US"/>
-  </dname>
-</genkey>
-
-
-

Get

-

Description

-

Gets a file from a URL. When the verbose option is "on", this task -displays a '.' for every 100 Kb retrieved.

-

This task should be preferred above the CVS task when -doing automated builds. CVS is significantly slower than loading a compressed -archive with http/ftp.

- -The usetimestamp option enables you to control downloads so that the remote file is -only fetched if newer than the local copy. If there is no local copy, the download always takes -place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp, -if the JVM is Java1.2 or later. -NB: This timestamp facility only works on downloads using the HTTP protocol. -

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
srcthe URL from which to retrieve a file.Yes
destthe file where to store the retrieved file.Yes
verboseshow verbose progress information ("on"/"off").No
ignoreerrorsLog errors but don't treat as fatal.No
usetimestampconditionally download a file based on the timestamp of the local copy. - HTTP onlyNo
-

Examples

-
  <get src="http://jakarta.apache.org/" dest="help/index.html"/>
-

Gets the index page of http://jakarta.apache.org/, and stores it in the file help/index.html.

- -
  <get src="http://jakarta.apache.org/builds/tomcat/nightly/ant.zip" 
-	dest="optional.jar" 
-	verbose="true"
-	usetimestamp="true"/>
-

-Gets the nightly ant build from the tomcat distribution, if the local copy -is missing or out of date. Uses the verbose option -for progress information. -

- -
-

GUnzip

-

Description

-

Expands a GZip file.

- -

If dest is a directory the name of the destination file is -the same as src (with the ".gz" extension removed if -present). If dest is omitted, the parent dir of src is -taken. The file is only expanded if the source file is newer than the -destination file, or when the destination file does not exist.

- -

Parameters

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
srcthe file to expand.Yes
destthe destination file or directory.No
-

Examples

-
-

<gunzip src="test.tar.gz"/>

-
-

expands test.tar.gz to test.tar

-
-

<gunzip src="test.tar.gz" dest="test2.tar"/>

-
-

expands test.tar.gz to test2.tar

-
-

<gunzip src="test.tar.gz" dest="subdir"/>

-
-

expands test.tar.gz to subdir/test.tar (assuming -subdir is a directory).

- -
-

GZip

-

Description

-

GZips a file.

-

Parameters

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
srcthe file to gzip.Yes
zipfilethe destination file.Yes
-

Examples

-
-

<gzip src="test.tar" zipfile="test.tar.gz" - />

-
-
-

Jar

-

Description

-

Jars a set of files.

-

The basedir attribute is the reference directory from where to jar.

-

Note that file permissions will not be stored in the resulting jarfile.

-

It is possible to refine the set of files that are being jarred. This can be -done with the includes, includesfile, excludes, excludesfile and defaultexcludes -attributes. With the includes or includesfile attribute you specify the files you want to -have included by using patterns. The exclude or excludesfile attribute is used to specify -the files you want to have excluded. This is also done with patterns. And -finally with the defaultexcludes attribute, you can specify whether you -want to use default exclusions or not. See the section on directory based tasks, on how the -inclusion/exclusion of files works, and how to write patterns.

-

This task forms an implicit FileSet and -supports all attributes of <fileset> -(dir becomes basedir) as well as the nested -<include>, <exclude> and -<patternset> elements.

-

You can also use nested file sets for more flexibility, and specify -multiple ones to merge together different trees of files into one JAR. -The extended fileset attributes from the zip task are also available -in the jar task. -See the Zip task for more details and examples.

-

If the manifest is omitted, a simple one will be supplied by Ant. -You should not include META-INF/MANIFEST.MF in your set of files. -

The whenempty parameter controls what happens when no files match. -If create (the default), the JAR is created anyway with only a manifest. -If skip, the JAR is not created and a warning is issued. -If fail, the JAR is not created and the build is halted with an error. -

(The Jar task is a shortcut for specifying the manifest file of a JAR file. -The same thing can be accomplished by using the fullpath -attribute of a zipfileset in a Zip task. The one difference is that if the -manifest attribute is not specified, the Jar task will -include an empty one for you.)

-

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
jarfilethe jar-file to create.Yes
basedirthe directory from which to jar the files.No
compressNot only store data but also compress them, defaults to trueNo
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
manifestthe manifest file to use.No
whenemptyBehavior to use if no files match.No
-

Examples

-
  <jar jarfile="${dist}/lib/app.jar" basedir="${build}/classes"/>
-

jars all files in the ${build}/classes directory into a file -called app.jar in the ${dist}/lib directory.

-
  <jar jarfile="${dist}/lib/app.jar"
-       basedir="${build}/classes"
-       excludes="**/Test.class"
-  />
-

jars all files in the ${build}/classes directory into a file -called app.jar in the ${dist}/lib directory. Files -with the name Test.class are excluded.

-
  <jar jarfile="${dist}/lib/app.jar"
-       basedir="${build}/classes"
-       includes="mypackage/test/**"
-       excludes="**/Test.class"
-  />
-

jars all files in the ${build}/classes directory into a file -called app.jar in the ${dist}/lib directory. Only -files under the directory mypackage/test are used, and files with -the name Test.class are excluded.

-
  <jar jarfile="${dist}/lib/app.jar">
-    <fileset dir="${build}/classes"
-             excludes="**/Test.class"
-    />
-    <fileset dir="${src}/resources"/>
-  </jar>
-

jars all files in the ${build}/classes directory and also -in the ${src}/resources directory together into a file -called app.jar in the ${dist}/lib directory. -Files with the name Test.class are excluded. -If there are files such as ${build}/classes/mypackage/MyClass.class -and ${src}/resources/mypackage/image.gif, they will appear -in the same directory in the JAR (and thus be considered in the same package -by Java).

- -
-

Java

-

Description

-

Executes a Java class within the running (Ant) VM or forks another VM if -specified.

-

Be careful that the executed class doesn't call System.exit(), because it -will terminate the VM and thus Ant. In case this happens, it's highly suggested -that you set the fork attribute so that System.exit() stops the other VM and not -the one that is currently running Ant.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
classnamethe Java class to execute.Yes
argsthe arguments for the class that is - executed. deprecated, use nested <arg> - elements instead.No
classpaththe classpath to use.No
classpathrefthe classpath to use, given as reference to a PATH defined elsewhere.No
forkif enabled triggers the class execution in another VM - (disabled by default)No
jvmthe command used to invoke the Java Virtual Machine, - default is 'java'. The command is resolved by java.lang.Runtime.exec(). - Ignored if fork is disabled. - No
jvmargsthe arguments to pass to the forked VM (ignored - if fork is disabled). deprecated, use nested - <jvmarg> elements instead.No
maxmemoryMax amount of memory to allocate to the forked VM - (ignored if fork is disabled)No
failonerrorStop the buildprocess if the command exits with a - returncode other than 0. Only available if fork is true.No
dirThe directory to invoke the VM in. (ignored if - fork is disabled)No
outputName of a file to write the output to.No
-

Parameters specified as nested elements

-

arg and jvmarg

-

Use nested <arg> and <jvmarg> -elements to specify arguments for the or the forked VM. See Command line arguments.

-

sysproperty

-

Use nested <sysproperty> -elements to specify system properties required by the class. -These properties will be made available to the VM during the execution -of the class (either ANT's VM or the forked VM). The attributes -for this element are the same as for environment -variables.

-

classpath

-

Java's classpath attribute is a PATH like structure and can also be set via a nested -classpath element.

-
Example
-
  
-       <java classname="test.Main" >
-         <arg value="-h"/> 
-         <classpath>
-           <pathelement location="\test.jar"/>
-           <pathelement path="${java.class.path}"/>
-         </classpath>
-       </java>
-
-

Examples

-
  <java classname="test.Main"/>
-
  <java classname="test.Main"
-        fork="yes" >
-    <sysproperty key="DEBUG" value="true"/> 
-    <arg value="-h"/> 
-    <jvmarg value="-Xrunhprof:cpu=samples,file=log.txt,depth=3"/> 
-  </java>
-
- -
-

Javac

-

Description

-

Compiles a source tree within the running (Ant) VM.

-

The source and destination directory will be recursively scanned for Java -source files to compile. Only Java files that have no corresponding class file -or where the class file is older than the java file will be compiled.

-

The directory structure of the source tree should follow the package -hierarchy.

-

It is possible to refine the set of files that are being compiled/copied. -This can be done with the includes, includesfile, excludes, excludesfile and defaultexcludes -attributes. With the includes or includesfile attribute you specify the files you want to -have included by using patterns. The exclude or excludesfile attribute is used to specify -the files you want to have excluded. This is also done with patterns. And -finally with the defaultexcludes attribute, you can specify whether you -want to use default exclusions or not. See the section on directory based tasks, on how the -inclusion/exclusion of files works, and how to write patterns.

-

It is possible to use different compilers. This can be selected with the -"build.compiler" property. There are four choices:

-
    -
  • classic (the standard compiler of JDK 1.1/1.2)
  • -
  • modern (the new compiler of JDK 1.3)
  • -
  • jikes (the Jikes - compiler)
  • -
  • jvc (the Command-Line Compiler from Microsoft's SDK for Java / - Visual J++)
  • -
-

For JDK 1.1/1.2, classic is the default. For JDK 1.3, modern is the default. -If you wish to use a different compiler interface than one of the four -supplied, write a class that implements the CompilerAdapter interface -(package org.apache.tools.ant.taskdefs.compilers). Supply the full -classname in the "build.compiler" property. -

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
srcdirlocation of the java files.Yes, unless nested <src> elements are present.
destdirlocation to store the class files.No
includescomma-separated list of patterns of files that must be - included; all files are included when omitted.No
includesfilethe name of a file that contains - include patterns.No
excludescomma-separated list of patterns of files that must be - excluded; no files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file that contains - exclude patterns.No
defaultexcludesindicates whether default excludes should be used - (yes | no); default excludes are used when omitted.No
classpaththe classpath to use.No
bootclasspathlocation of bootstrap class files.No
classpathrefthe classpath to use, given as a - reference to a PATH defined elsewhere.No
bootclasspathreflocation of bootstrap class files, given as a - reference to a PATH defined elsewhere.No
extdirslocation of installed extensions.No
encodingencoding of source files.No
debugindicates whether source should be compiled with debug - information; defaults to off.No
optimizeindicates whether source should be compiled with - optimization; defaults to off.No
deprecationindicates whether source should be compiled with - deprecation information; defaults to off.No
targetgenerate class files for specific VM version (e.g., - 1.1 or 1.2).No
verboseasks the compiler for verbose output.No
depend enables dependency-tracking - for compilers that support this (jikes and classic)No
includeAntRuntimewhether to include the Ant run-time libraries; - defaults to no.No
includeJavaRuntimewhether to include the default run-time - libraries from the executing VM; defaults to no.No
failonerror - indicates whether the build will continue even if there are compilation errors; defaults to true. - No
- -

Parameters specified as nested elements

-

This task forms an implicit FileSet and -supports all attributes of <fileset> -(dir becomes srcdir) as well as the nested -<include>, <exclude> and -<patternset> elements.

-

src, classpath, bootclasspath and extdirs

-

Javac's srcdir, classpath, -bootclasspath and extdirs attributes are path-like structures and can also be set via nested -<src>, -<classpath>, -<bootclasspath> and -<extdirs> elements, respectively.

- -

Examples

-
  <javac srcdir="${src}"
-         destdir="${build}"
-         classpath="xyz.jar"
-         debug="on"
-  />
-

compiles all .java files under the ${src} -directory, and stores -the .class files in the ${build} directory. -The classpath used contains xyz.jar, and debug information is on.

-
  <javac srcdir="${src}"
-         destdir="${build}"
-         includes="mypackage/p1/**,mypackage/p2/**"
-         excludes="mypackage/p1/testpackage/**"
-         classpath="xyz.jar"
-         debug="on"
-  />
-

compiles .java files under the ${src} -directory, and stores the -.class files in the ${build} directory. -The classpath used contains xyz.jar, and debug information is on. -Only files under mypackage/p1 and mypackage/p2 are -used. Files in the mypackage/p1/testpackage directory are excluded -from compilation.

- -
  <javac srcdir="${src}:${src2}"
-         destdir="${build}"
-         includes="mypackage/p1/**,mypackage/p2/**"
-         excludes="mypackage/p1/testpackage/**"
-         classpath="xyz.jar"
-         debug="on"
-  />
- -

is the same as the previous example, with the addition of a second -source path, defined by -the property src2. This can also be represented using nested -<src> elements as follows: - -

  <javac destdir="${build}"
-         classpath="xyz.jar"
-         debug="on">
-    <src path="${src}"/>
-    <src path="${src2}"/>
-    <include name="mypackage/p1/**"/>
-    <include name="mypackage/p2/**"/>
-    <exclude name="mypackage/p1/testpackage/**"/>
-  </javac>
- -

Note: If you are using Ant on Windows and a new DOS window pops up -for every use of an external compiler, this may be a problem of the JDK you are using. -This problem may occur with all JDKs < 1.2.

- -
-

Javadoc/Javadoc2

-

Description

-

Generates code documentation using the javadoc tool.

-

The source directory will be recursively scanned for Java source files to process -but only those matching the inclusion rules will be passed to the javadoc tool. This -allows wildcards to be used to choose between package names, reducing verbosity -and management costs over time. This task, however, has no notion of -"changed" files, unlike the javac task. This means -all packages will be processed each time this task is run. In general, however, -this task is used much less frequently.

-

This task works seamlessly between different javadoc versions (1.1 and 1.2), -with the obvious restriction that the 1.2 attributes will be ignored if run in a -1.1 VM.

-

NOTE: since javadoc calls System.exit(), javadoc cannot be run inside the -same VM as ant without breaking functionality. For this reason, this task -always forks the VM. This overhead is not significant since javadoc is normally a heavy -application and will be called infrequently.

-

NOTE: the packagelist attribute allows you to specify the list of packages to -document outside of the Ant file. It's a much better practice to include everything -inside the build.xml file. This option was added in order to make it easier to -migrate from regular makefiles, where you would use this option of javadoc. -The packages listed in packagelist are not checked, so the task performs even -if some packages are missing or broken. Use this option if you wish to convert from -an existing makefile. Once things are running you should then switch to the regular -notation. - -

DEPRECATION: the javadoc2 task simply points to the javadoc task and it's -there for back compatibility reasons. Since this task will be removed in future -versions, you are strongly encouraged to use javadoc -instead.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionAvailabilityRequired
sourcepathSpecify where to find source filesallAt least one of the two or nested - <sourcepath>
sourcepathrefSpecify where to find source files by reference to a PATH defined elsewhere.all
destdirDestination directory for output filesallYes
maxmemoryMax amount of memory to allocate to the javadoc VMallNo
sourcefilesComma separated list of source filesallat least one of the two
packagenamesComma separated list of package files (with terminating - wildcard)all
packageListThe name of a file containing the packages to processallNo
classpathSpecify where to find user class filesallNo
BootclasspathOverride location of class files loaded by the bootstrap - class loader1.2No
classpathrefSpecify where to find user class files by reference to a PATH defined elsewhere.allNo
bootclasspathrefOverride location of class files loaded by the - bootstrap class loader by reference to a - PATH defined elsewhere.1.2No
ExtdirsOverride location of installed extensions1.2No
OverviewRead overview documentation from HTML file1.2No
PublicShow only public classes and membersallNo
ProtectedShow protected/public classes and members (default)allNo
PackageShow package/protected/public classes and membersallNo
PrivateShow all classes and membersallNo
OldGenerate output using JDK 1.1 emulating doclet1.2No
VerboseOutput messages about what Javadoc is doing1.2No
LocaleLocale to be used, e.g. en_US or en_US_WIN1.2No
EncodingSource file encoding nameallNo
VersionInclude @version paragraphsallNo
UseCreate class and package usage pages1.2No
AuthorInclude @author paragraphsallNo
SplitindexSplit index into one file per letter1.2No
WindowtitleBrowser window title for the documentation (text)1.2No
DoctitleInclude title for the package index(first) page (html-code)1.2No
HeaderInclude header text for each page (html-code)1.2No
FooterInclude footer text for each page (html-code)1.2No
bottomInclude bottom text for each page (html-code)1.2No
linkCreate links to javadoc output at the given URL1.2No
linkofflineLink to docs at <url> using package list at - <url2>1.2No
groupGroup specified packages together in overview page1.2No
nodeprecatedDo not include @deprecated informationallNo
nodeprecatedlistDo not generate deprecated list1.2No
notreeDo not generate class hierarchyallNo
noindexDo not generate indexallNo
nohelpDo not generate help link1.2No
nonavbarDo not generate navigation bar1.2No
serialwarnFUTURE: Generate warning about @serial tag1.2No
helpfileFUTURE: Specifies the HTML help file to use1.2No
stylesheetfileSpecifies the CSS stylesheet to use1.2No
charsetFUTURE: Charset for cross-platform viewing of generated - documentation1.2No
docencodingOutput file encoding name1.1No
docletSpecifies the class file that starts the doclet used in generating the documentation.1.2No
docletpathSpecifies the path to the doclet class file that is specified with the -doclet option.1.2No
docletpathrefSpecifies the path to the doclet class file that - is specified with the -doclet option by reference to a PATH defined elsewhere.1.2No
additionalparamLets you add additional parameters to the javadoc command line. Useful for doclets1.2No
failonerrorStop the buildprocess if the command exits with a - returncode other than 0.allNo
- -

Parameters specified as nested elements

-

link

-

Create link to javadoc output at the given URL. This performs the -same role as the link and linkoffline attributes. You can use either -syntax (or both at once), but with the nested elements you can easily -specify multiple occurrences of the arguments.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
hrefThe URL for the external documentation you wish to link toYes
offlineTrue if this link is not available online at the time of - generating the documentationNo
packagelistLocThe location to the directory containing the package-list file for - the external documentationOnly if the offline attribute is true
- -

groups

-

Separates packages on the overview page into whatever groups you -specify, one group per table. This performs the same role as the group -attribute. You can use either syntax (or both at once), but with the -nested elements you can easily specify multiple occurrences of the -arguments.

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
titleTitle of the groupYes
packagesList of packages to include in that groupYes
- -

doclet

-

The doclet nested element is used to specify the doclet that javadoc will -use to process the input source files. A number of the standard javadoc arguments -are actually arguments of the standard doclet. If these are specified in the javadoc -task's attributes, they will be passed to the doclet specified in the -<doclet> nested element. Such attributes should only be specified, -therefore, if they can be interpreted by the doclet in use. - -

If the doclet requires additional parameters, these can be specified with -<param> elements within the <doclet> -element. These paramaters are restricted to simple strings. An example usage -of the doclet element is shown below: - -

  <javadoc ...>
-     <doclet name="theDoclet"
-             path="path/to/theDoclet">
-        <param name="-foo" value="foovalue"/>
-        <param name="-bar" value="barvalue"/>
-     </doclet>
-  </javadoc>
-
- -

sourcepath, classpath and bootclasspath

-

Javadoc's sourcepath, classpath and -bootclasspath attributes are PATH like -structure and can also be set via nested sourcepath, -classpath and bootclasspath elements -respectively.

- -

Example

-
  <javadoc packagenames="com.dummy.test.*"
-           sourcepath="src"
-           destdir="docs/api"
-           author="true"
-           version="true"
-           use="true"
-           windowtitle="Test API"
-           doctitle="<h1>Test</h1>"
-           bottom="<i>Copyright &#169; 2000 Dummy Corp. All Rights Reserved.</i>">
-    <group title="Group 1 Packages" packages="com.dummy.test.a*"/>
-    <group title="Group 2 Packages" packages="com.dummy.test.b*"/>
-    <link offline="true" href="http://java.sun.com/products/jdk/1.2/docs/api/" packagelistLoc="C:\tmp"/>
-    <link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
-  </javadoc>
- -
-

Mail

-

Description

-

A task to send SMTP email.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
fromEmail address of sender.Yes
tolistComma-separated list of recipients.Yes
messageMessage to send in the body of the email.Yes
filesFilename(s) of text to send in the body of the email. - Multiple files are comma-separated.
mailhostHost name of the mail server.No, default to "localhost"
subjectEmail subject line.No
-

Examples

-
-  <mail from="me" tolist="you" subject="Results of nightly build"
-        files="build.log"/>
-

Sends an eMail from me to you with a subject of -Results of nightly build and includes the contents of build.log -in the body of the message.

-
- -

Mkdir

-

Description

-

Creates a directory. Also non-existent parent directories are created, when -necessary.

-

Parameters

- - - - - - - - - - - -
AttributeDescriptionRequired
dirthe directory to create.Yes
-

Examples

-
<mkdir dir="${dist}"/>
-

creates a directory ${dist}.

-
<mkdir dir="${dist}/lib"/>
-

creates a directory ${dist}/lib.

-
-

Move

-

Description

-

Moves a file to a new file or directory, or sets of files to -a new directory. By default, the -destination file is overwritten if it already exists. When overwrite is -turned off, then files are only moved if the source file is newer than -the destination file, or when the destination file does not exist.

-

FileSets are used to select sets of files -to move to the todir directory.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
filethe file to moveOne of file or - at least one nested fileset element
tofilethe file to move toWith the file attribute, - either tofile or todir can be used. With a nested fileset, - only todir is allowed.
todirthe directory to move to
overwriteoverwrite existing files even if the destination - files are newer (default is "true")No
filteringindicates whether token filtering should take place during - the move. See the filter task for a description of - how filters work.No
flattenignore directory structure of source directory, - copy all files into a single directory, specified by the todir - attribute (default is "false").Note that you can achieve the - same effect by using a flatten mapperNo
includeEmptyDirsCopy empty directories included with the nested FileSet(s). - Defaults to "yes".No
-

Parameters specified as nested elements

-

mapper

-

You can define file name transformations by using a nested mapper element. The default mapper used by -<copy> is the identity.

-

Examples

-

Move a single file (rename a file)

-
-  <move file="file.orig" tofile="file.moved"/>
-
-

Move a single file to a directory

-
-  <move file="file.orig" todir="dir/to/move/to"/>
-
-

Move a directory to a new directory

-
-  <move todir="new/dir/to/move/to">
-    <fileset dir="src/dir"/>
-  </move>
-
-

Move a set of files to a new directory

-
-  <move todir="some/new/dir" >
-    <fileset dir="my/src/dir" >
-      <include name="**/*.jar"/>
-      <exclude name="**/ant.jar"/>
-    </fileset>
-  </move>
-
-

Append ".bak" to the names of all files -in a directory.

-
-  <move todir="my/src/dir" >
-    <fileset dir="my/src/dir" >
-      <exclude name="**/*.bak"/>
-    </fileset>
-    <mapper type="glob" from="*" to="*.bak"/>
-  </move>
-
-
-

Patch

-

Description

-

Applies a diff file to originals.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
patchfilethe file that includes the diff outputYes
originalfilethe file to patchNo, tries to guess it from the diff - file
backupsKeep backups of the unpatched filesNo
quietWork silently unless an error occursNo
reverseAssume patch was created with old and new files - swapped.No
ignorewhitespaceIgnore whitespace differences.No
stripStrip the smallest prefix containing num leading - slashes from filenames.No
-

Examples

-
  <patch patchfile="module.1.0-1.1.patch"/>
-

applies the diff included in module.1.0-1.1.patch to the -files in base directory guessing the filename(s) from the diff output. -

  <patch patchfile="module.1.0-1.1.patch" strip="1"/>
-

like above but one leading directory part will be removed. i.e. if -the diff output looked like -

---- a/mod1.0/A	Mon Jun  5 17:28:41 2000
-+++ a/mod1.1/A	Mon Jun  5 17:28:49 2000
-
-the leading a/ will be stripped. -
-

Property

-

Description

-

Sets a property (by name and value), or set of properties (from file or -resource) in the project.

-

When a property was set by the user, or was a property in a parent project -(that started this project with the ant task), then this -property cannot be set, and will be ignored. This means that properties set -outside the current project always override the properties of the current -project.

-

There are five ways to set properties:

-
    -
  • By supplying both the name and value attribute.
  • -
  • By supplying both the name and refid attribute.
  • -
  • By setting the file attribute with the filename of the property - file to load. This property file has the format as defined by the file used - in the class java.util.Properties.
  • -
  • By setting the resource attribute with the resource name of the - property file to load. This property file has the format as defined by the - file used in the class java.util.Properties.
  • -
  • By setting the environment attribute with a prefix to use. - Properties will be defined for every environment variable by - prefixing the suplied name and a period to the name of the variable.
  • -
-

Although combinations of the three ways are possible, only one should be used -at a time. Problems might occur with the order in which properties are set, for -instance.

-

The value part of the properties being set, might contain references to other -properties. These references are resolved at the time these properties are set. -This also holds for properties loaded from a property file.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
namethe name of the property to set.Yes
valuethe value of the property.Yes
refidReference to an object - defined elsewhere. Only yields reasonable results for references - to PATH like structures or properties.
resourcethe resource name of the property file.
filethe filename of the property file .
locationSets the property to the absolute filename of the - given file. If the value of this attribute is an absolute path, it - is left unchanged (with / and \ characters converted to the - current platforms conventions). Otherwise it is taken as a path - relative to the project's basedir and expanded.
classpaththe classpath to use when looking up a resource.No
classpathrefthe classpath to use when looking up a resource, - given as reference to a PATH defined - elsewhere..No
-

Parameters specified as nested elements

-

classpath

-

Property's classpath attribute is a PATH like structure and can also be set via a nested -classpath element.

-

Examples

-
  <property name="foo.dist" value="dist"/>
-

sets the property foo.dist to the value "dist".

-
  <property file="foo.properties"/>
-

reads a set of properties from a file called "foo.properties".

-
  <property resource="foo.properties"/>
-

reads a set of properties from a resource called "foo.properties".

-

Note that you can reference a global properties file for all of your Ant -builds using the following: -

  <property file="${user.home}/.ant-global.properties"/>
-

since the "user.home" property is defined by the Java virtual machine -to be your home directory. This technique is more appropriate for Unix than -Windows since the notion of a home directory doesn't exist on Windows. On the -JVM that I tested, the home directory on Windows is "C:\". Different JVM -implementations may use other values for the home directory on Windows.

-
-

Rename

-

Deprecated

-

This task has been deprecated. Use the Move task instead.

-

Description

-

Renames a given file.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
srcfile to rename.Yes
destnew name of the file.Yes
replaceEnable replacing of existing file (default: on).No
-

Examples

-
  <rename src="foo.jar" dest="${name}-${version}.jar"/>
-

Renames the file foo.jar to ${name}-${version}.jar (assuming name - and version being predefined properties). If a file named ${name}-${version}.jar - already exists, it will be removed prior to renaming foo.jar.

-
-

Replace

-

Description

-

Replace is a directory based task for replacing the occurrence of a given string with another string -in selected file.

-

If you want to replace a text that crosses line boundaries, you -must use a nested <replacetoken> element.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
filefile for which the token should be replaced.Exactly one of the two.
dirThe base directory to use when replacing a token in - multiple files.
tokenthe token which must be replaced.Yes, unless a nested replacetoken - element is used.
valuethe new value for the token. When omitted, an empty string - ("") is used.No
propertyFilevalid property file from which properties specified using nested <replacefilter> elements are drawn.Yes only if property attribute of <replacefilter> is used.
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
-

Examples

-
  <replace file="${src}/index.html" token="@@@" value="wombat"/>
-

replaces occurrences of the string "@@@" with the string -"wombat", in the file ${src}/index.html.

-

Parameters specified as nested elements

-

This task forms an implicit FileSet and -supports all attributes of <fileset> as well as the -nested <include>, <exclude> and -<patternset> elements.

-

If either the text you want to replace or the replacement text -cross line boundaries, you can use nested elements to specify -them.

-

Examples

-
-<replace dir="${src}" value="wombat">
-  <include name="**/*.html"/>
-  <replacetoken><![CDATA[multi line
-token]]></replacetoken>
-</replace>
-
-

replaces occurrences of the string "multi -line\ntoken" with the string "wombat", in all -HTML files in the directory ${src}.Where \n is -the platform specific line separator.

-
-<replace file="${src}/index.html">
-  <replacetoken><![CDATA[two line
-token]]></replacetoken>
-  <replacevalue><![CDATA[two line
-token]]></replacevalue>
-</replace>
-
-

replacefilter

-

In addition to allowing for multiple replacements, optional nested <replacefilter> elements allow replacement values to be extracted from a property file. The name of this file is specified using the <replace> attribute propertyFile. -

- - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
tokenThe string to search for.Yes
valueThe replacement string.Either may be specified, but not both. Both can be omitted, if desired.
propertyName of the property whose value is to serve as the replacement value.
-

If neither value nor property is used, the value provided using the <replace> attribute value and/or the <replacevalue> element is used. If no value was specified using either of these options, the token is replaced with an empty string. -

-

Examples

-
-<replace 
-    file="configure.sh"
-    value="defaultvalue"
-    propertyFile="source/name.properties" >
-  <replacefilter 
-    token="@token1@" />
-  <replacefilter 
-    token="@token2@" 
-    value="value2"/>
-  <replacefilter 
-    token="@token3@" 
-    property="property.key"/>
-</replace>
-
-

In file configure.sh, replace all instances of "@token1@" with "defaultvalue", all instances of "@token2@" with "value2", and all instances of "@token3@" with the value of the property "property.key", as it appears in property file src/name.properties.

-

Note: It is possible to use either the token/<replacetoken> and value/<replacevalue> attributes/elements, the nested replacefilter elements, or both in the same operation. -

-
-

Rmic

-

Description

-

Runs the rmic compiler for a certain class.

-

Rmic can be run on a single class (as specified with the classname -attribute) or a number of classes at once (all classes below base that -are neither _Stub nor _Skel classes).

-

It is possible to refine the set of files that are being rmiced. This can be -done with the includes, includesfile, excludes, excludesfile and defaultexcludes -attributes. With the includes or includesfile attribute you specify the files you want to -have included by using patterns. The exclude or excludesfile attribute is used to specify -the files you want to have excluded. This is also done with patterns. And -finally with the defaultexcludes attribute, you can specify whether you -want to use default exclusions or not. See the section on directory based tasks, on how the -inclusion/exclusion of files works, and how to write patterns.

-

This task forms an implicit FileSet and -supports all attributes of <fileset> -(dir becomes base) as well as the nested -<include>, <exclude> and -<patternset> elements.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
basethe location to store the compiled files.Yes
classnamethe class for which to run rmic.No
filteringindicates whether token filtering should take placeNo
sourcebasePass the "-keepgenerated" flag to rmic and - move the generated source file to the base directory.No
stubversionSpecify the JDK version for the generated stub code. - Specify "1.1" to pass the "-v1.1" option to rmic.No
classpathThe classpath to use during compilationNo
classpathrefThe classpath to use during compilation, given as reference to a PATH defined elsewhereNo
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
verifycheck that classes implement Remote before handing them - to rmic (default is false)No
iiopindates that portable (RMI/IIOP) stubs should be generatedNo
iiopoptsadditional arguments for IIOP class generationNo
idlindates that IDL output files should be generatedNo
idloptsadditional arguments for IDL file generationNo
debuggenerate debug info (passes -g to rmic). Defaults to false.No
-

Parameters specified as nested elements

-

classpath

-

Rmic's classpath attribute is a PATH like structure and can also be set via a nested -classpath elements.

-

Examples

-
  <rmic classname="com.xyz.FooBar" base="${build}/classes"/>
-

runs the rmic compiler for the class com.xyz.FooBar. The -compiled files will be stored in the directory ${build}/classes.

-
  <rmic base="${build}/classes" includes="**/Remote*.class"/>
-

runs the rmic compiler for all classes with .class -files below ${build}/classes whose classname starts with -Remote. The compiled files will be stored in the directory -${build}/classes.

- -
-

SignJar

-

Description

-

Signs a jar or zip file with the javasign command line tool.

- -

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
jarthe jar file to signYes.
aliasthe alias to sign underYes.
storepasspassword for keystore integrity.Yes.
keystorekeystore locationNo
storetypekeystore typeNo
keypasspassword for private key (if different)No
sigfilename of .SF/.DSA fileNo
signedjarname of signed JAR fileNo
verbose(true | false) verbose output when signingNo
internalsf(true | false) include the .SF file inside the signature -blockNo
sectionsonly(true | false) don't compute hash of entire manifestNo
-

Examples

-
-

<signjar jar="${dist}/lib/ant.jar" -alias="apache-group" storepass="secret"/>

-
-

signs the ant.jar with alias "apache-group" accessing the -keystore and private key via "secret" password.

-
-

Style

-

Description

-

Process a set of documents via XSLT.

-

This is useful for building views of XML based documentation, -or in generating code.

-

It is possible to refine the set of files that are being copied. This can be -done with the includes, includesfile, excludes, excludesfile and defaultexcludes -attributes. With the includes or includesfile attribute you specify the files you want to -have included by using patterns. The exclude or excludesfile attribute is used to specify -the files you want to have excluded. This is also done with patterns. And -finally with the defaultexcludes attribute, you can specify whether you -want to use default exclusions or not. See the section on directory based tasks, on how the -inclusion/exclusion of files works, and how to write patterns.

-

This task forms an implicit FileSet and supports all - attributes of <fileset> (dir becomes basedir) - as well as the nested <include>, <exclude> - and <patternset> elements.

-

Style supports the use of a <param> element which is use to pass values - to an <xsl:param> declaration.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
basedirwhere to find the source xml file.Yes
destdirdirectory where to store the results.Yes
extensiondesired file extension to be used for the targets. If not - specified, the default is "html".No
stylename of the stylesheet to use.Yes
processorname of the XSLT processor to use. Permissible values are - "trax" for a TraX compliant processor, "xslp" for the - XSL:P processor, "xalan" for the Apache XML Xalan (version 1) - processor, or the name of an arbitrary XSLTLiaison class. Defaults to trax, - followed by xslp then xalan (in that order). The first one found in your - class path is the one that is used.No
includescomma separated list of patterns of files that must be included. - All files are included when omitted.No
includesfilethe name of a file. Each line of this file is taken to be - an include patternNo
excludescomma separated list of patterns of files that must be excluded. - No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is taken to be - an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
inspecifies a single XML document to be styled. Should be used - with the out attribute.No
outspecifies the output name for the sytled result from the - in attribute.No
-

Parameters specified as nested elements

-

param

-

Param is used to pass a parameter to the XSL stylesheet.

-

Parameters

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
nameName of the XSL parameterYes
expressionXSL expression to be placed into the param. To pass a text - value into the style sheet it needs to be escaped using single quotes.Yes
-

Examples

-
-

-

-<style basedir="doc" destdir="build/doc"
-       extension="html" style="style/apache.xsl"/>
-


- Using XSL parameters
-

-
<style basedir="doc" destdir="build/doc"
-		extension="html" style="style/apache.xsl">
-	<param name="date" expression="'07-01-2000'"/>
-</style>
-

This will replace an xsl:param definition<xsl:param name="date"></xsl:param> - with the text value 07-01-2000

-
-
-

Tar

-

Description

-

Creates a tar archive.

-

The basedir attribute is the reference directory from where to tar.

-

It is possible to refine the set of files that are being tarred. This can be -done with the includes, includesfile, excludes, excludesfile and defaultexcludes -attributes. With the includes or includesfile attribute you specify the files you want to -have included by using patterns. The exclude or excludesfile attribute is used to specify -the files you want to have excluded. This is also done with patterns. And -finally with the defaultexcludes attribute, you can specify whether you -want to use default exclusions or not. See the section on directory based tasks, on how the -inclusion/exclusion of files works, and how to write patterns.

-

This task forms an implicit FileSet and -supports all attributes of <fileset> -(dir becomes basedir) as well as the nested -<include>, <exclude> and -<patternset> elements.

-

Note that this task does not perform compression. You might want to use the GZip -task to come up with a .tar.gz package.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
tarfilethe tar-file to create.Yes
basedirthe directory from which to zip the files.Yes
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
longfileOne of truncate, fail, warn, - gnu. Determines how long files (>100 chars) are to be handled. - Early versions did not support such names, and modern versions do so in - incompatible ways. Default is warn. - No
-

Examples

-
  <tar tarfile="${dist}/manual.tar" basedir="htdocs/manual"/>
-  <gzip zipfile="${dist}/manual.tar.gz" src="${dist}/manual.tar"/>
-

tars all files in the htdocs/manual directory into a file called manual.tar -in the ${dist} directory, then applies the gzip task to compress -it.

-
  <tar tarfile="${dist}/manual.tar"
-       basedir="htdocs/manual"
-       excludes="mydocs/**, **/todo.html"
-  />
-

tars all files in the htdocs/manual directory into a file called manual.tar -in the ${dist} directory. Files in the directory mydocs, -or files with the name todo.html are excluded.

-
-

Taskdef

-

Description

-

Adds a task definition to the current project, such that this new task can be -used in the current project. Two attributes are needed, the name that identifies -this task uniquely, and the full name of the class (including the packages) that -implements this task.

-

Taskdef should be used to add your own tasks to the system. See also "Writing your own task".

-

Parameters

- - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
namethe name of the taskYes
classnamethe full class name implementing the taskYes
classpath the classpath to - use when looking up classname. No
-

Parameters specified as nested elements

-

classpath

-

Taskdef's classpath attribute is a PATH like structure and can also be set via a nested -classpath element.

-

Examples

-
  <taskdef name="myjavadoc" classname="com.mydomain.JavadocTask"/>
-

makes a task called myjavadoc available to Ant. The class com.mydomain.JavadocTask -implements the task.

-
-

Touch

-

Description

-

Changes the modification time of a file and possibly creates it at -the same time.

-

For JDK 1.1 only the creation of new files with a modification time -of now works, all other cases will emit a warning.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
filethe name of the fileYes
millisspecifies the new modification time of the file - in milliseconds since midnight Jan 1 1970No
datetimespecifies the new modification time of the file - in the format MM/DD/YYYY HH:MM AM_or_PM.No
-

If both millis and datetime are omitted -the current time is assumed.

-

Examples

-
  <touch file="myfile"/>
-

creates myfile if it doesn't exist and changes the -modification time to the current time.

-
  <touch file="myfile" datetime="06/28/2000 2:02 pm"/>
-

creates myfile if it doesn't exist and changes the -modification time to Jun, 28 2000 2:02 pm (14:02 for those used to 24 -hour times).

-
-

Tstamp

-

Description

-

Sets the DSTAMP, TSTAMP and TODAY properties in the current project. The -DSTAMP is in the "yyyymmdd" format, the TSTAMP is in the "hhmm" -format and TODAY is "month day year".

-

These properties can be used in the buildfile, for instance, to create -timestamped filenames or used to replace placeholder tags inside documents to -indicate, for example, the release date. The best place for this task is in your -initialization target.

-

Parameters

- - - - - - - - -
AttributeDescriptionRequired
No parameters
- -

Nested Elements

-The tstamp task supports a format nested element which allows a property to be -given the current date and time in a given format. The date/time patterns are as defined in the Java -SimpleDateFormat class. -

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
property - The property which is to receive the date/time string in the given pattern - Yes
patternThe date/time pattern to be used. The values are defined by the Java - SimpleDateFormat classYes
- -

Examples

-

Set the standard DSTAMP, TSTAMP and TODAY properties according to the formats above -

  <tstamp/>
- -

As for the above example, set the standard properties and also set the property -"TODAY_UK" with the date/time pattern "d MMM yyyy" - -

  <tstamp>
-    <format property="TODAY_UK" pattern="d MMMM yyyy">
-  </tstamp>
-
- -
-

Uptodate

-

Description

-

Sets a property if a target files are more up to date than a set of -Source files. Source files are specified by nested <srcfiles> -elements, these are FileSets, while target -files are specified using a nested mapper -element.

-

The value part of the property being set is true if the -timestamp of the target files is more recent than the timestamp of -every corresponding source file.

-

The default behavior is to use a merge -mapper whith the to attribute set to the value of the -targetfile attribute.

-

Normally, this task is used to set properties that are useful to avoid target -execution depending on the relative age of the specified files.

-

Parameters

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
propertythe name of the property to set.Yes
targetfilethe file for which we want to determine the status.Yes, unless a nested mapper element is - present.
-

Examples

-
  <uptodate property="xmlBuild.notRequired" targetfile="${deploy}\xmlClasses.jar" >
-    <srcfiles dir= "${src}/xml" includes="**/*.dtd"/>
-  </uptodate>
-

sets the property xmlBuild.notRequired to the value "true" -if the ${deploy}/xmlClasses.jar is more up to date than any of the DTD files in the ${src}/xml directory.

-

This can be written as -

  <uptodate property="xmlBuild.notRequired"  >
-    <srcfiles dir= "${src}/xml" includes="**/*.dtd"/>
-    <mapper type="merge" to="${deploy}\xmlClasses.jar"/>
-  </uptodate>
-

as well.

-
-

Unjar/Unwar/Unzip

-

Description

-

Unzips a zip-, war- or jarfile.

-

For JDK 1.1 "last modified time" field is set to current time instead of being -carried from zipfile.

-

File permissions will not be restored on extracted files.

-

Parameters

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
srczipfile to expand.Yes
destdirectory where to store the expanded files.Yes
-

Examples

-
-

<unzip src="${tomcat_src}/tools-src.zip" dest="${tools.home}" - />

-
-
-

Untar

-

Description

-

Untars a tarfile.

-

File permissions will not be restored on extracted files.

-

For JDK 1.1 "last modified time" field is set to current time instead of being -carried from tarfile.

-

Parameters

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
srctarfile to expand.Yes
destdirectory where to store the expanded files.Yes
-

Examples

-
-

-<gunzip src="tools.tar.gz"/>
-<untar src="tools.tar" dest="${tools.home}"/> -

-
-
-

War

-

Description

-

An extension of the Jar task with special -treatment for files that should end up in the -WEB-INF/lib, WEB-INF/classes or -WEB-INF directories of the Web Application Archive. -

(The War task is a shortcut for specifying the particular layout of a WAR file. -The same thing can be accomplished by using the prefix and fullpath -attributes of zipfilesets in a Zip or Jar task.)

-

The extended zipfileset element from the zip task (with attributes prefix, fullpath, and src) is available in the War task.

- -

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
warfilethe war-file to create.Yes
webxmlThe deployment descriptor to use (WEB-INF/web.xml).Yes
basedirthe directory from which to jar the files.No
compressNot only store data but also compress them, defaults to trueNo
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
manifestthe manifest file to use.No
whenemptyBehavior to use if no files match.No
-

Nested elements

-

lib

-

The nested lib element specifies a FileSet. All files included in this fileset will -end up in the WEB-INF/lib directory of the war file.

-

classes

-

The nested classes element specifies a FileSet. All files included in this fileset will -end up in the WEB-INF/classes directory of the war file.

-

webinf

-

The nested webinf element specifies a FileSet. All files included in this fileset will -end up in the WEB-INF directory of the war file. If this -fileset includes a file named web.xml, the file is -ignored and you will get a warning.

-

Examples

-

Assume the following structure in the project's base directory: -

-thirdparty/libs/jdbc1.jar
-thirdparty/libs/jdbc2.jar
-build/main/com/myco/myapp/Servlet.class
-src/metadata/myapp.xml
-src/html/myapp/index.html
-src/jsp/myapp/front.jsp
-src/graphics/images/gifs/small/logo.gif
-src/graphics/images/gifs/large/logo.gif
-
-then the war file myapp.war created with -
-<war warfile="myapp.war" webxml="src/metadata/myapp.xml">
-  <fileset dir="src/html/myapp"/>
-  <fileset dir="src/jsp/myapp"/>
-  <lib dir="thirdparty/libs">
-    <exclude name="jdbc1.jar"/>
-  </lib>
-  <classes dir="build/main"/>
-  <zipfileset dir="src/graphics/images/gifs" 
-              prefix="images"/>
-</war>
-
-will consist of -
-WEB-INF/web.xml
-WEB-INF/lib/jdbc2.jar
-WEB-INF/classes/com/myco/myapp/Servlet.class
-META-INF/MANIFEST.MF
-index.html
-front.jsp
-images/small/logo.gif
-images/large/logo.gif
-
-using Ant's default manifest file. The content of -WEB-INF/web.xml is identical to -src/metadata/myapp.xml. -
-

Zip

-

Description

-

Creates a zipfile.

-

The basedir attribute is the reference directory from where to zip.

-

Note that file permissions will not be stored in the resulting zipfile.

-

It is possible to refine the set of files that are being zipped. This can be -done with the includes, includesfile, excludes, excludesfile and defaultexcludes -attributes. With the includes or includesfile attribute you specify the files you want to -have included by using patterns. The exclude or excludesfile attribute is used to specify -the files you want to have excluded. This is also done with patterns. And -finally with the defaultexcludes attribute, you can specify whether you -want to use default exclusions or not. See the section on directory based tasks, on how the -inclusion/exclusion of files works, and how to write patterns. -

This task forms an implicit FileSet and -supports all attributes of <fileset> -(dir becomes basedir) as well as the nested -<include>, <exclude> and -<patternset> elements.

-

Or, you may place within it nested file sets, or references to file sets. -In this case basedir is optional; the implicit file set is only used -if basedir is set. You may use any mixture of the implicit file set -(with basedir set, and optional attributes like includes -and optional subelements like <include>); explicit nested -<fileset> elements so long as at least one fileset total is specified. The ZIP file will -only reflect the relative paths of files within each fileset. The Zip task and its derivatives know a special form of a fileset named zipfileset that has additional attributes (described below).

-

The whenempty parameter controls what happens when no files match. -If skip (the default), the ZIP is not created and a warning is issued. -If fail, the ZIP is not created and the build is halted with an error. -If create, an empty ZIP file (explicitly zero entries) is created, -which should be recognized as such by compliant ZIP manipulation tools.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
zipfilethe zip-file to create.Yes
basedirthe directory from which to zip the files.No
compressNot only store data but also compress them, defaults to trueNo
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when omitted.No
whenemptyBehavior when no files match.No
-

Parameters specified as nested elements

-

fileset

-

The zip task supports any number of nested <fileset> elements to specify -the files to be included in the archive.

-

zipfileset

-

A <zipfileset> has three additional attributes: prefix, fullpath, and src. The -prefix and fullpath attributes modify the location of the files when they are placed -inside the archive. If the prefix attribute is set, all files in the fileset are prefixed -with that path in the archive. If the fullpath attribute is set, the file described by the fileset is placed at that -exact location in the archive. (The fullpath attribute can only be set for filesets that represent a single file. The prefix and fullpath attributes cannot both be set on the same fileset.) The src attribute -may be used in place of the dir attribute to specify a zip file whose -contents will be extracted and included in the archive. As with directories, include and exclude patterns may be used to specify a subset of the zip file -for inclusion in the archive. - -

Examples

-
  <zip zipfile="${dist}/manual.zip"
-       basedir="htdocs/manual"
-  />
-

zips all files in the htdocs/manual directory into a file called manual.zip -in the ${dist} directory.

-
  <zip zipfile="${dist}/manual.zip"
-       basedir="htdocs/manual"
-       excludes="mydocs/**, **/todo.html"
-  />
-

zips all files in the htdocs/manual directory. Files in the directory mydocs, -or files with the name todo.html are excluded.

-
  <zip zipfile="${dist}/manual.zip"
-       basedir="htdocs/manual"
-       includes="api/**/*.html"
-       excludes="**/todo.html"
-  />
-

zips all files in the htdocs/manual directory. Only html files under the directory api -are zipped, and files with the name todo.html are excluded.

-
  <zip zipfile="${dist}/manual.zip">
-    <fileset dir="htdocs/manual"/>
-    <fileset dir="." includes="ChangeLog.txt"/>
-  </zip>
-

zips all files in the htdocs/manual directory, and also adds the file ChangeLog.txt in the -current directory. ChangeLog.txt will be added to the top of the ZIP file, just as if -it had been located at htdocs/manual/ChangeLog.txt.

-
  <zip zipfile="${dist}/manual.zip">
-    <zipfileset dir="htdocs/manual" prefix="docs/user-guide"/>
-    <zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/>
-    <zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/>
-  </zip>
-

zips all files in the htdocs/manual directory into the docs/user-guide directory -in the archive, adds the file ChangeLog27.txt in the -current directory as docs/ChangeLog.txt, and includes all the html files in examples.zip under docs/examples. The archive might end up containing the files: -

    docs/user-guide/html/index.html
-    docs/ChangeLog.txt
-    docs/examples/index.html
-
-

- -
-

Optional tasks

-

The tasks listed here are not included in the ant.jar included in the binary distribution -of Ant. To use them you should download optional.jar and put in the lib-subdirectory of your -Ant-installation. Additionaly some of these tasks require external libraries to be put on -your CLASSPATH.

- -
-

Cab

-

Description

-

The cab task creates Microsoft cab archive files. It is invoked -similar to the jar or zip tasks. -This task will only work on Windows, and will be silently ignored on -other platforms. You must have the Microsoft cabarc tool available in -your executable path.

-

See the section on directory based -tasks, on how the inclusion/exclusion of files works, and how to -write patterns.

-

This task forms an implicit FileSet and -supports all attributes of <fileset> -(dir becomes basedir) as well as the nested -<include>, <exclude> and -<patternset> elements.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
cabfilethe name of the cab file to create.Yes
basedirthe directory to start archiving files from.Yes
verboseset to "yes" if you want to see the output from - the cabarc tool. defaults to "no".No
compressset to "no" to store files without compressing. - defaults to "yes".No
optionsuse to set additional command-line options for - the cabarc tool. should not normally be necessary.No
includescomma separated list of patterns of files that - must be included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
excludescomma separated list of patterns of files that - must be excluded. No files (except default excludes) are excluded - when omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used - or not ("yes"/"no"). Default excludes are used when omitted.No
-

Examples

-
-<cab cabfile="${dist}/manual.cab"
-     basedir="htdocs/manual" 
-  />
-
-

cabs all files in the htdocs/manual directory into a file called -manual.cab in the ${dist} directory.

-
-<cab cabfile="${dist}/manual.cab"
-     basedir="htdocs/manual"
-     excludes="mydocs/**, **/todo.html"
-  />
-
-

cabs all files in the htdocs/manual directory into a file called -manual.cab in the ${dist} directory. Files in the directory mydocs, -or files with the name todo.html are excluded.

-
-<cab cabfile="${dist}/manual.cab"
-     basedir="htdocs/manual"
-     includes="api/**/*.html"
-     excludes="**/todo.html"
-     verbose="yes"
-  />
-
-

cab all files in the htdocs/manual directory into a file called -manual.cab in the ${dist} directory. Only html files under the -directory api are archived, and files with the name todo.html are -excluded. Output from the cabarc tool is displayed in the build -output.

-
-

FTP

-

Description

-

Note: The ftp-task uses the NetComponents-Package which you will need to download from -http://www.savarese.org and add to your classpath.

-

The ftp task implements a basic FTP client that can send, receive, -list, and delete files. See below for descriptions and examples of how -to perform each task.

-

The ftp task makes no attempt to determine what file system syntax is -required by the remote server, and defaults to Unix standards. -remotedir must be specified in the exact syntax required by the ftp -server. If the usual Unix conventions are not supported by the server, -separator can be used to set the file separator that should be used -instead.

-

See the section on directory based -tasks, on how the inclusion/exclusion of files works, and how to -write patterns.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
serverthe address of the remote ftp server.Yes
portthe port number of the remote ftp server. - Defaults to port 21.No
useridthe login id to use on the ftp server.Yes
passwordthe login password to use on the ftp server.Yes
remotedirthe directory to which to upload files on the - ftp server.No
actionthe ftp action to perform, defaulting to "send". - Currently supports"put", "get", - "del", and "list".No
binaryselects binary-mode ("yes") or text-mode - ("no") transfers. - Defaults to "yes"No
passiveselects passive-mode ("yes") transfers. - Defaults to "no"No
verbosedisplays information on each file transferred if set - to "yes". Defaults to "no".No
dependstransfers only new or changed files if set to - "yes". Defaults to "no".No
newera synonym for depends.No
separatorsets the file separator used on the ftp server. - Defaults to "/".No
listingthe file to write results of the "list" action. - Required for the "list" action, ignored otherwise.No
-

Sending Files

-

The easiest way to describe how to send files is with a couple of examples:

-
-  <ftp server="ftp.apache.org"
-       userid="anonymous"
-       password="me@myorg.com">
-    <fileset dir="htdocs/manual"/>
-  </ftp>
-
-

Logs in to ftp.apache.org as anonymous and -uploads all files in the htdocs/manual directory -to the default directory for that user.

-
  <ftp server="ftp.apache.org"
-       remotedir="incoming"
-       userid="anonymous"
-       password="me@myorg.com"
-       depends="yes"
-  >
-    <fileset dir="htdocs/manual"/>
-  </ftp>
-

Logs in to ftp.apache.org as anonymous and -uploads all new or changed files in the htdocs/manual directory -to the incoming directory relative to the default directory -for anonymous.

-
  <ftp server="ftp.apache.org"
-       port="2121"
-       remotedir="/pub/incoming"
-       userid="coder"
-       password="java1"
-       depends="yes"
-       binary="no"
-  >
-    <fileset dir="htdocs/manual">
-      <include name="**/*.html"/>
-    </fileset>
-  </ftp>
-

Logs in to ftp.apache.org at port 2121 as -coder with password java1 and uploads all new or -changed HTML files in the htdocs/manual directory to the -/pub/incoming directory. The files are transferred in text mode. Passive mode has been switched on to send files from behind a firewall.

-
  <ftp server="ftp.nt.org"
-       remotedir="c:\uploads"
-       userid="coder"
-       password="java1"
-       separator="\"
-       verbose="yes"
-
-  >
-    <fileset dir="htdocs/manual">
-      <include name="**/*.html"/>
-    </fileset>
-  </ftp>

Logs in to the Windows-based ftp.nt.org as -coder with password java1 and uploads all -HTML files in the htdocs/manual directory to the -c:\uploads directory. Progress messages are displayed as each -file is uploaded.

-

Getting Files

-

Getting files from an FTP server works pretty much the same way as -sending them does. The only difference is that the nested filesets -use the remotedir attribute as the base directory for the files on the -FTP server, and the dir attribute as the local directory to put the files -into. The file structure from the FTP site is preserved on the local machine.

-
-  <ftp action="get"
-       server="ftp.apache.org"
-       userid="anonymous"
-       password="me@myorg.com">
-    <fileset dir="htdocs/manual" >
-      <include name="**/*.html"/>
-    </fileset>
-  </ftp>
-
-

Logs in to ftp.apache.org as anonymous and -recursively downloads all .html files from default directory for that user -into the htdocs/manual directory on the local machine.

-

Deleting Files

-As you've probably guessed by now, you use nested fileset elements to -select the files to delete from the remote FTP server. Again, the -filesets are relative to the remote directory, not a local directory. In -fact, the dir attribute of the fileset is ignored completely. -
-  <ftp action="del"
-       server="ftp.apache.org"
-       userid="anonymous"
-       password="me@myorg.com" >
-    <fileset>
-      <include name="**/*.tmp"/>
-    </fileset>
-  </ftp>
-
-

Logs in to ftp.apache.org as anonymous and -tries to delete all *.tmp files from the default directory for that user. -If you don't have permission to delete a file, a BuildException is thrown.

-

Listing Files

-
-  <ftp action="list"
-       server="ftp.apache.org"
-       userid=quot;anonymous"
-       password="me@myorg.com" 
-       listing="data/ftp.listing" >
-    <fileset>
-      <include name="**"/>
-    </fileset>
-  </ftp>
-
-

This provides a file listing in data/ftp.listing of all the files on -the FTP server relative to the default directory of the anonymous -user. The listing is in whatever format the FTP server normally lists files.

-
-

NetRexxC

-

Description

-

Compiles a NetRexx -source tree within the running (Ant) VM.

-

The source and destination directory will be recursively scanned for -NetRexx source files to compile. Only NetRexx files that have no corresponding -class file or where the class file is older than the java file will be compiled.

-

Files in the source tree are copied to the destination directory, -allowing support files to be located properly in the classpath. The source -files are copied because the NetRexx compiler cannot produce class files in a -specific directory via parameters

-

The directory structure of the source tree should follow the package -hierarchy.

-

It is possible to refine the set of files that are being compiled/copied. -This can be done with the includes, includesfile, excludes, excludesfile and -defaultexcludes attributes. With the includes or includesfile attribute you -specify the files you want to have included by using patterns. The -exclude or excludesfile attribute is used to specify the files you want to have -excluded. This is also done with patterns. And finally with the -defaultexcludes attribute, you can specify whether you -want to use default exclusions or not. See the section on directory based tasks, on how the -inclusion/exclusion of files works, and how to write patterns.

-

This task forms an implicit FileSet and -supports all attributes of <fileset> -(dir becomes srcdir) as well as the nested -<include>, <exclude> and -<patternset> elements.

- -

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
binaryWhether literals are treated as the java binary - type rather than the NetRexx typesNo
classpathThe classpath to use during compilationNo
commentsWhether comments are passed through to the - generated java sourceNo
compactWhether error messages come out in compact or - verbose formatNo
compileWhether the NetRexx compiler should compile the - generated java codeNo
consoleWhether or not messages should be displayed on the - 'console'No
crossrefWhether variable cross references are generatedNo
decimalWhether decimal arithmetic should be used for the - NetRexx codeNo
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when - omitted.No
destDirthe destination directory into which the NetRexx - source files should be copied and then compiledYes
diagWhether diagnostic information about the compile is - generatedNo
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when - omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
explicitWhether variables must be declared explicitly - before useNo
formatWhether the generated java code is formatted nicely - or left to match NetRexx line numbers for call stack debuggingNo
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
javaWhether the generated java code is producedNo
keepSets whether the generated java source file should be kept - after compilation. The generated files will have an extension of - .java.keep, not .javaNo
logoWhether the compiler text logo is displayed when - compilingNo
replaceWhether the generated .java file should be replaced - when compilingNo
savelogWhether the compiler messages will be written to - NetRexxC.log as well as to the consoleNo
sourcedirTells the NetRexx compiler to store the class files in the - same directory as the source files. The alternative is the working - directoryNo
srcDirSet the source dir to find the source Netrexx - filesYes
strictargsTells the NetRexx compiler that method calls always - need parentheses, even if no arguments are needed, e.g. - aStringVar.getBytes vs. - aStringVar.getBytes()No
strictassignTells the NetRexx compile that assignments must - match exactly on typeNo
strictcaseSpecifies whether the NetRexx compiler should be - case sensitive or notNo
strictimportWhether classes need to be imported explicitly using an - import statement. By default the NetRexx compiler will - import certain packages automaticallyNo
strictpropsWhether local properties need to be qualified - explicitly using thisNo
strictsignalWhether the compiler should force catching of - exceptions by explicitly named typesNo
symbolsWhether debug symbols should be generated into the - class fileNo
timeAsks the NetRexx compiler to print compilation - times to the consoleNo
traceTurns on or off tracing and directs the resultant - trace outputNo
utf8Tells the NetRexx compiler that the source is in UTF8No
verboseWhether lots of warnings and error messages should - be generatedYes
-

Examples

-
-

<netrexxc srcDir="/source/project" - includes="vnr/util/*" - destDir="/source/project/build" - classpath="/source/project2/proj.jar" - comments="true" - crossref="false" replace="true" - keep="true"/> -

-
-
-

RenameExtensions

-

Deprecated

-

This task has been deprecated. Use the move -task with a glob mapper instead.

-

Description

-

Renames files in the srcDir directory ending with the -fromExtension string so that they end with the -toExtension string. Files are only replaced if -replace is true -

-

See the section on -directory based tasks, on how the -inclusion/exclusion of files works, and how to write patterns. -This task forms an implicit FileSet and -supports all attributes of <fileset> -(dir becomes srcDir) as well as the nested -<include>, <exclude> and -<patternset> elements.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
defaultexcludesindicates whether default excludes should be used or not - ("yes"/"no"). Default excludes are used when - omitted.No
excludescomma separated list of patterns of files that must be - excluded. No files (except default excludes) are excluded when - omitted.No
excludesfilethe name of a file. Each line of this file is - taken to be an exclude patternNo
fromExtentionThe string that files must end in to be renamedYes
includescomma separated list of patterns of files that must be - included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is - taken to be an include patternNo
replaceWhether the file being renamed to should be - replaced if it already existsNo
srcDirThe starting directory for files to search inYes
toExtensionThe string that renamed files will end with on - completionYes
-

Examples

-
-

<renameext srcDir="/source/project1" - includes="**" - excludes="**/samples/*" - fromExtension=".java.keep" - toExtension=".java" - replace="true"/> - -

-
- -
-

Script

-

Description

-

Execute a script in a - BSF supported language. -

All items (tasks, targets, etc) of the running project are -accessible from the script, using either their name or -id attributes.

-

Scripts can do almost anything a task written in Java could do.

-

Parameters

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
languageThe programming language the script is written in. - Must be a supported BSF languageNo
srcThe location of the script as a file, if not inlineNo
-

Examples

-
-<project name="squares" default="main" basedir=".">
-
-  <target name="setup">
-
-    <script language="javascript"> <![CDATA[
-
-      for (i=1; i<=10; i++) {
-        echo = squares.createTask("echo");
-        main.addTask(echo);
-        echo.setMessage(i*i);
-      }
-
-    ]]> </script>
-
-  </target>
-
-  <target name="main" depends="setup"/>
-
-</project>
-
-

generates

-
-setup:
-
-main:
-1
-4
-9
-16
-25
-36
-49
-64
-81
-100
-
-BUILD SUCCESSFUL
-
-

Another example, using references by id -and two different scripting languages:

-
-<project name="testscript" default="main">
-  <target name="sub">
-    <echo id="theEcho"/>
-  </target>
-
-  <target name="sub1">
-    <script language="netrexx"><![CDATA[
-      theEcho.setMessage("In sub1")
-      sub.execute
-    ]]></script>
-  </target>
-
-  <target name="sub2">
-    <script language="javascript"><![CDATA[
-      theEcho.setMessage("In sub2");
-      sub.execute();
-    ]]></script>
-  </target>
-
-  <target name="main" depends="sub1,sub2"/>
-</project>
-
-

generates

-
-sub1:
-In sub1
-
-sub2:
-In sub2
-
-main:
-
-BUILD SUCCESSFUL
-
- -
-

Sound

-

Description

-

Plays a sound-file at the end of the build, according to whether -the build failed or succeeded. You can specify either a specific -sound-file to play, or, if a directory is specified, the -<sound> task will randomly select a file to play. -Note: At this point, the random selection is based on all the files -in the directory, not just those ending in appropriate suffixes -for sound-files, so be sure you only have sound-files in the -directory you specify. - -

Parameters

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
loopsthe number of extra times to play the sound-file; - default is 0. - No
durationthe amount of time (in milliseconds) to play - the sound-file. - No
-

-To specify the sound-files or the sound-file directories, use the -nested <success> and <fail> -elements: -

-
-<success>     the path to a sound-file directory, or the name of a
-              specific sound-file, to be played if the build succeeded.
-<fail>        the path to a sound-file directory, or the name of a
-              specific sound-file, to be played if the build succeeded.
-
-
- -

Examples

-
-
-<target name="fun" if="fun" unless="fun.done">
-  <sound loops="2">
-    <success source="${user.home}/sounds/bell.wav"/>
-    <fail source="${user.home}/sounds/ohno.wav"/>
-  </sound>
-  <property name="fun.done" value="true"/>
-</target>
-
-
-plays the bell.wav sound-file if the build succeeded, or -the ohno.wav sound-file if the build failed, three times, -if the fun property is set to true. -If the target -is a dependency of an "initialization" target that other -targets depend on, the -fun.done property prevents the target from being executed -more than once. -
-
-<target name="fun" if="fun" unless="fun.done">
-  <sound>
-    <success source="//intranet/sounds/success"/>
-    <fail source="//intranet/sounds/failure"/>
-  </sound>
-  <property name="fun.done" value="true"/>
-</target>
-
-
-randomly selects a sound-file to play when the build succeeds or fails. - -
-

Telnet

-

Description

-Task to automate a remote telnet session. The task uses nested <read> to indicate strings to wait for, and <write> tags to specify text to send. - -

If you do specify a userid and password, the system will assume a common unix prompt to wait on. This behavior can be easily over-ridden.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeValuesRequired
useridthe login id to use on the telnet server.No
passwordthe login password to use on the telnet server.No
serverthe address of the remote telnet server.Yes
portthe port number of the remote telnet server. Defaults to port 23.No
initialCRsend a cr after connecting ("yes"). Defaults to "no".No
timeoutset a default timeout to wait for a response. Specified in seconds. Default is no timeout.No
-

Examples

-A simple example of connecting to a server and running a command. This assumes a prompt of "ogin:" for the userid, and a prompt of "assword:" for the password. -
-<telnet userid="bob" password="badpass" server="localhost">
-   <read>/home/bob</read>
-   <write>ls</write>
-   <read string="/home/bob"/>
-</telnet>
-
- -This task can be rewritten as: -
-<telnet server="localhost">
-   <read>ogin:</read>
-   <write>bob</write>
-   <read>assword:</read>
-   <write>badpass</write>
-   <read>/home/bob</read>
-   <write>ls</write>
-   <read>/home/bob</read>
-</telnet>
-
- -A timeout can be specified at the <telnet> level or at the <read> level. This will connect, issue a sleep command that is suppressed from displaying and wait 10 seconds before quitting. -
-<telnet userid="bob" password="badpass" server="localhost" timeout="20">
-   <read>/home/bob</read>
-   <write echo="false">sleep 15</write>
-   <read timeout="10">/home/bob</read>
-</telnet>
-
- -The task can be used with other ports as well: -
-<telnet port="80" server="localhost" timeout="20">
-   <read/>
-   <write>GET / http/0.9</write>
-   <write/>
-   <read timeout="10">&lt;/HTML&gt;</read>
-</telnet>
-
-
-

VssGet

-

Description

-Task to perform GET commands to Microsoft Visual Source Safe. -

If you specify two or more attributes from version, date and -label only one will be used in the order version, date, label.

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeValuesRequired
loginusername,passwordNo
vsspathSourceSafe pathYes
localpathOverride the working directory and get to the specified pathNo
writabletrue or falseNo
recursivetrue or falseNo
versiona version number to getNo
datea date stamp to get atNo
labela label to get forNo
ssdirdirectory where ss.exe resides. By default the - task expects it to be in the PATH.No
-

Note that only one of version, date or label should be specified

-

Examples

-
-
-<vssget localPath="C:\mysrc\myproject"
-        recursive="true" 
-        label="Release1"
-        login="me,mypassword"
-        vsspath="/source/aProject"
-        writable="true"/>
-
-
-

Does a get on the VSS-Project $/source/aproject using the username -me and the password mypassword. It will recursively get the files -which are labeled Release1 and write them to the local directory -C:\mysrc\myproject. The local files will be writable.

-
- -

Build Events

-Ant is capable of generating build events as it performs the tasks necessary to build a project. -Listeners can be attached to Ant to receive these events. This capability could be used, for example, -to connect Ant to a GUI or to integrate Ant with an IDE. - -

To use build events you need to create an ant Project object. You can then call the -addBuildListener method to add your listener to the project. Your listener must implement -the org.apache.tools.antBuildListener interface. The listener will receive BuildEvents -for the following events -

    -
  • Build started -
  • Build finished -
  • Target started -
  • Target finished -
  • Task started -
  • Task finished -
  • Message logged -
- -If you wish to attach a listener from the command line you may use the --listener option. For example: -
-
ant -listener org.apache.tools.ant.XmlLogger
-
-will run Ant with a listener that generates an XML representation of the build progress. This -listener is included with Ant, as is the default listener, which generates the logging to standard output. - -
-

Writing Your Own Task

-

It is very easy to write your own task:

-
    -
  1. Create a Java class that extends org.apache.tools.ant.Task.
  2. -
  3. For each attribute, write a setter method. The setter method must be a - public void method that takes a single argument. The - name of the method must begin with set, followed by the - attribute name, with the first character of the name in uppercase, and the rest in - lowercase. The type of the attribute can be: -
      -
    • -String -
    • -
    • -any primitive type (they are converted for you from their String-representation -in the buildfile) -
    • -
    • -boolean – your method will be passed the value -true if the value specified in the buildfile is one of true, -yes, or on) -
    • -
    • -Class -
    • -File -(in which case the value of the attribute is interpreted relative to the -project's basedir) -
    • -
    • -any other type that has a constructor with a single -String argument -
    • -
    -
  4. If your task has enumerated attributes, you should consider using -a subclass of org.apache.tools.ant.types.EnumeratedAttribute -as an argument -to your setter method. See -org/apache/tools/ant/taskdefs/FixCRLF.java for -an example.
  5. -
  6. If the task should support character data, write a public void -addText(String) method.
  7. -
  8. For each nested element, write a create or add method. -A create method -must be a public method that takes no arguments and returns -an Object type. The name of the create method must begin with -create, followed by the element name. An add method must be -a public void method that takes a single argument of an -Object type with a no-argument constructor. -The name of the add method -must begin with add, followed by the element name. -
  9. Write a public void execute method, with no arguments, that -throws a BuildException. This method implements the task -itself.
  10. -
- -

The Life-cycle of a Task

-
    -
  1. The task gets instantiated using a no-argument constructor, at parser - time. This means even tasks that are never executed get - instantiated.
  2. - -
  3. The task gets references to its project and location inside the - buildfile via its inherited project and - location variables.
  4. - -
  5. If the user specified an id attribute to this task, - the project - registers a reference to this newly created task, at parser - time.
  6. - -
  7. The task gets a reference to the target it belongs to via its - inherited target variable.
  8. - -
  9. init() is called at parser time.
  10. - -
  11. All child elements of the XML element corresponding to this task - are created via this task's createXXX() methods or - instantiated and added to this task via its addXXX() - methods, at parser time.
  12. - -
  13. All attributes of this task get set via their corresponding - setXXX methods, at runtime.
  14. - -
  15. The content character data sections inside the XML element - corresponding to this task is added to the task via its - addText method, at runtime.
  16. - -
  17. All attributes of all child elements get set via their corresponding - setXXX methods, at runtime.
  18. - -
  19. execute() is called at runtime. While the above initialization - steps only occur once, the execute() method may be - called more than once, if the task is invoked more than once. For example, - if target1 and target2 both depend - on target3, then running - 'ant target1 target2' will run all tasks in - target3 twice.
  20. -
- -

Example

-

Let's write our own task, which prints a message on the -System.out stream. -The -task has one attribute, called message.

-
-
-package com.mydomain;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-
-public class MyVeryOwnTask extends Task {
-  private String msg;
-
-  // The method executing the task
-  public void execute() throws BuildException {
-    System.out.println(msg);
-  }
-
-  // The setter for the "message" attribute
-  public void setMessage(String msg) {
-    this.msg = msg;
-  }
-}
-
-
-

It's really this simple ;-)

-

Adding your task to the system is rather simple too:

-
    -
  1. Make sure the class that implements your task is in the classpath when - starting Ant.
  2. -
  3. Add a <taskdef> element to your project. - This actually adds your task to the system.
  4. -
  5. Use your task in the rest of the buildfile.
  6. -
- -

Example

-
-
-<?xml version="1.0"?>
-
-<project name="OwnTaskExample" default="main" basedir=".">
-  <taskdef name="mytask" classname="com.mydomain.MyVeryOwnTask"/>
-
-  <target name="main">
-    <mytask message="Hello World! MyVeryOwnTask works!"/>
-  </target>
-</project>
-
-
-

Another way to add a task (more permanently), is to add the task name and -implementing class name to the default.properties file in the -org.apache.tools.ant.taskdefs -package. Then you can use it as if it were a built-in task.

- -
-

FAQ, DTD, External Resources

-

There is an on-line FAQ for Ant at jakarta.apache.org. This -FAQ is interactive, which means you can ask and answer questions -on line.

-

One of the questions popping up quite often is "Is there a DTD for -buildfiles?" Please refer to the FAQ for an answer.

- -
-

Feedback

-

To provide feedback on this software, please subscribe to the Ant User -Mail List (ant-user-subscribe@jakarta.apache.org)

-

If you want to contribute to Ant or stay current with the latest -development, join the Ant Development Mail List (ant-dev-subscribe@jakarta.apache.org)

-

Archives of both lists can be found at http://archive.covalent.net/. Many -thanks to Covalent Technologies. A searchable archive can be found at http://marc.theaimsgroup.com. If -you know of any additional archive sites, please report them to the -lists.

-
-

Copyright © 2000,2001 Apache Software Foundation. All rights -Reserved.

- - - - diff --git a/docs/manual/CoreTasks/ant.html b/docs/manual/CoreTasks/ant.html new file mode 100644 index 000000000..3e0d83807 --- /dev/null +++ b/docs/manual/CoreTasks/ant.html @@ -0,0 +1,69 @@ + + + + +Ant User Manual + + + + +

Ant

+

Description

+

Runs Ant on a supplied buildfile. This can be used to build subprojects.

+

When the antfile attribute is omitted, the file "build.xml" +in the supplied directory (dir attribute) is used.

+

If no target attribute is supplied, the default target of the new project is +used.

+

The properties of the current project will be available in the new project. +These properties will override the properties that are set in the new project. +(See also the property task). You can set properties +in the new project from the old project by using nested property tags. This +allows you to parameterize your subprojects.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
antfilethe buildfile to use. Defaults to "build.xml".No
dirthe directory to use as a basedir for the new Ant project. + Defaults to the current directory.No
targetthe target of the new Ant project that should be executed.No
outputFilename to write the ant output to. + No
+

Examples

+
+  <ant antfile="subproject/subbuild.xml" dir="subproject" target="compile"/>
+
+  <ant dir="subproject"/>
+
+  <ant antfile="subproject/property_based_subbuild.xml">
+    <property name="param1" value="version 1.x"/>
+    <property file="config/subproject/default.properties"/>
+  </ant>
+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/antcall.html b/docs/manual/CoreTasks/antcall.html new file mode 100644 index 000000000..d3057eae4 --- /dev/null +++ b/docs/manual/CoreTasks/antcall.html @@ -0,0 +1,49 @@ + + + + +Ant User Manual + + + + +

AntCall

+

Description

+

Call another target within the same build-file optionally specifying some +properties (param's in this context)

+

Parameters

+ + + + + + + + + + + +
AttributeDescriptionRequired
targetThe target to execute.Yes
+

Parameters specified as nested elements

+

param

+

Specifies the properties to set before running the specified target. See property for usage guidelines.

+

Examples

+
+  <target name="default">
+    <antcall target="doSomethingElse">
+      <param name="param1" value="value"/>
+    </antcall>
+  </target>
+
+  <target name="doSomethingElse">
+    <echo message="param1=${param1}"/>
+  </target>
+
+

Will run the target 'doSomethingElse' and echo 'param1=value'.

+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/antstructure.html b/docs/manual/CoreTasks/antstructure.html new file mode 100644 index 000000000..708edfc3b --- /dev/null +++ b/docs/manual/CoreTasks/antstructure.html @@ -0,0 +1,43 @@ + + + + +Ant User Manual + + + + +

AntStructure

+

Description

+

Generates a DTD for Ant buildfiles which contains information +about all tasks currently known to Ant.

+

Note that the DTD generated by this task is incomplete, you can +always add XML entities using <taskdef>. See here for +a way to get around this problem.

+

This task doesn't know about required attributes, all will be +listed as #IMPLIED.

+

Parameters

+ + + + + + + + + + + +
AttributeDescriptionRequired
outputfile to write the DTD to.Yes
+

Examples

+
+<antstructure output="project.dtd"/>
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/apply.html b/docs/manual/CoreTasks/apply.html new file mode 100644 index 000000000..f4daa05f8 --- /dev/null +++ b/docs/manual/CoreTasks/apply.html @@ -0,0 +1,131 @@ + + + + +Ant User Manual + + + + +

Apply

+

Description

+

Executes a system command. When the os attribute is specified, then +the command is only executed when Ant is run on one of the specified operating +systems.

+

The files and/or directories of a number of FileSets are passed as arguments to the system +command. The timestamp of each source file is compared to the +timestamp of a target file which is defined by a nested mapper element. At least one fileset and exactly +one mapper element are required.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
executablethe command to execute without any command line + arguments.Yes
destthe directory where the target files will be placed.Yes
dirthe directory in which the command should be executed.No
oslist of Operating Systems on which the command may be + executed.No
outputthe file to which the output of the command should be + redirected.No
timeoutStop the command if it doesn't finish within the + specified time (given in milliseconds).No
failonerrorStop the buildprocess if the command exits with a + returncode other than 0.No
parallelRun the command only once, appending all files as + arguments. If false, command will be executed once for every file. + Defaults to false. No
typeOne of file, dir or + both. If set to file, only the names of plain + files will be sent to the command. If set to dir, only + the names of directories are considered.No, default is file
+

Parameters specified as nested elements

+

fileset

+

You can use any number of nested <fileset> +elements to define the files for this task and refer to +<fileset>s defined elsewhere.

+

arg

+

Command line arguments should be specified as nested +<arg> elements. See Command line arguments.

+

srcfile

+

By default the file names of the source files will be added to the +end of the command line. If you need to place it somewhere different, +use a nested <srcfile> element between your +<arg> elements to mark the insertion point.

+

targetfile

+

<targetfile> is similar to +<srcfile> and marks the position of the target +filename on the command line. If omitted, the target filenames will +not be added to the command line at all.

+

env

+

It is possible to specify environment variables to pass to the +system command via nested <env> elements. See the +description in the section about exec

+

Please note that the environment of the current Ant process is +not passed to the system command if you specify variables using +<env>.

+

Examples

+
+<apply executable="cc" dest="src/C" parallel="false">
+  <arg value="-c"/>
+  <arg value="-o"/>
+  <targetfile/>
+  <srcfile/>
+  <fileset dir="src/C" includes="*.c"/>
+  <mapper type="glob" from="*.c" to="*.o"/>
+</apply>
+
+

invokes cc -c -o TARGETFILE SOURCEFILE for each +.c file that is newer than the corresponding +.o, replacing TARGETFILE with the absolute filename of +the .o and SOURCEFILE with the absolute name of the +.c file.

+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/available.html b/docs/manual/CoreTasks/available.html new file mode 100644 index 000000000..b487bf8f8 --- /dev/null +++ b/docs/manual/CoreTasks/available.html @@ -0,0 +1,91 @@ + + + + +Ant User Manual + + + + +

Available

+

Description

+

Sets a property if a resource is available at runtime. This resource can be a +file resource, a class in classpath or a JVM system resource.

+

If the resource is present, the property value is set to true by +default, otherwise the property is not set. You can set the value to +something specific by using the value attribute.

+

Normally, this task is used to set properties that are useful to avoid target +execution depending on system parameters.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
propertythe name of the property to set.Yes
valuethe value to set the property to. Defaults to "true".No
classnamethe class to look for in classpath.Yes
resourcethe resource to look for in the JVM
filethe file to look for.
classpath the classpath to + use when looking up classname. No
classpathrefthe classpath to use, given as reference to a path defined elsewhere.No
+

Parameters specified as nested elements

+

classpath

+

Available's classpath attribute is a path-like structure and can also be set via a nested +classpath element.

+

Examples

+
  <available classname="org.whatever.Myclass" property="Myclass.present"/>
+

sets the property Myclass.present to the value "true" +if the class org.whatever.Myclass is found in Ant's classpath.

+
+<property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/>
+<available file="${jaxp.jar}" property="jaxp.jar.present"/>
+
+

sets the property jaxp.jar.present to the value "true" +if the file ./lib/jaxp11/jaxp.jar is found.

+
+...in project ...
+<property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/>
+<path id="jaxp" location="${jaxp.jar}"/>
+...in target ...
+<available classname="javax.xml.transform.Transformer" classpathref="jaxp" property="jaxp11.present"/>
+
+

sets the property jaxp11.present to the value "true" +if the class javax.xml.transform.Transformer is found in the classpath referenced by jaxp (in this case, it is ./lib/jaxp11/jaxp.jar). +

+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/chmod.html b/docs/manual/CoreTasks/chmod.html new file mode 100644 index 000000000..918cd2d69 --- /dev/null +++ b/docs/manual/CoreTasks/chmod.html @@ -0,0 +1,122 @@ + + + + +Ant User Manual + + + + +

Chmod

+

Description

+

Changes the permissions of a file or all files inside specified directories. Right now it has effect only under Unix. +The permissions are also UNIX style, like the argument for the chmod command.

+

See the section on directory based +tasks, on how the inclusion/exclusion of files works, and how to +write patterns.

+

This task holds an implicit FileSet and +supports all of FileSet's attributes and nested elements +directly. More FileSets can be specified using nested +<fileset> elements.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
filethe file or single directory of which the permissions + must be changed.exactly one of the two or nested <fileset> elements.
dirthe directory which holds the files whose permissions + must be changed.
permthe new permissions.Yes
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
parallelprocess all specified files using a single + chmod command. Defaults to true.No
typeOne of file, dir or + both. If set to file, only the permissions of + plain files are going to be changed. If set to dir, only + the directories are considered.No, default is file
+

Examples

+
+

<chmod file="${dist}/start.sh" perm="ugo+rx"/>

+
+

makes the "start.sh" file readable and executable for anyone on a +UNIX system.

+
+
+    <chmod dir="${dist}/bin" perm="ugo+rx" includes="**/*.sh"/>
+
+
+

makes all ".sh" files below ${dist}/bin +readable and executable for anyone on a UNIX system.

+
+
+<chmod perm="g+w">
+  <fileset dir="shared/sources1">
+    <exclude name="**/trial/**"/>
+  </fileset>
+  <fileset refid="other.shared.sources"/>
+</chmod>
+
+
+

makes all files below shared/sources1 (except those +below any directory named trial) writable for members of the same +group on a UNIX system. In addition all files belonging to a FileSet +with id other.shared.sources get the same +permissions.

+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/copy.html b/docs/manual/CoreTasks/copy.html new file mode 100644 index 000000000..65a2a8d2b --- /dev/null +++ b/docs/manual/CoreTasks/copy.html @@ -0,0 +1,121 @@ + + + + +Ant User Manual + + + + +

Copy

+

Description

+

Copies a file or Fileset to a new file or directory. Files are +only copied if the source file is newer than the destination file, +or when the destination file does not exist. However, you can explicitly +overwrite files with the overwrite attribute.

+

FileSets are used to select files to copy. +To use a fileset, the todir attribute must be set.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
fileThe file to copy.One of either file or + at least one nested fileset element.
preservelastmodifiedGive the copied files the same last modified + time as the original files. Defaults to "no".No
tofileThe file to copy to.With the file attribute, + either tofile or todir can be used. With nested filesets, + only todir is allowed.
todirThe directory to copy to.
overwriteOverwrite existing files even if the destination + files are newer. Defaults to "no".No
filteringIndicates whether token filtering should take place during + the copy. Defaults to "no".No
flattenIgnore directory structure of source directory, + copy all files into a single directory, specified by the todir + attribute. Defaults to "no". Note that you can achieve the + same effect by using a flatten mapperNo
includeEmptyDirsCopy empty directories included with the nested FileSet(s). + Defaults to "yes".No
+

Parameters specified as nested elements

+

mapper

+

You can define file name transformations by using a nested mapper element. The default mapper used by +<copy> is the identity.

+

Examples

+

Copy a single file

+
+  <copy file="myfile.txt" tofile="mycopy.txt"/>
+
+

Copy a file to a directory

+
+  <copy file="myfile.txt" todir="../some/dir/tree"/>
+
+

Copy a directory to another directory

+
+  <copy todir="../new/dir">
+    <fileset dir="src_dir"/>
+  </copy>
+
+

Copy a set of files to a directory

+
+  <copy todir="../dest/dir" >
+    <fileset dir="src_dir" >
+      <exclude name="**/*.java"/>
+    </fileset>
+  </copy>
+
+  <copy todir="../dest/dir" >
+    <fileset dir="src_dir" excludes="**/*.java"/>
+  </copy>
+
+

Copy a set of files to a directory appending +".bak" to the file name on the fly

+
+  <copy todir="../backup/dir" >
+    <fileset dir="src_dir" />
+    <mapper type="glob" from="*" to="*.bak"/>
+  </copy>
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/copydir.html b/docs/manual/CoreTasks/copydir.html new file mode 100644 index 000000000..d57bfeb44 --- /dev/null +++ b/docs/manual/CoreTasks/copydir.html @@ -0,0 +1,120 @@ + + + + +Ant User Manual + + + + +

Copydir

+

Deprecated

+

This task has been deprecated. Use the Copy task instead.

+

Description

+

Copies a directory tree from the source to the destination.

+

It is possible to refine the set of files that are being copied. This can be +done with the includes, includesfile, excludes, excludesfile and defaultexcludes +attributes. With the includes or includesfile attribute you specify the files you want to +have included by using patterns. The exclude or excludesfile attribute is used to specify +the files you want to have excluded. This is also done with patterns. And +finally with the defaultexcludes attribute, you can specify whether you +want to use default exclusions or not. See the section on directory based tasks, on how the +inclusion/exclusion of files works, and how to write patterns.

+

This task forms an implicit FileSet and +supports all attributes of <fileset> +(dir becomes src) as well as the nested +<include>, <exclude> and +<patternset> elements.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
srcthe directory to copy.Yes
destthe directory to copy to.Yes
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
filteringindicates whether token filtering should take place during + the copyNo
flattenignore directory structure of source directory, + copy all files into a single directory, specified by the dest + attribute (default is false).No
forceoverwriteoverwrite existing files even if the destination + files are newer (default is false).No
+

Examples

+
  <copydir src="${src}/resources"
+           dest="${dist}"
+  />
+

copies the directory ${src}/resources to ${dist}.

+
  <copydir src="${src}/resources"
+           dest="${dist}"
+           includes="**/*.java"
+           excludes="**/Test.java"
+  />
+

copies the directory ${src}/resources to ${dist} +recursively. All java files are copied, except for files with the name Test.java.

+
  <copydir src="${src}/resources"
+           dest="${dist}"
+           includes="**/*.java"
+           excludes="mypackage/test/**"/>
+

copies the directory ${src}/resources to ${dist} +recursively. All java files are copied, except for the files under the mypackage/test +directory.

+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/copyfile.html b/docs/manual/CoreTasks/copyfile.html new file mode 100644 index 000000000..129cfadbc --- /dev/null +++ b/docs/manual/CoreTasks/copyfile.html @@ -0,0 +1,59 @@ + + + + +Ant User Manual + + + + +

Copyfile

+

Deprecated

+

This task has been deprecated. Use the Copy task instead.

+

Description

+

Copies a file from the source to the destination. The file is only copied if +the source file is newer than the destination file, or when the destination file +does not exist.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
srcthe filename of the file to copy.Yes
destthe filename of the file where to copy to.Yes
filteringindicates whether token filtering should take place during + the copyNo
forceoverwriteoverwrite existing files even if the destination + files are newer (default is false).No
+

Examples

+
+

<copyfile src="test.java" dest="subdir/test.java" + />

+

<copyfile src="${src}/index.html" dest="${dist}/help/index.html" + />

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/cvs.html b/docs/manual/CoreTasks/cvs.html new file mode 100644 index 000000000..8b26e86cf --- /dev/null +++ b/docs/manual/CoreTasks/cvs.html @@ -0,0 +1,97 @@ + + + + +Ant User Manual + + + + +

Cvs

+

Description

+

Handles packages/modules retrieved from a +CVS repository.

+

When doing automated builds, the get task should be +preferred over the checkout command, because of speed.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
commandthe CVS command to execute.No, default "checkout"
cvsRootthe CVSROOT variable.No
destthe directory where the checked out files should be placed.No, default is project's basedir.
packagethe package/module to check out.No
tagthe tag of the package/module to check out.No
dateUse the most recent revision no later than the given dateNo
quietsuppress informational messages.No, default "false"
noexecreport only, don't change any files.No, default "false"
outputthe file to direct standard output from the command.No, default output to ANT Log as MSG_INFO.
errorthe file to direct standard error from the command.No, default error to ANT Log as MSG_WARN.
+

Examples

+
  <cvs cvsRoot=":pserver:anoncvs@jakarta.apache.org:/home/cvspublic"
+       package="jakarta-tools"
+       dest="${ws.dir}"
+  />
+

checks out the package/module "jakarta-tools" from the CVS +repository pointed to by the cvsRoot attribute, and stores the files in "${ws.dir}".

+
  <cvs dest="${ws.dir}" command="update"/>
+

updates the package/module that has previously been checked out into +"${ws.dir}".

+
  <cvs command="-q diff -u -N" output="patch.txt"/>
+

silently (-q) creates a file called patch.txt which contains a unified (-u) diff which includes new files added via "cvs add" (-N) and can be used as input to patch.

+
  <cvs command="update -A -d"/>
+

Updates from the head of repository ignoring sticky bits (-A) and creating any new directories as necessary (-d).

+

Note: the text of the command is passed to cvs "as-is" so any cvs options should appear +before the command, and any command options should appear after the command as in the diff example +above. See the cvs manual for details, +specifically the Guide to CVS commands

+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/delete.html b/docs/manual/CoreTasks/delete.html new file mode 100644 index 000000000..563325173 --- /dev/null +++ b/docs/manual/CoreTasks/delete.html @@ -0,0 +1,110 @@ + + + + +Ant User Manual + + + + +

Delete

+

Description

+

Deletes either a single file, all files in a specified directory and its +sub-directories, or a set of files specified by one or more FileSets. +When specifying a set of files, empty directories are not removed by default. +To remove empty directories, use the includeEmptyDirs atribute.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
fileThe file to delete.at least one of the two
dirThe directory to delete files from.
verboseShow name of each deleted file ("true"/"false"). + Default is "false" when omitted.No
quietIf the file does not exist, do not display a diagnostic + message or modify the exit status to reflect an error. + This means that if a file or directory cannot be deleted, + then no error is reported. This setting emulates the + -f option to the Unix "rm" command. + ("true"/"false"). + Default is "false" meaning things are "noisy".No
includeEmptyDirsSet to "true" to delete empty directories when + using filesets. Default is "false".No
includesDeprecated. Comma separated list of patterns of files that must be + deleted. All files are in the current directory + and any sub-directories are deleted when omitted.No
includesfileDeprecated. The name of a file. Each line of this file is + taken to be an include patternNo
excludesDeprecated. Comma separated list of patterns of files that must be + excluded from the deletion list. No files (except default excludes) are excluded when omitted.No
excludesfileDeprecated. The name of a file. Each line of this file is + taken to be an exclude patternNo
defaultexcludesDeprecated. Indicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
+

Examples

+
  <delete file="/lib/ant.jar"/>
+

deletes the file /lib/ant.jar.

+
  <delete dir="lib"/>
+

deletes the lib directory, including all files +and subdirectories of lib.

+
  <delete>
+    <fileset dir="." includes="**/*.bak"/>
+  </delete>
+
+

deletes all files with the extension ".bak" from the current directory +and any sub-directories.

+
  <delete includeEmptyDirs="true" >
+    <fileset dir="build" />
+  </delete>
+
+

deletes all files and subdirectories of build, but not +build itself.

+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/deltree.html b/docs/manual/CoreTasks/deltree.html new file mode 100644 index 000000000..576b76959 --- /dev/null +++ b/docs/manual/CoreTasks/deltree.html @@ -0,0 +1,40 @@ + + + + +Ant User Manual + + + + +

Deltree

+

Deprecated

+

This task has been deprecated. Use the Delete task instead.

+

Description

+

Deletes a directory with all its files and subdirectories.

+

Parameters

+ + + + + + + + + + + +
AttributeDescriptionRequired
dirthe directory to delete.Yes
+

Examples

+
  <deltree dir="dist"/>
+

deletes the directory dist, including its files and +subdirectories.

+
  <deltree dir="${dist}"/>
+

deletes the directory ${dist}, including its files and +subdirectories.

+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/echo.html b/docs/manual/CoreTasks/echo.html new file mode 100644 index 000000000..49510f768 --- /dev/null +++ b/docs/manual/CoreTasks/echo.html @@ -0,0 +1,51 @@ + + + + +Ant User Manual + + + + +

Echo

+

Description

+

Echoes a message to System.out or a file.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
messagethe message to echo.Yes, unless data is included in a + character section within this element.
filethe file to write the message to.No
appendAppend to an existing file?No – default is false.
+

Examples

+
  <echo message="Hello world"/>
+
  
+<echo>
+This is a longer message stretching over
+two lines.
+</echo>
+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/exec.html b/docs/manual/CoreTasks/exec.html new file mode 100644 index 000000000..1f029efd8 --- /dev/null +++ b/docs/manual/CoreTasks/exec.html @@ -0,0 +1,144 @@ + + + + +Ant User Manual + + + + +

Exec

+

Description

+

Executes a system command. When the os attribute is specified, then +the command is only executed when Ant is run on one of the specified operating +systems.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
commandthe command to execute with all command line + arguments. deprecated, use executable and nested + <arg> elements instead.Exactly one of the two.
executablethe command to execute without any command line + arguments.
dirthe directory in which the command should be executed.No
oslist of Operating Systems on which the command may be + executed.No
outputthe file to which the output of the command should be + redirected.No
timeoutStop the command if it doesn't finish within the + specified time (given in milliseconds).No
failonerrorStop the buildprocess if the command exits with a + returncode other than 0.No
newenvironmentDo not propagate old environment when new environment + variables are specified.No, default is false
+

Examples

+
+
+<exec dir="${src}" executable="cmd.exe" os="Windows 2000" output="dir.txt">
+  <arg line="/c dir"/>
+</exec>
+
+

Parameters specified as nested elements

+

arg

+

Command line arguments should be specified as nested +<arg> elements. See Command line arguments.

+

env

+

It is possible to specify environment variables to pass to the +system command via nested <env> elements.

+

Please note that the environment of the current Ant process is +not passed to the system command if you specify variables using +<env>.

+ + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
keyThe name of the environment variable.Yes
valueThe literal value for the environment variable.Exactly one of these.
pathThe value for a PATH like environment + variable. You can use ; or : as path separators and Ant will + convert it to the platform's local conventions.
fileThe value for the environment variable. Will be + replaced by the absolute filename of the file by Ant.
+
Examples
+
+<exec executable="emacs" >
+  <env key="DISPLAY" value=":1.0"/>
+</exec>
+
+

starts emacs on display 1 of the X Window System.

+
+<exec ... >
+  <env key="PATH" path="${java.library.path}:${basedir}/bin"/>
+</exec>
+
+

adds ${basedir}/bin to the PATH of the +system command.

+

Note: Although it may work for you to specify arguments using +a simple arg-element and separate them by spaces it may fail if you switch to +a newer version of the JDK. JDK < 1.2 will pass these as separate arguments +to the program you are calling, JDK >= 1.2 will pass them as a single +argument and cause most calls to fail.

+

Note2: If you are using Ant on Windows and a new DOS-Window pops up +for every command which is executed this may be a problem of the JDK you are using. +This problem may occur with all JDK's < 1.2.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/execon.html b/docs/manual/CoreTasks/execon.html new file mode 100644 index 000000000..124097ec1 --- /dev/null +++ b/docs/manual/CoreTasks/execon.html @@ -0,0 +1,138 @@ + + + + +Ant User Manual + + + + +

ExecOn

+

Description

+

Executes a system command. When the os attribute is specified, then +the command is only executed when Ant is run on one of the specified operating +systems.

+

The files and/or directories of a number of FileSets are passed as arguments to the system +command. At least one nested <fileset> is required.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
executablethe command to execute without any command line + arguments.Yes
dirthe directory in which the command should be executed.No
oslist of Operating Systems on which the command may be + executed.No
outputthe file to which the output of the command should be + redirected.No
timeoutStop the command if it doesn't finish within the + specified time (given in milliseconds).No
failonerrorStop the buildprocess if the command exits with a + returncode other than 0.No
newenvironmentDo not propagate old environment when new environment + variables are specified.No, default is false
parallelRun the command only once, appending all files as + arguments. If false, command will be executed once for every file. + Defaults to false. No
typeOne of file, dir or + both. If set to file, only the names of plain + files will be sent to the command. If set to dir, only + the names of directories are considered.No, default is file
+

Parameters specified as nested elements

+

fileset

+

You can use any number of nested <fileset> +elements to define the files for this task and refer to +<fileset>s defined elsewhere.

+

arg

+

Command line arguments should be specified as nested +<arg> elements. See Command line arguments.

+

srcfile

+

By default the file names of the source files will be added to the +end of the command line. If you need to place it somewhere different, +use a nested <srcfile> element between your +<arg> elements to mark the insertion point.

+

env

+

It is possible to specify environment variables to pass to the +system command via nested <env> elements. See the +description in the section about exec

+

Please note that the environment of the current Ant process is +not passed to the system command if you specify variables using +<env>.

+

Examples

+
+<execon executable="ls" >
+  <arg value="-l"/>
+  <fileset dir="/tmp">
+    <patternset>
+      <exclude name="**/*.txt"/>
+    </patternset>
+  </fileset>
+  <fileset refid="other.files"/>
+</execon>
+
+

invokes ls -l, adding the absolute filenames of all +files below /tmp not ending in .txt and all +files of the FileSet with id other.files to +the command line.

+
+<execon executable="somecommand" parallel="false" >
+  <arg value="arg1"/>
+  <srfile/>
+  <arg value="arg2"/>
+  <fileset dir="/tmp"/>
+</execon>
+
+

invokes somecommand arg1 SOURCEFILENAME arg2 for each +file in /tmp replacing SOURCEFILENAME with the absolute +filename of each file in turn. If parallel had been set +to true, SOURCEFILENAME would be replaced with the absolute filenames +of all files separated by spaces.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/fail.html b/docs/manual/CoreTasks/fail.html new file mode 100644 index 000000000..3fc76814c --- /dev/null +++ b/docs/manual/CoreTasks/fail.html @@ -0,0 +1,50 @@ + + + + +Ant User Manual + + + + +

Fail

+

Description

+

Exits the current build (just throwing a BuildException), optionally printing additional information.

+

Parameters

+ + + + + + + + + + + +
AttributeDescriptionRequired
messageA message giving further information on why the build exitedNo
+

Examples

+
  <fail/>
+

will exit the current build with no further information given.

+
+BUILD FAILED
+
+build.xml:4: No message
+
+ +
  <fail message="Something wrong here."/>
+

will exit the current build and print something like the following to wherever +your output goes:

+
+BUILD FAILED
+
+build.xml:4: Something wrong here.
+
+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/filter.html b/docs/manual/CoreTasks/filter.html new file mode 100644 index 000000000..52e66d422 --- /dev/null +++ b/docs/manual/CoreTasks/filter.html @@ -0,0 +1,63 @@ + + + + +Ant User Manual + + + + +

Filter

+

Description

+

Sets a token filter for this project or read multiple token filter from +an input file and sets these as filters. +Token filters are used by all tasks that perform file copying operations +through the Project commodity methods.

+

Note 1: the token string must not contain the separators chars (@).
+Note 2: Either token and value attributes must be provided, or only the +filterfile attribute.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
tokenthe token string without @Yes*
valuethe string that should be put to replace the token when the + file is copiedYes*
filtersfileThe file from which the filters must be read. This file must be a formatted as a property file. Yes*
+

* see notes 1 and 2 above parameters table.

+

Examples

+
  <filter token="year" value="2000"/>
+  <copy todir="${dest.dir}">
+    <fileset dir="${src.dir}"/>
+  </copy>
+

will copy recursively all the files from the src.dir directory into +the dest.dir directory replacing all the occurences of the string @year@ +with 2000.

+
  <filter filterfile="deploy_env.properties"/>
+will read all property entries from the deploy_env.properties file +and set these as filters. + +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/fixcrlf.html b/docs/manual/CoreTasks/fixcrlf.html new file mode 100644 index 000000000..287ad0e80 --- /dev/null +++ b/docs/manual/CoreTasks/fixcrlf.html @@ -0,0 +1,168 @@ + + + + +Ant User Manual + + + + +

FixCRLF

+

Description

+

Adjusts a text file to local.

+

It is possible to refine the set of files that are being adjusted. This can be +done with the includes, includesfile, excludes, excludesfile and defaultexcludes +attributes. With the includes or includesfile attribute you specify the files you want to +have included by using patterns. The exclude or excludesfile attribute is used to specify +the files you want to have excluded. This is also done with patterns. And +finally with the defaultexcludes attribute, you can specify whether you +want to use default exclusions or not. See the section on directory based tasks, on how the +inclusion/exclusion of files works, and how to write patterns.

+

This task forms an implicit FileSet and +supports all attributes of <fileset> +(dir becomes srcdir) as well as the nested +<include>, <exclude> and +<patternset> elements.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
srcDirWhere to find the files to be fixed up.Yes
destDirWhere to place the corrected files. Defaults to + srcDir (replacing the original file)No
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
crSpecifies how carriage return (CR) characters are to + be handled. Valid values for this property are: +
    +
  • add: ensure that there is a CR before every LF
  • +
  • asis: leave CR characters alone
  • +
  • remove: remove all CR characters
  • +
+ Default is based on the platform on which you are running this task. + For Unix platforms, the default is remove. For DOS based systems + (including Windows), the default is add. +

+ Note: Unless this property is specified as "asis", extra CR characters + which do not precede a LF will be removed.

+
No
tabSpecifies how tab characters are to be handled. Valid + values for this property are: +
    +
  • add: convert sequences of spaces which span a tab stop to tabs
  • +
  • asis: leave tab and space characters alone
  • +
  • remove: convert tabs to spaces
  • +
+ Default for this parameter is "asis". +

+ Note: Unless this property is specified as "asis", extra spaces and + tabs after the last non-whitespace character on the line will be removed.

+
No
tablengthThe number of characters a TAB stop corresponds to. + Must be a positive power of 2, default for this parameter is 8.No
eofSpecifies how DOS end of file (control-Z) characters are + to be handled. Valid values for this property are: +
    +
  • add: ensure that there is an EOF character at the end of the file
  • +
  • asis: leave EOF characters alone
  • +
  • remove: remove any EOF character found at the end
  • +
+ Default is based on the platform on which you are running this task. + For Unix platforms, the default is remove. For DOS based systems + (including Windows), the default is asis. +
No
+

Examples

+
  <fixcrlf srcdir="${src}"
+       cr="remove" eof="remove"
+       includes="**/*.sh"
+  />
+

Removes carriage return and eof characters from the shell scripts. Tabs and +spaces are left as is.

+
  <fixcrlf srcdir="${src}"
+       cr="add"
+       includes="**/*.bat"
+  />
+

Ensures that there are carriage return characters prior to evey line feed. +Tabs and spaces are left as is. +EOF characters are left alone if run on +DOS systems, and are removed if run on Unix systems.

+
  <fixcrlf srcdir="${src}"
+       tabs="add"
+       includes="**/Makefile"
+  />
+

Adds or removes CR characters to match local OS conventions, and +converts spaces to tabs when appropriate. EOF characters are left alone if +run on DOS systems, and are removed if run on Unix systems. +Many versions of make require tabs prior to commands.

+
  <fixcrlf srcdir="${src}"
+       tabs="remove"
+       includes="**/README*"
+  />
+

Adds or removes CR characters to match local OS conventions, and +converts all tabs to spaces. EOF characters are left alone if run on +DOS systems, and are removed if run on Unix systems. +You never know what editor a user will use to browse README's.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/genkey.html b/docs/manual/CoreTasks/genkey.html new file mode 100644 index 000000000..855983433 --- /dev/null +++ b/docs/manual/CoreTasks/genkey.html @@ -0,0 +1,103 @@ + + + + +Ant User Manual + + + + +

GenKey

+

Description

+

Generates a key in keystore.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
aliasthe alias to add underYes.
storepasspassword for keystore integrity.Yes.
keystorekeystore locationNo
storetypekeystore typeNo
keypasspassword for private key (if different)No
sigalgthe algorithm to use in signingNo
keyalgthe method to use when generating name-value pairNo
verbose(true | false) verbose output when signingNo
dnameThe distinguished name for entityYes if dname element unspecified
validity(integer) indicates how many days certificate is validNo
keysize(integer) indicates the size of key generatedNo
+ +

Alternatively you can specify the distinguished name by creating a sub-element named dname and populating it with param elements that have a name and a value. When using the subelement it is automatically encoded properly and , are replace

+

The following two examples are identical:

+ +

Examples

+
+

<genkey alias="apache-group" storepass="secret" + dname="CN=Ant Group, OU=Jakarta Division, O=Apache.org, C=US"/>

+
+ +
+
<genkey alias="apache-group" storepass="secret" >
+  <dname>
+    <param name="CN" value="Ant Group"/>
+    <param name="OU" value="Jakarta Division"/>
+    <param name="O"  value="Apache.Org"/>
+    <param name="C"  value="US"/>
+  </dname>
+</genkey>
+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/get.html b/docs/manual/CoreTasks/get.html new file mode 100644 index 000000000..7337de5d2 --- /dev/null +++ b/docs/manual/CoreTasks/get.html @@ -0,0 +1,77 @@ + + + + +Ant User Manual + + + + +

Get

+

Description

+

Gets a file from a URL. When the verbose option is "on", this task +displays a '.' for every 100 Kb retrieved.

+

This task should be preferred above the CVS task when +doing automated builds. CVS is significantly slower than loading a compressed +archive with http/ftp.

+ +The usetimestamp option enables you to control downloads so that the remote file is +only fetched if newer than the local copy. If there is no local copy, the download always takes +place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp, +if the JVM is Java1.2 or later. +NB: This timestamp facility only works on downloads using the HTTP protocol. +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
srcthe URL from which to retrieve a file.Yes
destthe file where to store the retrieved file.Yes
verboseshow verbose progress information ("on"/"off").No
ignoreerrorsLog errors but don't treat as fatal.No
usetimestampconditionally download a file based on the timestamp of the local copy. + HTTP onlyNo
+

Examples

+
  <get src="http://jakarta.apache.org/" dest="help/index.html"/>
+

Gets the index page of http://jakarta.apache.org/, and stores it in the file help/index.html.

+ +
  <get src="http://jakarta.apache.org/builds/tomcat/nightly/ant.zip" 
+	dest="optional.jar" 
+	verbose="true"
+	usetimestamp="true"/>
+

+Gets the nightly ant build from the tomcat distribution, if the local copy +is missing or out of date. Uses the verbose option +for progress information. +

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/gunzip.html b/docs/manual/CoreTasks/gunzip.html new file mode 100644 index 000000000..b18fcd688 --- /dev/null +++ b/docs/manual/CoreTasks/gunzip.html @@ -0,0 +1,59 @@ + + + + +Ant User Manual + + + + +

GUnzip

+

Description

+

Expands a GZip file.

+ +

If dest is a directory the name of the destination file is +the same as src (with the ".gz" extension removed if +present). If dest is omitted, the parent dir of src is +taken. The file is only expanded if the source file is newer than the +destination file, or when the destination file does not exist.

+ +

Parameters

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
srcthe file to expand.Yes
destthe destination file or directory.No
+

Examples

+
+

<gunzip src="test.tar.gz"/>

+
+

expands test.tar.gz to test.tar

+
+

<gunzip src="test.tar.gz" dest="test2.tar"/>

+
+

expands test.tar.gz to test2.tar

+
+

<gunzip src="test.tar.gz" dest="subdir"/>

+
+

expands test.tar.gz to subdir/test.tar (assuming +subdir is a directory).

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/gzip.html b/docs/manual/CoreTasks/gzip.html new file mode 100644 index 000000000..9baf72b51 --- /dev/null +++ b/docs/manual/CoreTasks/gzip.html @@ -0,0 +1,42 @@ + + + + +Ant User Manual + + + + +

GZip

+

Description

+

GZips a file.

+

Parameters

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
srcthe file to gzip.Yes
zipfilethe destination file.Yes
+

Examples

+
+

<gzip src="test.tar" zipfile="test.tar.gz" + />

+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/jar.html b/docs/manual/CoreTasks/jar.html new file mode 100644 index 000000000..516eb7764 --- /dev/null +++ b/docs/manual/CoreTasks/jar.html @@ -0,0 +1,150 @@ + + + + +Ant User Manual + + + + +

Jar

+

Description

+

Jars a set of files.

+

The basedir attribute is the reference directory from where to jar.

+

Note that file permissions will not be stored in the resulting jarfile.

+

It is possible to refine the set of files that are being jarred. This can be +done with the includes, includesfile, excludes, excludesfile and defaultexcludes +attributes. With the includes or includesfile attribute you specify the files you want to +have included by using patterns. The exclude or excludesfile attribute is used to specify +the files you want to have excluded. This is also done with patterns. And +finally with the defaultexcludes attribute, you can specify whether you +want to use default exclusions or not. See the section on directory based tasks, on how the +inclusion/exclusion of files works, and how to write patterns.

+

This task forms an implicit FileSet and +supports all attributes of <fileset> +(dir becomes basedir) as well as the nested +<include>, <exclude> and +<patternset> elements.

+

You can also use nested file sets for more flexibility, and specify +multiple ones to merge together different trees of files into one JAR. +The extended fileset attributes from the zip task are also available +in the jar task. +See the Zip task for more details and examples.

+

If the manifest is omitted, a simple one will be supplied by Ant. +You should not include META-INF/MANIFEST.MF in your set of files.

+

The whenempty parameter controls what happens when no files match. +If create (the default), the JAR is created anyway with only a manifest. +If skip, the JAR is not created and a warning is issued. +If fail, the JAR is not created and the build is halted with an error.

+

(The Jar task is a shortcut for specifying the manifest file of a JAR file. +The same thing can be accomplished by using the fullpath +attribute of a zipfileset in a Zip task. The one difference is that if the +manifest attribute is not specified, the Jar task will +include an empty one for you.)

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
jarfilethe jar-file to create.Yes
basedirthe directory from which to jar the files.No
compressNot only store data but also compress them, defaults to trueNo
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
manifestthe manifest file to use.No
whenemptyBehavior to use if no files match.No
+

Examples

+
  <jar jarfile="${dist}/lib/app.jar" basedir="${build}/classes"/>
+

jars all files in the ${build}/classes directory into a file +called app.jar in the ${dist}/lib directory.

+
  <jar jarfile="${dist}/lib/app.jar"
+       basedir="${build}/classes"
+       excludes="**/Test.class"
+  />
+

jars all files in the ${build}/classes directory into a file +called app.jar in the ${dist}/lib directory. Files +with the name Test.class are excluded.

+
  <jar jarfile="${dist}/lib/app.jar"
+       basedir="${build}/classes"
+       includes="mypackage/test/**"
+       excludes="**/Test.class"
+  />
+

jars all files in the ${build}/classes directory into a file +called app.jar in the ${dist}/lib directory. Only +files under the directory mypackage/test are used, and files with +the name Test.class are excluded.

+
  <jar jarfile="${dist}/lib/app.jar">
+    <fileset dir="${build}/classes"
+             excludes="**/Test.class"
+    />
+    <fileset dir="${src}/resources"/>
+  </jar>
+

jars all files in the ${build}/classes directory and also +in the ${src}/resources directory together into a file +called app.jar in the ${dist}/lib directory. +Files with the name Test.class are excluded. +If there are files such as ${build}/classes/mypackage/MyClass.class +and ${src}/resources/mypackage/image.gif, they will appear +in the same directory in the JAR (and thus be considered in the same package +by Java).

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/java.html b/docs/manual/CoreTasks/java.html new file mode 100644 index 000000000..93ffe00c6 --- /dev/null +++ b/docs/manual/CoreTasks/java.html @@ -0,0 +1,135 @@ + + + + +Ant User Manual + + + + +

Java

+

Description

+

Executes a Java class within the running (Ant) VM or forks another VM if +specified.

+

Be careful that the executed class doesn't call System.exit(), because it +will terminate the VM and thus Ant. In case this happens, it's highly suggested +that you set the fork attribute so that System.exit() stops the other VM and not +the one that is currently running Ant.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
classnamethe Java class to execute.Yes
argsthe arguments for the class that is + executed. deprecated, use nested <arg> + elements instead.No
classpaththe classpath to use.No
classpathrefthe classpath to use, given as reference to a PATH defined elsewhere.No
forkif enabled triggers the class execution in another VM + (disabled by default)No
jvmthe command used to invoke the Java Virtual Machine, + default is 'java'. The command is resolved by java.lang.Runtime.exec(). + Ignored if fork is disabled. + No
jvmargsthe arguments to pass to the forked VM (ignored + if fork is disabled). deprecated, use nested + <jvmarg> elements instead.No
maxmemoryMax amount of memory to allocate to the forked VM + (ignored if fork is disabled)No
failonerrorStop the buildprocess if the command exits with a + returncode other than 0. Only available if fork is true.No
dirThe directory to invoke the VM in. (ignored if + fork is disabled)No
outputName of a file to write the output to.No
+

Parameters specified as nested elements

+

arg and jvmarg

+

Use nested <arg> and <jvmarg> +elements to specify arguments for the or the forked VM. See Command line arguments.

+

sysproperty

+

Use nested <sysproperty> +elements to specify system properties required by the class. +These properties will be made available to the VM during the execution +of the class (either ANT's VM or the forked VM). The attributes +for this element are the same as for environment +variables.

+

classpath

+

Java's classpath attribute is a PATH like structure and can also be set via a nested +classpath element.

+
Example
+
  
+       <java classname="test.Main" >
+         <arg value="-h"/> 
+         <classpath>
+           <pathelement location="\test.jar"/>
+           <pathelement path="${java.class.path}"/>
+         </classpath>
+       </java>
+
+

Examples

+
  <java classname="test.Main"/>
+
  <java classname="test.Main"
+        fork="yes" >
+    <sysproperty key="DEBUG" value="true"/> 
+    <arg value="-h"/> 
+    <jvmarg value="-Xrunhprof:cpu=samples,file=log.txt,depth=3"/> 
+  </java>
+
+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/javac.html b/docs/manual/CoreTasks/javac.html new file mode 100644 index 000000000..96b8e6ae0 --- /dev/null +++ b/docs/manual/CoreTasks/javac.html @@ -0,0 +1,250 @@ + + + + +Ant User Manual + + + + +

Javac

+

Description

+

Compiles a source tree within the running (Ant) VM.

+

The source and destination directory will be recursively scanned for Java +source files to compile. Only Java files that have no corresponding class file +or where the class file is older than the java file will be compiled.

+

The directory structure of the source tree should follow the package +hierarchy.

+

It is possible to refine the set of files that are being compiled/copied. +This can be done with the includes, includesfile, excludes, excludesfile and defaultexcludes +attributes. With the includes or includesfile attribute you specify the files you want to +have included by using patterns. The exclude or excludesfile attribute is used to specify +the files you want to have excluded. This is also done with patterns. And +finally with the defaultexcludes attribute, you can specify whether you +want to use default exclusions or not. See the section on directory based tasks, on how the +inclusion/exclusion of files works, and how to write patterns.

+

It is possible to use different compilers. This can be selected with the +"build.compiler" property. There are four choices:

+
    +
  • classic (the standard compiler of JDK 1.1/1.2)
  • +
  • modern (the new compiler of JDK 1.3)
  • +
  • jikes (the Jikes + compiler)
  • +
  • jvc (the Command-Line Compiler from Microsoft's SDK for Java / + Visual J++)
  • +
+

For JDK 1.1/1.2, classic is the default. For JDK 1.3, modern is the default. +If you wish to use a different compiler interface than one of the four +supplied, write a class that implements the CompilerAdapter interface +(package org.apache.tools.ant.taskdefs.compilers). Supply the full +classname in the "build.compiler" property. +

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
srcdirlocation of the java files.Yes, unless nested <src> elements are present.
destdirlocation to store the class files.No
includescomma-separated list of patterns of files that must be + included; all files are included when omitted.No
includesfilethe name of a file that contains + include patterns.No
excludescomma-separated list of patterns of files that must be + excluded; no files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file that contains + exclude patterns.No
defaultexcludesindicates whether default excludes should be used + (yes | no); default excludes are used when omitted.No
classpaththe classpath to use.No
bootclasspathlocation of bootstrap class files.No
classpathrefthe classpath to use, given as a + reference to a PATH defined elsewhere.No
bootclasspathreflocation of bootstrap class files, given as a + reference to a PATH defined elsewhere.No
extdirslocation of installed extensions.No
encodingencoding of source files.No
debugindicates whether source should be compiled with debug + information; defaults to off.No
optimizeindicates whether source should be compiled with + optimization; defaults to off.No
deprecationindicates whether source should be compiled with + deprecation information; defaults to off.No
targetgenerate class files for specific VM version (e.g., + 1.1 or 1.2).No
verboseasks the compiler for verbose output.No
depend enables dependency-tracking + for compilers that support this (jikes and classic)No
includeAntRuntimewhether to include the Ant run-time libraries; + defaults to no.No
includeJavaRuntimewhether to include the default run-time + libraries from the executing VM; defaults to no.No
failonerror + indicates whether the build will continue even if there are compilation errors; defaults to true. + No
+ +

Parameters specified as nested elements

+

This task forms an implicit FileSet and +supports all attributes of <fileset> +(dir becomes srcdir) as well as the nested +<include>, <exclude> and +<patternset> elements.

+

src, classpath, bootclasspath and extdirs

+

Javac's srcdir, classpath, +bootclasspath and extdirs attributes are path-like structures and can also be set via nested +<src>, +<classpath>, +<bootclasspath> and +<extdirs> elements, respectively.

+ +

Examples

+
  <javac srcdir="${src}"
+         destdir="${build}"
+         classpath="xyz.jar"
+         debug="on"
+  />
+

compiles all .java files under the ${src} +directory, and stores +the .class files in the ${build} directory. +The classpath used contains xyz.jar, and debug information is on.

+
  <javac srcdir="${src}"
+         destdir="${build}"
+         includes="mypackage/p1/**,mypackage/p2/**"
+         excludes="mypackage/p1/testpackage/**"
+         classpath="xyz.jar"
+         debug="on"
+  />
+

compiles .java files under the ${src} +directory, and stores the +.class files in the ${build} directory. +The classpath used contains xyz.jar, and debug information is on. +Only files under mypackage/p1 and mypackage/p2 are +used. Files in the mypackage/p1/testpackage directory are excluded +from compilation.

+ +
  <javac srcdir="${src}:${src2}"
+         destdir="${build}"
+         includes="mypackage/p1/**,mypackage/p2/**"
+         excludes="mypackage/p1/testpackage/**"
+         classpath="xyz.jar"
+         debug="on"
+  />
+ +

is the same as the previous example, with the addition of a second +source path, defined by +the property src2. This can also be represented using nested +<src> elements as follows:

+ +
  <javac destdir="${build}"
+         classpath="xyz.jar"
+         debug="on">
+    <src path="${src}"/>
+    <src path="${src2}"/>
+    <include name="mypackage/p1/**"/>
+    <include name="mypackage/p2/**"/>
+    <exclude name="mypackage/p1/testpackage/**"/>
+  </javac>
+ +

Note: If you are using Ant on Windows and a new DOS window pops up +for every use of an external compiler, this may be a problem of the JDK you are using. +This problem may occur with all JDKs < 1.2.

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/javadoc.html b/docs/manual/CoreTasks/javadoc.html new file mode 100644 index 000000000..5f91071a5 --- /dev/null +++ b/docs/manual/CoreTasks/javadoc.html @@ -0,0 +1,464 @@ + + + + +Ant User Manual + + + + +

Javadoc/Javadoc2

+

Description

+

Generates code documentation using the javadoc tool.

+

The source directory will be recursively scanned for Java source files to process +but only those matching the inclusion rules, and not matching the exclusions rules +will be passed to the javadoc tool. This +allows wildcards to be used to choose between package names, reducing verbosity +and management costs over time. This task, however, has no notion of +"changed" files, unlike the javac task. This means +all packages will be processed each time this task is run. In general, however, +this task is used much less frequently.

+

This task works seamlessly between different javadoc versions (1.1 and 1.2), +with the obvious restriction that the 1.2 attributes will be ignored if run in a +1.1 VM.

+

NOTE: since javadoc calls System.exit(), javadoc cannot be run inside the +same VM as ant without breaking functionality. For this reason, this task +always forks the VM. This overhead is not significant since javadoc is normally a heavy +application and will be called infrequently.

+

NOTE: the packagelist attribute allows you to specify the list of packages to +document outside of the Ant file. It's a much better practice to include everything +inside the build.xml file. This option was added in order to make it easier to +migrate from regular makefiles, where you would use this option of javadoc. +The packages listed in packagelist are not checked, so the task performs even +if some packages are missing or broken. Use this option if you wish to convert from +an existing makefile. Once things are running you should then switch to the regular +notation.

+ +

DEPRECATION: the javadoc2 task simply points to the javadoc task and it's +there for back compatibility reasons. Since this task will be removed in future +versions, you are strongly encouraged to use javadoc +instead.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionAvailabilityRequired
sourcepathSpecify where to find source filesallAt least one of the two or nested + <sourcepath>
sourcepathrefSpecify where to find source files by reference to a PATH defined elsewhere.all
destdirDestination directory for output filesallYes
maxmemoryMax amount of memory to allocate to the javadoc VMallNo
sourcefilesComma separated list of source filesallat least one of the two
packagenamesComma separated list of package files (with terminating + wildcard)all
packageListThe name of a file containing the packages to processallNo
classpathSpecify where to find user class filesallNo
BootclasspathOverride location of class files loaded by the bootstrap + class loader1.2No
classpathrefSpecify where to find user class files by reference to a PATH defined elsewhere.allNo
bootclasspathrefOverride location of class files loaded by the + bootstrap class loader by reference to a + PATH defined elsewhere.1.2No
ExtdirsOverride location of installed extensions1.2No
OverviewRead overview documentation from HTML file1.2No
PublicShow only public classes and membersallNo
ProtectedShow protected/public classes and members (default)allNo
PackageShow package/protected/public classes and membersallNo
PrivateShow all classes and membersallNo
OldGenerate output using JDK 1.1 emulating doclet1.2No
VerboseOutput messages about what Javadoc is doing1.2No
LocaleLocale to be used, e.g. en_US or en_US_WIN1.2No
EncodingSource file encoding nameallNo
VersionInclude @version paragraphsallNo
UseCreate class and package usage pages1.2No
AuthorInclude @author paragraphsallNo
SplitindexSplit index into one file per letter1.2No
WindowtitleBrowser window title for the documentation (text)1.2No
DoctitleInclude title for the package index(first) page (html-code)1.2No
HeaderInclude header text for each page (html-code)1.2No
FooterInclude footer text for each page (html-code)1.2No
bottomInclude bottom text for each page (html-code)1.2No
linkCreate links to javadoc output at the given URL1.2No
linkofflineLink to docs at <url> using package list at + <url2>1.2No
groupGroup specified packages together in overview page1.2No
nodeprecatedDo not include @deprecated informationallNo
nodeprecatedlistDo not generate deprecated list1.2No
notreeDo not generate class hierarchyallNo
noindexDo not generate indexallNo
nohelpDo not generate help link1.2No
nonavbarDo not generate navigation bar1.2No
serialwarnFUTURE: Generate warning about @serial tag1.2No
helpfileFUTURE: Specifies the HTML help file to use1.2No
stylesheetfileSpecifies the CSS stylesheet to use1.2No
charsetFUTURE: Charset for cross-platform viewing of generated + documentation1.2No
docencodingOutput file encoding name1.1No
docletSpecifies the class file that starts the doclet used in generating the documentation.1.2No
docletpathSpecifies the path to the doclet class file that is specified with the -doclet option.1.2No
docletpathrefSpecifies the path to the doclet class file that + is specified with the -doclet option by reference to a PATH defined elsewhere.1.2No
additionalparamLets you add additional parameters to the javadoc command line. Useful for doclets1.2No
failonerrorStop the buildprocess if the command exits with a + returncode other than 0.allNo
+ +

Parameters specified as nested elements

+

link

+

Create link to javadoc output at the given URL. This performs the +same role as the link and linkoffline attributes. You can use either +syntax (or both at once), but with the nested elements you can easily +specify multiple occurrences of the arguments.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
hrefThe URL for the external documentation you wish to link toYes
offlineTrue if this link is not available online at the time of + generating the documentationNo
packagelistLocThe location to the directory containing the package-list file for + the external documentationOnly if the offline attribute is true
+ +

groups

+

Separates packages on the overview page into whatever groups you +specify, one group per table. This performs the same role as the group +attribute. You can use either syntax (or both at once), but with the +nested elements you can easily specify multiple occurrences of the +arguments.

+ + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
titleTitle of the groupYes
packagesList of packages to include in that groupYes
+ +

doclet

+

The doclet nested element is used to specify the doclet that javadoc will +use to process the input source files. A number of the standard javadoc arguments +are actually arguments of the standard doclet. If these are specified in the javadoc +task's attributes, they will be passed to the doclet specified in the +<doclet> nested element. Such attributes should only be specified, +therefore, if they can be interpreted by the doclet in use.

+ +

If the doclet requires additional parameters, these can be specified with +<param> elements within the <doclet> +element. These paramaters are restricted to simple strings. An example usage +of the doclet element is shown below:

+ +
  <javadoc ...>
+     <doclet name="theDoclet"
+             path="path/to/theDoclet">
+        <param name="-foo" value="foovalue"/>
+        <param name="-bar" value="barvalue"/>
+     </doclet>
+  </javadoc>
+
+ +

sourcepath, classpath and bootclasspath

+

Javadoc's sourcepath, classpath and +bootclasspath attributes are PATH like +structure and can also be set via nested sourcepath, +classpath and bootclasspath elements +respectively.

+ +

Example

+
  <javadoc packagenames="com.dummy.test.*"
+           sourcepath="src"
+           destdir="docs/api"
+           author="true"
+           version="true"
+           use="true"
+           windowtitle="Test API"
+           doctitle="<h1>Test</h1>"
+           bottom="<i>Copyright &#169; 2000 Dummy Corp. All Rights Reserved.</i>">
+    <group title="Group 1 Packages" packages="com.dummy.test.a*"/>
+    <group title="Group 2 Packages" packages="com.dummy.test.b*"/>
+    <link offline="true" href="http://java.sun.com/products/jdk/1.2/docs/api/" packagelistLoc="C:\tmp"/>
+    <link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
+  </javadoc>
+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/mail.html b/docs/manual/CoreTasks/mail.html new file mode 100644 index 000000000..61da405b5 --- /dev/null +++ b/docs/manual/CoreTasks/mail.html @@ -0,0 +1,64 @@ + + + + +Ant User Manual + + + + +

Mail

+

Description

+

A task to send SMTP email.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
fromEmail address of sender.Yes
tolistComma-separated list of recipients.Yes
messageMessage to send in the body of the email.Yes
filesFilename(s) of text to send in the body of the email. + Multiple files are comma-separated.
mailhostHost name of the mail server.No, default to "localhost"
subjectEmail subject line.No
+

Examples

+
+  <mail from="me" tolist="you" subject="Results of nightly build"
+        files="build.log"/>
+

Sends an eMail from me to you with a subject of +Results of nightly build and includes the contents of build.log +in the body of the message.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/mkdir.html b/docs/manual/CoreTasks/mkdir.html new file mode 100644 index 000000000..76ae61f7b --- /dev/null +++ b/docs/manual/CoreTasks/mkdir.html @@ -0,0 +1,38 @@ + + + + +Ant User Manual + + + + +

Mkdir

+

Description

+

Creates a directory. Also non-existent parent directories are created, when +necessary.

+

Parameters

+ + + + + + + + + + + +
AttributeDescriptionRequired
dirthe directory to create.Yes
+

Examples

+
<mkdir dir="${dist}"/>
+

creates a directory ${dist}.

+
<mkdir dir="${dist}/lib"/>
+

creates a directory ${dist}/lib.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/move.html b/docs/manual/CoreTasks/move.html new file mode 100644 index 000000000..cafd04e63 --- /dev/null +++ b/docs/manual/CoreTasks/move.html @@ -0,0 +1,117 @@ + + + + +Ant User Manual + + + + +

Move

+

Description

+

Moves a file to a new file or directory, or sets of files to +a new directory. By default, the +destination file is overwritten if it already exists. When overwrite is +turned off, then files are only moved if the source file is newer than +the destination file, or when the destination file does not exist.

+

FileSets are used to select sets of files +to move to the todir directory.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
filethe file to moveOne of file or + at least one nested fileset element
tofilethe file to move toWith the file attribute, + either tofile or todir can be used. With a nested fileset, + only todir is allowed.
todirthe directory to move to
overwriteoverwrite existing files even if the destination + files are newer (default is "true")No
filteringindicates whether token filtering should take place during + the move. See the filter task for a description of + how filters work.No
flattenignore directory structure of source directory, + copy all files into a single directory, specified by the todir + attribute (default is "false").Note that you can achieve the + same effect by using a flatten mapperNo
includeEmptyDirsCopy empty directories included with the nested FileSet(s). + Defaults to "yes".No
+

Parameters specified as nested elements

+

mapper

+

You can define file name transformations by using a nested mapper element. The default mapper used by +<copy> is the identity.

+

Examples

+

Move a single file (rename a file)

+
+  <move file="file.orig" tofile="file.moved"/>
+
+

Move a single file to a directory

+
+  <move file="file.orig" todir="dir/to/move/to"/>
+
+

Move a directory to a new directory

+
+  <move todir="new/dir/to/move/to">
+    <fileset dir="src/dir"/>
+  </move>
+
+

Move a set of files to a new directory

+
+  <move todir="some/new/dir" >
+    <fileset dir="my/src/dir" >
+      <include name="**/*.jar"/>
+      <exclude name="**/ant.jar"/>
+    </fileset>
+  </move>
+
+

Append ".bak" to the names of all files +in a directory.

+
+  <move todir="my/src/dir" >
+    <fileset dir="my/src/dir" >
+      <exclude name="**/*.bak"/>
+    </fileset>
+    <mapper type="glob" from="*" to="*.bak"/>
+  </move>
+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/patch.html b/docs/manual/CoreTasks/patch.html new file mode 100644 index 000000000..aa84ce93c --- /dev/null +++ b/docs/manual/CoreTasks/patch.html @@ -0,0 +1,77 @@ + + + + +Ant User Manual + + + + +

Patch

+

Description

+

Applies a diff file to originals.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
patchfilethe file that includes the diff outputYes
originalfilethe file to patchNo, tries to guess it from the diff + file
backupsKeep backups of the unpatched filesNo
quietWork silently unless an error occursNo
reverseAssume patch was created with old and new files + swapped.No
ignorewhitespaceIgnore whitespace differences.No
stripStrip the smallest prefix containing num leading + slashes from filenames.No
+

Examples

+
  <patch patchfile="module.1.0-1.1.patch"/>
+

applies the diff included in module.1.0-1.1.patch to the +files in base directory guessing the filename(s) from the diff output.

+
  <patch patchfile="module.1.0-1.1.patch" strip="1"/>
+

like above but one leading directory part will be removed. i.e. if +the diff output looked like

+
+--- a/mod1.0/A	Mon Jun  5 17:28:41 2000
++++ a/mod1.1/A	Mon Jun  5 17:28:49 2000
+
+the leading a/ will be stripped. +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/property.html b/docs/manual/CoreTasks/property.html new file mode 100644 index 000000000..a8635fc5b --- /dev/null +++ b/docs/manual/CoreTasks/property.html @@ -0,0 +1,129 @@ + + + + +Ant User Manual + + + + +

Property

+

Description

+

Sets a property (by name and value), or set of properties (from file or +resource) in the project.

+

When a property was set by the user, or was a property in a parent project +(that started this project with the ant task), then this +property cannot be set, and will be ignored. This means that properties set +outside the current project always override the properties of the current +project.

+

There are five ways to set properties:

+
    +
  • By supplying both the name and value attribute.
  • +
  • By supplying both the name and refid attribute.
  • +
  • By setting the file attribute with the filename of the property + file to load. This property file has the format as defined by the file used + in the class java.util.Properties.
  • +
  • By setting the resource attribute with the resource name of the + property file to load. This property file has the format as defined by the + file used in the class java.util.Properties.
  • +
  • By setting the environment attribute with a prefix to use. + Properties will be defined for every environment variable by + prefixing the supplied name and a period to the name of the variable.
  • +
+

Although combinations of the three ways are possible, only one should be used +at a time. Problems might occur with the order in which properties are set, for +instance.

+

The value part of the properties being set, might contain references to other +properties. These references are resolved at the time these properties are set. +This also holds for properties loaded from a property file.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
namethe name of the property to set.Yes
valuethe value of the property.Yes
refidReference to an object + defined elsewhere. Only yields reasonable results for references + to PATH like structures or properties.
resourcethe resource name of the property file.
filethe filename of the property file .
locationSets the property to the absolute filename of the + given file. If the value of this attribute is an absolute path, it + is left unchanged (with / and \ characters converted to the + current platforms conventions). Otherwise it is taken as a path + relative to the project's basedir and expanded.
environmentthe prefix to use when retrieving environment variables. Thus + if you specify environment="myenv" you will be able to access OS-specific + environment variables via property names "myenv.PATH" or + "myenv.TERM". Note that if you supply a property name with a final + "." it will not be doubled. ie environment="myenv." will still + allow access of environment variables through "myenv.PATH" and + "myenv.TERM". This functionality is currently only implemented + on select platforms. Feel free to send patches to increase the number of platforms + this functionality is supported on ;)
classpaththe classpath to use when looking up a resource.No
classpathrefthe classpath to use when looking up a resource, + given as reference to a PATH defined + elsewhere..No
+

Parameters specified as nested elements

+

classpath

+

Property's classpath attribute is a PATH like structure and can also be set via a nested +classpath element.

+

Examples

+
  <property name="foo.dist" value="dist"/>
+

sets the property foo.dist to the value "dist".

+
  <property file="foo.properties"/>
+

reads a set of properties from a file called "foo.properties".

+
  <property resource="foo.properties"/>
+

reads a set of properties from a resource called "foo.properties".

+

Note that you can reference a global properties file for all of your Ant +builds using the following:

+
  <property file="${user.home}/.ant-global.properties"/>
+

since the "user.home" property is defined by the Java virtual machine +to be your home directory. This technique is more appropriate for Unix than +Windows since the notion of a home directory doesn't exist on Windows. On the +JVM that I tested, the home directory on Windows is "C:\". Different JVM +implementations may use other values for the home directory on Windows.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/rename.html b/docs/manual/CoreTasks/rename.html new file mode 100644 index 000000000..6c2d1339a --- /dev/null +++ b/docs/manual/CoreTasks/rename.html @@ -0,0 +1,49 @@ + + + + +Ant User Manual + + + + +

Rename

+

Deprecated

+

This task has been deprecated. Use the Move task instead.

+

Description

+

Renames a given file.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
srcfile to rename.Yes
destnew name of the file.Yes
replaceEnable replacing of existing file (default: on).No
+

Examples

+
  <rename src="foo.jar" dest="${name}-${version}.jar"/>
+

Renames the file foo.jar to ${name}-${version}.jar (assuming name + and version being predefined properties). If a file named ${name}-${version}.jar + already exists, it will be removed prior to renaming foo.jar.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/replace.html b/docs/manual/CoreTasks/replace.html new file mode 100644 index 000000000..e84336b20 --- /dev/null +++ b/docs/manual/CoreTasks/replace.html @@ -0,0 +1,164 @@ + + + + +Ant User Manual + + + + +

Replace

+

Description

+

Replace is a directory based task for replacing the occurrence of a given string with another string +in selected file.

+

If you want to replace a text that crosses line boundaries, you +must use a nested <replacetoken> element.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
filefile for which the token should be replaced.Exactly one of the two.
dirThe base directory to use when replacing a token in + multiple files.
tokenthe token which must be replaced.Yes, unless a nested replacetoken + element is used.
valuethe new value for the token. When omitted, an empty string + ("") is used.No
propertyFilevalid property file from which properties specified using nested <replacefilter> elements are drawn.Yes only if property attribute of <replacefilter> is used.
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
+

Examples

+
  <replace file="${src}/index.html" token="@@@" value="wombat"/>
+

replaces occurrences of the string "@@@" with the string +"wombat", in the file ${src}/index.html.

+

Parameters specified as nested elements

+

This task forms an implicit FileSet and +supports all attributes of <fileset> as well as the +nested <include>, <exclude> and +<patternset> elements.

+

If either the text you want to replace or the replacement text +cross line boundaries, you can use nested elements to specify +them.

+

Examples

+
+<replace dir="${src}" value="wombat">
+  <include name="**/*.html"/>
+  <replacetoken><![CDATA[multi line
+token]]></replacetoken>
+</replace>
+
+

replaces occurrences of the string "multi +line\ntoken" with the string "wombat", in all +HTML files in the directory ${src}.Where \n is +the platform specific line separator.

+
+<replace file="${src}/index.html">
+  <replacetoken><![CDATA[two line
+token]]></replacetoken>
+  <replacevalue><![CDATA[two line
+token]]></replacevalue>
+</replace>
+
+

replacefilter

+

In addition to allowing for multiple replacements, optional nested <replacefilter> elements allow replacement values to be extracted from a property file. The name of this file is specified using the <replace> attribute propertyFile. +

+ + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
tokenThe string to search for.Yes
valueThe replacement string.Either may be specified, but not both. Both can be omitted, if desired.
propertyName of the property whose value is to serve as the replacement value.
+

If neither value nor property is used, the value provided using the <replace> attribute value and/or the <replacevalue> element is used. If no value was specified using either of these options, the token is replaced with an empty string. +

+

Examples

+
+<replace 
+    file="configure.sh"
+    value="defaultvalue"
+    propertyFile="source/name.properties" >
+  <replacefilter 
+    token="@token1@" />
+  <replacefilter 
+    token="@token2@" 
+    value="value2"/>
+  <replacefilter 
+    token="@token3@" 
+    property="property.key"/>
+</replace>
+
+

In file configure.sh, replace all instances of "@token1@" with "defaultvalue", all instances of "@token2@" with "value2", and all instances of "@token3@" with the value of the property "property.key", as it appears in property file src/name.properties.

+

Note: It is possible to use either the token/<replacetoken> and value/<replacevalue> attributes/elements, the nested replacefilter elements, or both in the same operation. +

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/rmic.html b/docs/manual/CoreTasks/rmic.html new file mode 100644 index 000000000..80f539587 --- /dev/null +++ b/docs/manual/CoreTasks/rmic.html @@ -0,0 +1,158 @@ + + + + +Ant User Manual + + + + +

Rmic

+

Description

+

Runs the rmic compiler for a certain class.

+

Rmic can be run on a single class (as specified with the classname +attribute) or a number of classes at once (all classes below base that +are neither _Stub nor _Skel classes).

+

It is possible to refine the set of files that are being rmiced. This can be +done with the includes, includesfile, excludes, excludesfile and defaultexcludes +attributes. With the includes or includesfile attribute you specify the files you want to +have included by using patterns. The exclude or excludesfile attribute is used to specify +the files you want to have excluded. This is also done with patterns. And +finally with the defaultexcludes attribute, you can specify whether you +want to use default exclusions or not. See the section on directory based tasks, on how the +inclusion/exclusion of files works, and how to write patterns.

+

This task forms an implicit FileSet and +supports all attributes of <fileset> +(dir becomes base) as well as the nested +<include>, <exclude> and +<patternset> elements.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
basethe location to store the compiled files.Yes
classnamethe class for which to run rmic.No
filteringindicates whether token filtering should take placeNo
sourcebasePass the "-keepgenerated" flag to rmic and + move the generated source file to the base directory.No
stubversionSpecify the JDK version for the generated stub code. + Specify "1.1" to pass the "-v1.1" option to rmic.No
classpathThe classpath to use during compilationNo
classpathrefThe classpath to use during compilation, given as reference to a PATH defined elsewhereNo
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
verifycheck that classes implement Remote before handing them + to rmic (default is false)No
iiopindicates that portable (RMI/IIOP) stubs should be generatedNo
iiopoptsadditional arguments for IIOP class generationNo
idlindicates that IDL output files should be generatedNo
idloptsadditional arguments for IDL file generationNo
debuggenerate debug info (passes -g to rmic). Defaults to false.No
+

Parameters specified as nested elements

+

classpath

+

Rmic's classpath attribute is a PATH like structure and can also be set via a nested +classpath elements.

+

Examples

+
  <rmic classname="com.xyz.FooBar" base="${build}/classes"/>
+

runs the rmic compiler for the class com.xyz.FooBar. The +compiled files will be stored in the directory ${build}/classes.

+
  <rmic base="${build}/classes" includes="**/Remote*.class"/>
+

runs the rmic compiler for all classes with .class +files below ${build}/classes whose classname starts with +Remote. The compiled files will be stored in the directory +${build}/classes.

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/signjar.html b/docs/manual/CoreTasks/signjar.html new file mode 100644 index 000000000..c093e1442 --- /dev/null +++ b/docs/manual/CoreTasks/signjar.html @@ -0,0 +1,91 @@ + + + + +Ant User Manual + + + + +

SignJar

+

Description

+

Signs a jar or zip file with the javasign command line tool.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
jarthe jar file to signYes.
aliasthe alias to sign underYes.
storepasspassword for keystore integrity.Yes.
keystorekeystore locationNo
storetypekeystore typeNo
keypasspassword for private key (if different)No
sigfilename of .SF/.DSA fileNo
signedjarname of signed JAR fileNo
verbose(true | false) verbose output when signingNo
internalsf(true | false) include the .SF file inside the signature +blockNo
sectionsonly(true | false) don't compute hash of entire manifestNo
+

Examples

+
+

<signjar jar="${dist}/lib/ant.jar" +alias="apache-group" storepass="secret"/>

+
+

signs the ant.jar with alias "apache-group" accessing the +keystore and private key via "secret" password.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/sql.html b/docs/manual/CoreTasks/sql.html similarity index 72% rename from docs/sql.html rename to docs/manual/CoreTasks/sql.html index ec12391c8..579bc3888 100644 --- a/docs/sql.html +++ b/docs/manual/CoreTasks/sql.html @@ -1,5 +1,7 @@ + +Ant User Manual @@ -9,12 +11,12 @@

Multiple statements can be set and each statement is delimited from the next use a semi-colon. Individual lines within the statements can be commented using either -- or // at the start of the line.

-

The auto-commit attribute specifies whether auto commit should be turned on or off whilst executing the statements. If auto-commit is turned on each statement will be executed and commited. If it is turned off the statements will all be executed as one transaction.

+

The auto-commit attribute specifies whether auto commit should be turned on or off whilst executing the statements. If auto-commit is turned on each statement will be executed and committed. If it is turned off the statements will all be executed as one transaction.

-

The onerror attribute specifies how to preceed when an error occurs during the execution of one of the statements. +

The onerror attribute specifies how to proceed when an error occurs during the execution of one of the statements. The possible values are: continue execution, only show the error; stop execution and commit transaction; -and abort execution and transaction and fail task. +and abort execution and transaction and fail task.

Parameters

@@ -51,17 +53,17 @@ and abort execution and transaction and fail task. - + - + - + @@ -76,7 +78,7 @@ and abort execution and transaction and fail task. - + @@ -95,7 +97,7 @@ and abort execution and transaction and fail task.

Use nested <transaction> elements to specify multiple blocks of commands to the executed executed in the same connection but different transactions. This -is particularly usefull when there are multiple files to execute +is particularly useful when there are multiple files to execute on the same schema.

autocommit Auto commit flag for database connection (default false)No, default "false"No, default "false"
print Print result sets from the statements (default false)No, default "false"No, default "false"
showheaders Print headers for result sets from the statements (default true)No, default "true"No, default "true"
output
onerror Action to perform when statement fails: continue, stop, abortNo, default "abort"No, default "abort"
rdbms
@@ -111,29 +113,29 @@ on the same schema.

classpath

Sql's classpath attribute is a PATH like structure and can also be set via a nested +href="../using.html#path">PATH like structure and can also be set via a nested classpath element. It is used to load the JDBC classes.

The

Examples

-
<sql - driver="org.database.jdbcDriver" - url="jdbc:database-url" - userid="sa" - password="pass" - src="data.sql" +
<sql
+    driver="org.database.jdbcDriver"
+    url="jdbc:database-url"
+    userid="sa"
+    password="pass"
+    src="data.sql"
 />
 

Connects to the database given in url as the sa user using the org.database.jdbcDriver and executes the sql statements contained within the file data.sql

<sql
-    driver="org.database.jdbcDriver"
-    url="jdbc:database-url"
-    userid="sa"
-    password="pass"
+    driver="org.database.jdbcDriver"
+    url="jdbc:database-url"
+    userid="sa"
+    password="pass"
     >
 insert
 into table some_table
@@ -151,10 +153,10 @@ need to escape <, > &
 or other special characters. For example:

<sql
-    driver="org.database.jdbcDriver"
-    url="jdbc:database-url"
-    userid="sa"
-    password="pass"
+    driver="org.database.jdbcDriver"
+    url="jdbc:database-url"
+    userid="sa"
+    password="pass"
     ><![CDATA[
 
 update some_table set column1 = column1 + 1 where column2 < 42;
@@ -164,14 +166,14 @@ update some_table set column1 = column1 + 1 where column2 < 42;
 
 

The following connects to the database given in url as the sa user using the org.database.jdbcDriver and executes the sql statements contained within the files data1.sql, data2.sql and data3.sql and then executes the truncate operation on some_other_table.

-
<sql - driver="org.database.jdbcDriver" - url="jdbc:database-url" - userid="sa" - password="pass" > - <transaction src="data1.sql" /> - <transaction src="data2.sql" /> - <transaction src="data3.sql" /> +
<sql
+    driver="org.database.jdbcDriver"
+    url="jdbc:database-url"
+    userid="sa"
+    password="pass" >
+  <transaction  src="data1.sql" />
+  <transaction  src="data2.sql" />
+  <transaction  src="data3.sql" />
   <transaction>
     truncate table some_other_table;
   </transaction>
@@ -180,31 +182,32 @@ update some_table set column1 = column1 + 1 where column2 < 42;
 
 

The following connects to the database given in url as the sa user using the org.database.jdbcDriver and executes the sql statements contained within the file data.sql, with output piped to outputfile.txt, searching /some/jdbc.jar as well as the system classpath for the driver class.

-
<sql - driver="org.database.jdbcDriver" - url="jdbc:database-url" - userid="sa" - password="pass" - src="data.sql" - print="yes" - output="outputfile.txt" +
<sql
+    driver="org.database.jdbcDriver"
+    url="jdbc:database-url"
+    userid="sa"
+    password="pass"
+    src="data.sql"
+    print="yes"
+    output="outputfile.txt"
     >
 <classpath>
-	<pathelement location="/some/jdbc.jar">
+	<pathelement location="/some/jdbc.jar">
 </classpath>
 </sql>
 
-

The following will only execute if the RDBMS is "oracle" and the version starts with "8.1."

+

The following will only execute if the RDBMS is "oracle" and the version +starts with "8.1."

-
<sql - driver="org.database.jdbcDriver" - url="jdbc:database-url" - userid="sa" - password="pass" - src="data.sql" - rdbms="oracle" - version="8.1." +
<sql
+    driver="org.database.jdbcDriver"
+    url="jdbc:database-url"
+    userid="sa"
+    password="pass"
+    src="data.sql"
+    rdbms="oracle"
+    version="8.1."
     >
 insert
 into table some_table
diff --git a/docs/manual/CoreTasks/style.html b/docs/manual/CoreTasks/style.html
new file mode 100644
index 000000000..8dab1e6c6
--- /dev/null
+++ b/docs/manual/CoreTasks/style.html
@@ -0,0 +1,152 @@
+
+
+
+
+Ant User Manual
+
+
+
+
+

Style

+

Description

+

Process a set of documents via XSLT.

+

This is useful for building views of XML based documentation, +or in generating code.

+

It is possible to refine the set of files that are being copied. This can be +done with the includes, includesfile, excludes, excludesfile and defaultexcludes +attributes. With the includes or includesfile attribute you specify the files you want to +have included by using patterns. The exclude or excludesfile attribute is used to specify +the files you want to have excluded. This is also done with patterns. And +finally with the defaultexcludes attribute, you can specify whether you +want to use default exclusions or not. See the section on directory based tasks, on how the +inclusion/exclusion of files works, and how to write patterns.

+

This task forms an implicit FileSet and supports all + attributes of <fileset> (dir becomes basedir) + as well as the nested <include>, <exclude> + and <patternset> elements.

+

Style supports the use of a <param> element which is use to pass values + to an <xsl:param> declaration.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
basedirwhere to find the source XML file.Yes
destdirdirectory where to store the results.Yes
extensiondesired file extension to be used for the targets. If not + specified, the default is "html".No
stylename of the stylesheet to use.Yes
processorname of the XSLT processor to use. Permissible values are + "trax" for a TraX compliant processor, "xslp" for the + XSL:P processor, "xalan" for the Apache XML Xalan (version 1) + processor, or the name of an arbitrary XSLTLiaison class. Defaults to trax, + followed by xslp then xalan (in that order). The first one found in your + class path is the one that is used.No
includescomma separated list of patterns of files that must be included. + All files are included when omitted.No
includesfilethe name of a file. Each line of this file is taken to be + an include patternNo
excludescomma separated list of patterns of files that must be excluded. + No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is taken to be + an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
inspecifies a single XML document to be styled. Should be used + with the out attribute.No
outspecifies the output name for the styled result from the + in attribute.No
+

Parameters specified as nested elements

+

param

+

Param is used to pass a parameter to the XSL stylesheet.

+

Parameters

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
nameName of the XSL parameterYes
expressionXSL expression to be placed into the param. To pass a text + value into the style sheet it needs to be escaped using single quotes.Yes
+

Examples

+
+
+<style basedir="doc" destdir="build/doc"
+       extension="html" style="style/apache.xsl"/>
+

Using XSL parameters

+
<style basedir="doc" destdir="build/doc"
+		extension="html" style="style/apache.xsl">
+	<param name="date" expression="'07-01-2000'"/>
+</style>
+

This will replace an xsl:param definition<xsl:param name="date"></xsl:param> + with the text value 07-01-2000

+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/tar.html b/docs/manual/CoreTasks/tar.html new file mode 100644 index 000000000..46d29e929 --- /dev/null +++ b/docs/manual/CoreTasks/tar.html @@ -0,0 +1,168 @@ + + + + +Ant User Manual + + + + +

Tar

+

Description

+

Creates a tar archive.

+

The basedir attribute is the reference directory from where to tar.

+

This task is a directory based task +and, as such, forms an implicit Fileset. This +defines which files, relative to the basedir, will be included in the +archive. The tar task supports all the attributes of Fileset to refine the +set of files to be included in the implicit fileset.

+ +

In addition to the implicit fileset, the tar task supports nested filesets. These +filesets are extended to allow control over the access mode, username and groupname +to be applied to the tar entries. This is useful, for example, when preparing archives for +Unix systems where some files need to have execute permission.

+ +

The POSIX tar standard does not support path lengths greater than 100 characters. The +behaviour of the tar task when it encounters such paths is controlled by the longfile +attribute. If this attribute is not present, the tar task will throw an exception upon encountering +a long path. If the longfile attribute is set to truncate, any long paths will be +truncated to the 100 character maximum length prior to adding to the archive. This ensures that +the file will be in the archive and that the archive can be untarred by any compliant version of +tar. If the loss of path information is not acceptable, and it rarely is, longfile may be set to +the value gnu. The tar task will then produce a GNU tar file which can have +arbitrary length paths. Note however, that the resulting archive will only be able to be untarred +with GNU tar.

+ +

Note that this task does not perform compression. You might want to use the +GZip task to prepare a .tar.gz package.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
tarfilethe tar-file to create.Yes
basedirthe directory from which to zip the files.No
longfileControls how long paths are handled. Allowable + values are "gnu" and "truncate"No
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
+ +

Nested Elements

+The tar task supports nested tarfileset elements. These are +extended Filesets which, in addition to the standard fileset elements, support three additional +attributes + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
modeAn 3 digit octal string, specify the user, group and other modes in + the standard Unix fashionNo
usernameThe username for the tar entry. This is not the same as the UID, which is + not currently set by the tar task.No
groupnameThe username for the tar entry. This is not the same as the GID, which is + not currently set by the tar task.No
+ +

Examples

+
  <tar tarfile="${dist}/manual.tar" basedir="htdocs/manual"/>
+  <gzip zipfile="${dist}/manual.tar.gz" src="${dist}/manual.tar"/>
+

tars all files in the htdocs/manual directory into a file called manual.tar +in the ${dist} directory, then applies the gzip task to compress +it.

+
  <tar tarfile="${dist}/manual.tar"
+       basedir="htdocs/manual"
+       excludes="mydocs/**, **/todo.html"
+  />
+

tars all files in the htdocs/manual directory into a file called manual.tar +in the ${dist} directory. Files in the directory mydocs, +or files with the name todo.html are excluded.

+ +
<tar longfile="gnu"
+     tarfile="${dist.base}/${dist.name}-src.tar" >
+  <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
+    <include name="${dist.name}/bootstrap.sh"/>
+    <include name="${dist.name}/build.sh"/>
+  </fileset> 
+  <tarfileset dir="${dist.name}/.." username="ant" group="ant"> 
+    <include name="${dist.name}/**"/>
+    <exclude name="${dist.name}/bootstrap.sh"/>
+    <exclude name="${dist.name}/build.sh"/>
+  </fileset>
+</tar> 
+ +

This example shows building a tar which uses the GNU extensions for long paths and +where some files need to be marked as executable (mode 755) +and the rest are use the default mode (read-write by owner). The first +fileset selects just the executable files. The second fileset must exclude +the executable files and include all others.

+ +

Note: The tar task does not ensure that a file is only selected +by one fileset. If the same file is selected by more than one fileset, it will be included in the +tar file twice, with the same path.

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/taskdef.html b/docs/manual/CoreTasks/taskdef.html new file mode 100644 index 000000000..ec6250abe --- /dev/null +++ b/docs/manual/CoreTasks/taskdef.html @@ -0,0 +1,56 @@ + + + + +Ant User Manual + + + + +

Taskdef

+

Description

+

Adds a task definition to the current project, such that this new task can be +used in the current project. Two attributes are needed, the name that identifies +this task uniquely, and the full name of the class (including the packages) that +implements this task.

+

Taskdef should be used to add your own tasks to the system. See also "Writing your own task".

+

Parameters

+ + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
namethe name of the taskYes
classnamethe full class name implementing the taskYes
classpath the classpath to + use when looking up classname. No
+

Parameters specified as nested elements

+

classpath

+

Taskdef's classpath attribute is a PATH like structure and can also be set via a nested +classpath element.

+

Examples

+
  <taskdef name="myjavadoc" classname="com.mydomain.JavadocTask"/>
+

makes a task called myjavadoc available to Ant. The class com.mydomain.JavadocTask +implements the task.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/touch.html b/docs/manual/CoreTasks/touch.html new file mode 100644 index 000000000..7bb503d9f --- /dev/null +++ b/docs/manual/CoreTasks/touch.html @@ -0,0 +1,57 @@ + + + + +Ant User Manual + + + + +

Touch

+

Description

+

Changes the modification time of a file and possibly creates it at +the same time.

+

For JDK 1.1 only the creation of new files with a modification time +of now works, all other cases will emit a warning.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
filethe name of the fileYes
millisspecifies the new modification time of the file + in milliseconds since midnight Jan 1 1970No
datetimespecifies the new modification time of the file + in the format MM/DD/YYYY HH:MM AM_or_PM.No
+

If both millis and datetime are omitted +the current time is assumed.

+

Examples

+
  <touch file="myfile"/>
+

creates myfile if it doesn't exist and changes the +modification time to the current time.

+
  <touch file="myfile" datetime="06/28/2000 2:02 pm"/>
+

creates myfile if it doesn't exist and changes the +modification time to Jun, 28 2000 2:02 pm (14:02 for those used to 24 +hour times).

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/tstamp.html b/docs/manual/CoreTasks/tstamp.html new file mode 100644 index 000000000..14fe4f2c5 --- /dev/null +++ b/docs/manual/CoreTasks/tstamp.html @@ -0,0 +1,75 @@ + + + + +Ant User Manual + + + + +

Tstamp

+

Description

+

Sets the DSTAMP, TSTAMP and TODAY properties in the current project. The +DSTAMP is in the "yyyymmdd" format, the TSTAMP is in the "hhmm" +format and TODAY is "month day year".

+

These properties can be used in the buildfile, for instance, to create +timestamped filenames or used to replace placeholder tags inside documents to +indicate, for example, the release date. The best place for this task is in your +initialization target.

+

Parameters

+ + + + + + + + +
AttributeDescriptionRequired
No parameters
+ +

Nested Elements

+The tstamp task supports a format nested element which allows a property to be +given the current date and time in a given format. The date/time patterns are as defined in the Java +SimpleDateFormat class. + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
property + The property which is to receive the date/time string in the given pattern + Yes
patternThe date/time pattern to be used. The values are defined by the Java + SimpleDateFormat classYes
+ +

Examples

+

Set the standard DSTAMP, TSTAMP and TODAY properties according to the formats above

+
  <tstamp/>
+ +

As for the above example, set the standard properties and also set the property +"TODAY_UK" with the date/time pattern "d MMM yyyy"

+ +
  <tstamp>
+    <format property="TODAY_UK" pattern="d MMMM yyyy">
+  </tstamp>
+
+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/untar.html b/docs/manual/CoreTasks/untar.html new file mode 100644 index 000000000..6f978c63a --- /dev/null +++ b/docs/manual/CoreTasks/untar.html @@ -0,0 +1,52 @@ + + + + +Ant User Manual + + + + +

Untar

+

Description

+

Untars a tarfile.

+ +

Note: File permissions will not be restored on extracted files.

+ +

For JDK 1.1 "last modified time" field is set to current time instead of being +carried from tarfile.

+ +

The untar task recognizes the long pathname entries used by GNU tar.

+ +

Parameters

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
srctarfile to expand.Yes
destdirectory where to store the expanded files.Yes
+

Examples

+
+

+<gunzip src="tools.tar.gz"/>
+<untar src="tools.tar" dest="${tools.home}"/> +

+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/unzip.html b/docs/manual/CoreTasks/unzip.html new file mode 100644 index 000000000..918acb7a1 --- /dev/null +++ b/docs/manual/CoreTasks/unzip.html @@ -0,0 +1,45 @@ + + + + +Ant User Manual + + + + +

Unjar/Unwar/Unzip

+

Description

+

Unzips a zip-, war- or jarfile.

+

For JDK 1.1 "last modified time" field is set to current time instead of being +carried from zipfile.

+

File permissions will not be restored on extracted files.

+

Parameters

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
srczipfile to expand.Yes
destdirectory where to store the expanded files.Yes
+

Examples

+
+

<unzip src="${tomcat_src}/tools-src.zip" dest="${tools.home}" + />

+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/uptodate.html b/docs/manual/CoreTasks/uptodate.html new file mode 100644 index 000000000..658cdaffe --- /dev/null +++ b/docs/manual/CoreTasks/uptodate.html @@ -0,0 +1,62 @@ + + + + +Ant User Manual + + + + +

Uptodate

+

Description

+

Sets a property if a target files are more up to date than a set of +Source files. Source files are specified by nested <srcfiles> +elements, these are FileSets, while target +files are specified using a nested mapper +element.

+

The value part of the property being set is true if the +timestamp of the target files is more recent than the timestamp of +every corresponding source file.

+

The default behavior is to use a merge +mapper with the to attribute set to the value of the +targetfile attribute.

+

Normally, this task is used to set properties that are useful to avoid target +execution depending on the relative age of the specified files.

+

Parameters

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
propertythe name of the property to set.Yes
targetfilethe file for which we want to determine the status.Yes, unless a nested mapper element is + present.
+

Examples

+
  <uptodate property="xmlBuild.notRequired" targetfile="${deploy}\xmlClasses.jar" >
+    <srcfiles dir= "${src}/xml" includes="**/*.dtd"/>
+  </uptodate>
+

sets the property xmlBuild.notRequired to the value "true" +if the ${deploy}/xmlClasses.jar is more up to date than any of the DTD files in the ${src}/xml directory.

+

This can be written as

+
  <uptodate property="xmlBuild.notRequired"  >
+    <srcfiles dir= "${src}/xml" includes="**/*.dtd"/>
+    <mapper type="merge" to="${deploy}\xmlClasses.jar"/>
+  </uptodate>
+

as well.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/war.html b/docs/manual/CoreTasks/war.html new file mode 100644 index 000000000..dff6c6f7f --- /dev/null +++ b/docs/manual/CoreTasks/war.html @@ -0,0 +1,149 @@ + + + + +Ant User Manual + + + + +

War

+

Description

+

An extension of the Jar task with special +treatment for files that should end up in the +WEB-INF/lib, WEB-INF/classes or +WEB-INF directories of the Web Application Archive.

+

(The War task is a shortcut for specifying the particular layout of a WAR file. +The same thing can be accomplished by using the prefix and fullpath +attributes of zipfilesets in a Zip or Jar task.)

+

The extended zipfileset element from the zip task (with attributes prefix, fullpath, and src) is available in the War task.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
warfilethe war-file to create.Yes
webxmlThe deployment descriptor to use (WEB-INF/web.xml).Yes
basedirthe directory from which to jar the files.No
compressNot only store data but also compress them, defaults to trueNo
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
manifestthe manifest file to use.No
whenemptyBehavior to use if no files match.No
+

Nested elements

+

lib

+

The nested lib element specifies a FileSet. All files included in this fileset will +end up in the WEB-INF/lib directory of the war file.

+

classes

+

The nested classes element specifies a FileSet. All files included in this fileset will +end up in the WEB-INF/classes directory of the war file.

+

webinf

+

The nested webinf element specifies a FileSet. All files included in this fileset will +end up in the WEB-INF directory of the war file. If this +fileset includes a file named web.xml, the file is +ignored and you will get a warning.

+

Examples

+

Assume the following structure in the project's base directory:

+
+thirdparty/libs/jdbc1.jar
+thirdparty/libs/jdbc2.jar
+build/main/com/myco/myapp/Servlet.class
+src/metadata/myapp.xml
+src/html/myapp/index.html
+src/jsp/myapp/front.jsp
+src/graphics/images/gifs/small/logo.gif
+src/graphics/images/gifs/large/logo.gif
+
+then the war file myapp.war created with +
+<war warfile="myapp.war" webxml="src/metadata/myapp.xml">
+  <fileset dir="src/html/myapp"/>
+  <fileset dir="src/jsp/myapp"/>
+  <lib dir="thirdparty/libs">
+    <exclude name="jdbc1.jar"/>
+  </lib>
+  <classes dir="build/main"/>
+  <zipfileset dir="src/graphics/images/gifs" 
+              prefix="images"/>
+</war>
+
+will consist of +
+WEB-INF/web.xml
+WEB-INF/lib/jdbc2.jar
+WEB-INF/classes/com/myco/myapp/Servlet.class
+META-INF/MANIFEST.MF
+index.html
+front.jsp
+images/small/logo.gif
+images/large/logo.gif
+
+using Ant's default manifest file. The content of +WEB-INF/web.xml is identical to +src/metadata/myapp.xml. +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTasks/zip.html b/docs/manual/CoreTasks/zip.html new file mode 100644 index 000000000..5b89b48a7 --- /dev/null +++ b/docs/manual/CoreTasks/zip.html @@ -0,0 +1,161 @@ + + + + +Ant User Manual + + + + +

Zip

+

Description

+

Creates a zipfile.

+

The basedir attribute is the reference directory from where to zip.

+

Note that file permissions will not be stored in the resulting zipfile.

+

It is possible to refine the set of files that are being zipped. This can be +done with the includes, includesfile, excludes, excludesfile and defaultexcludes +attributes. With the includes or includesfile attribute you specify the files you want to +have included by using patterns. The exclude or excludesfile attribute is used to specify +the files you want to have excluded. This is also done with patterns. And +finally with the defaultexcludes attribute, you can specify whether you +want to use default exclusions or not. See the section on directory based tasks, on how the +inclusion/exclusion of files works, and how to write patterns.

+

This task forms an implicit FileSet and +supports all attributes of <fileset> +(dir becomes basedir) as well as the nested +<include>, <exclude> and +<patternset> elements.

+

Or, you may place within it nested file sets, or references to file sets. +In this case basedir is optional; the implicit file set is only used +if basedir is set. You may use any mixture of the implicit file set +(with basedir set, and optional attributes like includes +and optional subelements like <include>); explicit nested +<fileset> elements so long as at least one fileset total is specified. The ZIP file will +only reflect the relative paths of files within each fileset. The Zip task and its derivatives know a special form of a fileset named zipfileset that has additional attributes (described below).

+

The whenempty parameter controls what happens when no files match. +If skip (the default), the ZIP is not created and a warning is issued. +If fail, the ZIP is not created and the build is halted with an error. +If create, an empty ZIP file (explicitly zero entries) is created, +which should be recognized as such by compliant ZIP manipulation tools.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
zipfilethe zip-file to create.Yes
basedirthe directory from which to zip the files.No
compressNot only store data but also compress them, defaults to trueNo
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
whenemptyBehavior when no files match.No
+

Parameters specified as nested elements

+

fileset

+

The zip task supports any number of nested <fileset> elements to specify +the files to be included in the archive.

+

zipfileset

+

A <zipfileset> has three additional attributes: prefix, fullpath, and src. The +prefix and fullpath attributes modify the location of the files when they are placed +inside the archive. If the prefix attribute is set, all files in the fileset are prefixed +with that path in the archive. If the fullpath attribute is set, the file described by the fileset is placed at that +exact location in the archive. (The fullpath attribute can only be set for filesets that represent a single file. The prefix and fullpath attributes cannot both be set on the same fileset.) The src attribute +may be used in place of the dir attribute to specify a zip file whose +contents will be extracted and included in the archive. As with directories, include and exclude patterns may be used to specify a subset of the zip file +for inclusion in the archive.

+ +

Examples

+
  <zip zipfile="${dist}/manual.zip"
+       basedir="htdocs/manual"
+  />
+

zips all files in the htdocs/manual directory into a file called manual.zip +in the ${dist} directory.

+
  <zip zipfile="${dist}/manual.zip"
+       basedir="htdocs/manual"
+       excludes="mydocs/**, **/todo.html"
+  />
+

zips all files in the htdocs/manual directory. Files in the directory mydocs, +or files with the name todo.html are excluded.

+
  <zip zipfile="${dist}/manual.zip"
+       basedir="htdocs/manual"
+       includes="api/**/*.html"
+       excludes="**/todo.html"
+  />
+

zips all files in the htdocs/manual directory. Only html files under the directory api +are zipped, and files with the name todo.html are excluded.

+
  <zip zipfile="${dist}/manual.zip">
+    <fileset dir="htdocs/manual"/>
+    <fileset dir="." includes="ChangeLog.txt"/>
+  </zip>
+

zips all files in the htdocs/manual directory, and also adds the file ChangeLog.txt in the +current directory. ChangeLog.txt will be added to the top of the ZIP file, just as if +it had been located at htdocs/manual/ChangeLog.txt.

+
  <zip zipfile="${dist}/manual.zip">
+    <zipfileset dir="htdocs/manual" prefix="docs/user-guide"/>
+    <zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/>
+    <zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/>
+  </zip>
+

zips all files in the htdocs/manual directory into the docs/user-guide directory +in the archive, adds the file ChangeLog27.txt in the +current directory as docs/ChangeLog.txt, and includes all the html files in examples.zip +under docs/examples. The archive might end up containing the files:

+
    docs/user-guide/html/index.html
+    docs/ChangeLog.txt
+    docs/examples/index.html
+
+ + +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTypes/fileset.html b/docs/manual/CoreTypes/fileset.html new file mode 100644 index 000000000..531615fdb --- /dev/null +++ b/docs/manual/CoreTypes/fileset.html @@ -0,0 +1,92 @@ + + + + +Ant User Manual + + + + +

FileSet

+

FileSets are groups of files. These files can be found in a +directory tree starting in a base directory and are matched by +patterns taken from a number of PatternSets. FileSets can appear inside tasks +that support this feature or at the same level as target +– i.e., as children of project.

+

PatternSets can be specified as nested +<patternset> +elements. In addition, FileSet holds an implicit PatternSet and +supports the nested <include> and +<exclude> elements of PatternSet directly, as well +as PatternSet's attributes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
dirthe root of the directory tree of this FileSet.Yes
defaultexcludesindicates whether default excludes should be used or not + (yes | no); default excludes are used when omitted.No
includescomma-separated list of patterns of files that must be + included; all files are included when omitted.No
includesfilethe name of a file; each line of this file is + taken to be an include pattern.No
excludescomma-separated list of patterns of files that must be + excluded; no files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file; each line of this file is + taken to be an exclude pattern.No
+ +

Examples

+
+<fileset dir="${server.src}" >
+  <patternset id="non.test.sources" >
+    <include name="**/*.java"/>
+    <exclude name="**/*Test*"/>
+  </patternset>
+</fileset>
+
+

Groups all files in directory ${server.src} that are Java +source files and don't have the text Test in their +name.

+
+<fileset dir="${client.src}" >
+  <patternset refid="non.test.sources"/>
+</fileset>
+
+

Groups all files in directory ${client.src}, using the +same patterns as the example above.

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTypes/mapper.html b/docs/manual/CoreTypes/mapper.html new file mode 100644 index 000000000..f00223401 --- /dev/null +++ b/docs/manual/CoreTypes/mapper.html @@ -0,0 +1,335 @@ + + + + +Ant User Manual + + + + +

Mapping File Names

+

Some tasks take source files and create target files. Depending on +the task, it may be quite obvious which name a target file will have +(using javac, you know there will be +.class files for your .java files) – in +other cases you may want to specify the target files, either to help +Ant or to get an extra bit of functionality.

+

While source files are usually specified as filesets, you don't specify target files directly – +instead, you tell Ant how to find the target file(s) for one source file. An +instance of org.apache.tools.ant.util.FileNameMapper is +responsible for this. It constructs target file names based on rules +that can be parameterized with from and to +attributes – the exact meaning of which is implementation-dependent.

+

These instances are defined in <mapper> elements +with the following attributes:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
typespecifies one of the built-in implementations.Exactly one of both
classnamespecifies the implementation by class name.
classpaththe classpath to use when looking up + classname.No
classpathrefthe classpath to use, given as reference to a path defined elsewhere.No
fromthe from attribute for the given + implementation.Depends on implementation.
tothe to attribute for the given + implementation.Depends on implementation.
+

The classpath can be specified via a nested +<classpath>, as well – that is, +a path-like structure.

+

The built-in mapper types are:

+

identity

+

The target file name is identical to the source file name. Both +to and from will be ignored.

+Examples: +
+<mapper type="identity"/>
+
+ + + + + + + + + + + + + + + + + + + + + +
Source file nameTarget file name
A.javaA.java
foo/bar/B.javafoo/bar/B.java
C.propertiesC.properties
Classes/dir/dir2/A.propertiesClasses/dir/dir2/A.properties
+

flatten

+

The target file name is identical to the source file name, with all +leading directory information stripped off. Both to and +from will be ignored.

+Examples: +
+<mapper type="flatten"/>
+
+ + + + + + + + + + + + + + + + + + + + + +
Source file nameTarget file name
A.javaA.java
foo/bar/B.javaB.java
C.propertiesC.properties
Classes/dir/dir2/A.propertiesA.properties
+

merge

+

The target file name will always be the same, as defined by +tofrom will be ignored.

+
Examples:
+
+<mapper type="merge" to="archive.tar"/>
+
+ + + + + + + + + + + + + + + + + + + + + +
Source file nameTarget file name
A.javaarchive.tar
foo/bar/B.javaarchive.tar
C.propertiesarchive.tar
Classes/dir/dir2/A.propertiesarchive.tar
+

glob

+

Both to and from define patterns that may +contain at most one *. For each source file that matches +the from pattern, a target file name will be constructed +from the to pattern by substituting the * in +the to pattern with the text that matches the +* in the from pattern. Source file names +that don't match the from pattern will be ignored.

+Examples: +
+<mapper type="glob" from="*.java" to="*.java.bak"/>
+
+ + + + + + + + + + + + + + + + + + + + + +
Source file nameTarget file name
A.javaA.java.bak
foo/bar/B.javafoo/bar/B.java.bak
C.propertiesignored
Classes/dir/dir2/A.propertiesignored
+
+<mapper type="glob" from="C*ies" to="Q*y"/>
+
+ + + + + + + + + + + + + + + + + + + + + +
Source file nameTarget file name
A.javaignored
foo/bar/B.javaignored
C.propertiesQ.property
Classes/dir/dir2/A.propertiesQlasses/dir/dir2/A.property
+

regexp

+

Both to and from define regular +expressions. If the source file name matches the from +pattern, the target file name will be constructed from the +to pattern, using \0 to \9 as +back-references for the full +match (\0) or the matches of the subexpressions in +parentheses. +Source +files not matching the from pattern will be ignored.

+

Note that you need to escape a dollar-sign ($) with +another dollar-sign in Ant.

+

The regexp mapper needs a supporting library and an implementation +of org.apache.tools.ant.util.regexp.RegexpMatcher that +hides the specifics of the library. Ant comes with implementations for +jakarta-regexp and jakarta-ORO. If you compile +from sources and plan to use one of them, make sure the libraries are +in your CLASSPATH. For information about using gnu.regexp or gnu.rex with Ant, see this +article.

+

Ant will choose the regular-expression library based on the +following algorithm:

+
    +
  • If the system property +ant.regexp.matcherimpl has been set, it is taken as the +name of the class implementing +org.apache.tools.ant.util.regexp.RegexpMatcher that +should be used.
  • +
  • If it has not been set, first try jakarta-ORO; if that +cannot be found, try jakarta-regexp.
  • +
+ +Examples: +
+<mapper type="regexp" from="^(.*)\.java$$" to="\1.java.bak"/>
+
+ + + + + + + + + + + + + + + + + + + + + +
Source file nameTarget file name
A.javaA.java.bak
foo/bar/B.javafoo/bar/B.java.bak
C.propertiesignored
Classes/dir/dir2/A.propertiesignored
+
+<mapper type="regexp" from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\2/\2-\3"/>
+
+ + + + + + + + + + + + + + + + + + + + + +
Source file nameTarget file name
A.javaignored
foo/bar/B.javafoo/bar/bar-B.java
C.propertiesignored
Classes/dir/dir2/A.propertiesClasses/dir/dir2/dir2-A.properties
+
+<mapper type="regexp" from="^(.*)\.(.*)$$" to="\2.\1"/>
+
+ + + + + + + + + + + + + + + + + + + + + +
Source file nameTarget file name
A.javajava.A
foo/bar/B.javajava.foo/bar/B
C.propertiesproperties.C
Classes/dir/dir2/A.propertiesproperties.Classes/dir/dir2/A
+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/CoreTypes/patternset.html b/docs/manual/CoreTypes/patternset.html new file mode 100644 index 000000000..491a62f08 --- /dev/null +++ b/docs/manual/CoreTypes/patternset.html @@ -0,0 +1,84 @@ + + + + +Ant User Manual + + + + +

PatternSet

+

Patterns can be grouped to sets and later be referenced by their +id +attribute. They are defined via a patternset element, +which can appear nested into a FileSet or a +directory-based task that constitutes an implicit FileSet. In addition, +patternsets can be defined at the same level as +target — i.e., as children of project.

+

Patterns can be specified by nested <include> or +<exclude> elements or the following attributes.

+ + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
includescomma-separated list of patterns of files that must be + included. All files are included when omitted.
includesfilethe name of a file; each line of this file is + taken to be an include pattern.
excludescomma-separated list of patterns of files that must be + excluded; no files (except default excludes) are excluded when omitted.
excludesfilethe name of a file; each line of this file is + taken to be an exclude pattern.
+ +

Examples

+
+<patternset id="non.test.sources" >
+  <include name="**/*.java"/>
+  <exclude name="**/*Test*"/>
+</patternset>
+
+

Builds a set of patterns that matches all .java files +that do not contain the text Test in their name. This set +can be referred to via +<patternset refid="non.test.sources"/>, +by tasks that support this feature, or by FileSets.

+

Note that while the includes and +excludes attributes accept +multiple elements separated by commas or spaces, the nested +<include> and <exclude> elements expect their name +attribute to hold a single pattern.

+

The nested <include> and <exclude> elements allow you to use +if and unless arguments to specify that the element should only be used if a +property is set, or that it should be used only if a property is not set.

+

For example

+
+<patternset id="sources" >
+  <include name="std/**/*.java"/>
+  <include name="prof/**/*.java" if="professional"/>
+  <exclude name="**/*Test*"/>
+</patternset>
+
+

will only include the files in the sub-directory prof if the property +professional is set to some value.

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/Integration/Antidote.html b/docs/manual/Integration/Antidote.html new file mode 100644 index 000000000..4436afcde --- /dev/null +++ b/docs/manual/Integration/Antidote.html @@ -0,0 +1,253 @@ + + + + Antidote Design Overview + + + + +

Antidote Design Overview

+ +

Version 0.2 (2000/12/18)

+ +

Authors: + Simeon H.K. Fitch +

+ +

Introduction

+ +

The purpose of this document is to communicate the overall + structure and design patters used in Antidote, the GUI for + Ant. This document is a work in progress, as well as a living + document, and it is most likely not be in full synchronization with + the source code. Therefore, if there is any doubt, view the source + ;-)

+ +

Overview

+ +

The Antidote architecture design aims to provide a high level + of modularity and extensibility. Ideally the components of + Antidote will be able to be assembled in different configurations + to provide the type of application or plug-in desired.

+ +

To acheive this modularity, a high level of decoupling is + necessary. The standard UI design approach of providing separation + of view (presentation) from model (data) is applied, leveraging + the built-in Ant data model where possible, as well as the + predifined Swing model interfaces. Furthermore, the architecture + is highly event driven, whereby modules communicate via a shared + communications channel.

+ +

To a large extent, the configuration of application modules is + driven by localized configuration files, allowing new modules or + data views to be added, as well as providing multi-language + support.

+ +

The diagram below conveys a high altitude view of the + application's structure. As the application grows, new components + will be plugged in to what will be described as the EventBus. + +

+
+Antidote Component Architecture
+
+   +---------------+ +----------------+ +-------------+ +-------------+
+   |               | |                | |             | |             |  
+   | ActionManager | | EventResponder | |  AntModule  | |  AntModule  |
+   |               | |                | |(ProjectNav) | |(SourceEdit) |  
+   +---------------+ +----------------+ +-------------+ +-------------+
+           |                  ^               ^               ^
+           |                  |               |               |
+      ActionEvent         EventObject      AntEvent       AntEvent
+           |                  |               |               |
+           v                  v               v               v
+  /---------------------------------------------------------------------\
+ /                                                                       \
+<                                   EventBus                              >
+ \                                                                       /
+  \---------------------------------------------------------------------/
+           |                  ^               ^               ^
+           |                  |               |               |
+      EventObject         ChangeEvent      BuildEvent     EventObject
+           |                  |               |               |
+           v                  |               |               v
+   +---------------+ +----------------+ +-------------+ +--------------+
+   |               | |                | |             | |              |  
+   |   Console     | |  ProjectProxy  | |    Ant      | | (Your Module)|
+   |               | |                | |             | |              |  
+   +---------------+ +----------------+ +-------------+ +--------------+
+
+    
+ +

Event Bus

+ +

The backbone of the application is the EventBus. Any + component of the application can post events to the + EventBus. Components that wish to receive events are + called BusMembers.

+ +

The EventBus will dispatch any object of type + java.util.Event, which means that Ant BuildEvent + objects, as well as AWTEvent objects can be posted (if desired). A + new class of events called AntEvent is defined for Antidote + specific events, which have the additional capability of being + cancelled mid-dispatch.

+ +

Each BusMember must provide a BusFilter instance, + which is the members' means of telling the bus which + events it is interested in. This allows a BusMember to, + say, only receive AntEvent objects.

+ +

When a BusMember registers itself with the + EventBus, it must provide a (so called) interrupt + level which is a integer value defining a relative ordering + for dispatching EventObjects to BusMembers. The + purpose of this is to allow certain BusMember instances + to see an event before others, and in the case of AntEventEventBus class defines the interrupt level constants + VETOING=1, MONITORING=5, and RESPONDING=10 to + help define categories of members. The implied purpose being that: +

    + +
  • VETOING: Listens for certain types of events, and + may process them in a non-default manner to determine if the + event should be cancelled before being dispatched to the + RESPONDING group. + +
  • MONITORING: Just listens for events, like a logger + or status monitor.
  • + +
  • RESPONDING: Process events in a default manner, + knowing that the event has passed any VETOING members.
  • + +
+ + Within a specific interrupt level, the order in which members will + receive events is undefied. A BusMember may be registered + at a level that is +/- of one of the defined levels, as long as it + follows the constraint MONITORING <= interruptLevel <= + MAX_INTERRUPT.

+ + +

Actions and ActionManager

+ +

Extensive use of the javax.swing.Action interface is + made for defining the set of menu and tool bar options that are + available. The configuration file action.properties + exists to define what should appear in the menu and toolbar, how + it is displayed, and the Action command name that is + dispatched when the user invokes that action. A class called + ActionManager exists for not only processing the + configuration file, but also for dispatching invoked action events + to the EventBus, and for controlling the enabled state of + an Action. When a new menu item or toolbar button is + desired, first it is added to the action.properties file, + and then the code to respond to it is added to the + EventResponder (see below). + + +

Commands and EventResponder

+ +

At some point in the stages of event processing, an event may + require the data model to be modified, or some other task be + performed. The Command interface is defined to classify + code which performs some task or operation. This is distinct from + an Action, which is a user request for an operation. A + Command class is the encapsulation of the operation + itself.

+ +

When an Action generates an ActionEvent, the + event is posted to the EventBus which delivers the event + to all interested BusMembers. It eventually makes it to + the EventResponder instance (registered at the + RESPONDING interrupt level), which is responsible for + translating specific events into Command objects, and + then executing the Command object. For example, when the + user selects the "Open..." menu option, an ActionEvent is + generated by the Swing MenuItem class, which is then + posted to the EventBus by the ActionManager. The + ActionEvent is delivered to the EventResponder, + which converts the ActionEvent into a Command + instance. The EventResponder then calls the method + Command.execute() to invoke the command (which displays a + dialog for selecting a file to open).

+ +

When adding new Actions or general tasks to the + application, a Command object should be created to + encapsulate the behavior. This includes most operations which + modify the state of the data model.

+ +

The purpose of this encapsulation is to allow the clean + separation of making a request, and servicing a request. Due to + various conditions in the application state, the actualy response + to a request may change, as well as who services it. This + design approach facilitates that.

+ +

Data Model and Views

+ +

NB: This part of the architecture is not fleshed out very well. There + needs to be a discussion of the degree to which the Antidote development + should be able to impose changes on the Ant data model, and to what level + that model should be mirrored in the Antidote code base. The coupling + between them should be kept low, and at the same time changes to one should + affect the other minimally. Still, features like property change events and + bean introspection (or BeanInfo) may be needed to be added to the Ant data + model. Right now the data model is encapsulated in the package + org.apache.tools.ant.gui.acs (where "acs" stands for "Ant + Construction Set").

+ +

Application Context

+ +

In order to keep the coupling amoung application modules to a + minimum, a single point of reference is needed for coordination + and data sharing. The class AppContext is the catch-all + class for containing the application state. Most modules and + Command classes require an instance of the + AppContext class. Because all state information in + contained in an AppContext instance, multiple instances + of Antidote can run inside the same JVM as long as each has it's + own AppContext. (Interestingly, two instances of the + Antidote could conceivably share an AppContext instance + through RMI, allowing remote interaction/collaboration.)

+ +

Configuration and ResourceManager

+ +

Full "i18n" support should be assumed in modern applications, + and all user viewable strings should be defined in a configuration + file. For Antidote this configuraiton file is + antidote.properties, which is located (with other UI + resources) in the subpackage "resources".

+ +

To aid in the lookup of text properties, as well as other + resources like icons, a class called ResourceManager is + defined. There are various convenience methods attached to this + class, which will likely grow to make looking up configuration + values as easy as possible.

+ +

The organization of configuration properties is based on the + fully qualifed path of the class that requires the property. For + example, the "about" box contains a messages, so it looks for the + property "org.apache.tools.ant.gui.About.message" for the text + message it should display. Therefore, the ResourceManager + method getString() takes a Class instance as + well as a String key. Please see the + ResourceManager documentation for more information. Given + this support, no user visible strings should appear in the source + code itself.

+ +

Other Resources

+ +

Other information about development on Antidote:

+ + +
+

Copyright © 2000 Apache Software Foundation. All + rights Reserved.

+ + + diff --git a/docs/VAJAntTool.html b/docs/manual/Integration/VAJAntTool.html similarity index 93% rename from docs/VAJAntTool.html rename to docs/manual/Integration/VAJAntTool.html index 16a595d28..071c6796f 100644 --- a/docs/VAJAntTool.html +++ b/docs/manual/Integration/VAJAntTool.html @@ -43,7 +43,7 @@ below doesn't work for You, it's probably not Your fault but incomplete/wrong instructions. In this case, please contact one of the authors.
We assume C:\IBMVJava as VAJ install directory. -If You have installed it elsewhere, adapt the pathes below. Execute following +If you have installed it elsewhere, adapt the paths below. Execute following steps to get the PlugIn up and running:
  • import the Ant sources into VAJ.
  • @@ -79,16 +79,16 @@ steps to get the PlugIn up and running:

Usage

-Beeing sure the tool is installed correctly and your Ant build file is +Being sure the tool is installed correctly and your Ant build file is configured, it is really easy to use.
Go to your Workbench, select the project you want to deploy and open its context menu. In the submenu Tools you should find the new -entry Ant Build. Klick it to start the tool! -

-

+entry Ant Build. Click it to start the tool! +

+

After a short time this frame should pop up: -

-

+

+

This frame contains the following:
  • A menubar with some options described later
  • @@ -129,7 +129,7 @@ for Java. It should run with the 2.x Versions, too, but we didn't try. The graphical user interface is build with AWT so it is JDK independent by now!

    -

    Copyright © 2000 Apache Software Foundation. -All rights Reserved.

    +

    Copyright © 2000 Apache Software Foundation. +All rights Reserved.

    diff --git a/docs/anttool1.gif b/docs/manual/Integration/anttool1.gif similarity index 100% rename from docs/anttool1.gif rename to docs/manual/Integration/anttool1.gif diff --git a/docs/toolmenu.gif b/docs/manual/Integration/toolmenu.gif similarity index 100% rename from docs/toolmenu.gif rename to docs/manual/Integration/toolmenu.gif diff --git a/docs/manual/LICENSE b/docs/manual/LICENSE new file mode 100644 index 000000000..032be1484 --- /dev/null +++ b/docs/manual/LICENSE @@ -0,0 +1,48 @@ +/* + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 1999 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Ant" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation. For more information on the + * Apache Software Foundation, please see . + * + */ diff --git a/docs/antlr.html b/docs/manual/OptionalTasks/antlr.html similarity index 86% rename from docs/antlr.html rename to docs/manual/OptionalTasks/antlr.html index de10bb896..47624249e 100644 --- a/docs/antlr.html +++ b/docs/manual/OptionalTasks/antlr.html @@ -10,7 +10,7 @@

    ANTLR

    Description

    - Invokes the ANTLR Translator generator + Invokes the ANTLR Translator generator on a grammar file.

    @@ -48,7 +48,7 @@ fork Run ANTLR in a separate VM. - No, default is "off" + No, default is "off" dir @@ -70,3 +70,9 @@


    +

    Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

    + + + + diff --git a/docs/manual/OptionalTasks/cab.html b/docs/manual/OptionalTasks/cab.html new file mode 100644 index 000000000..ddd974bac --- /dev/null +++ b/docs/manual/OptionalTasks/cab.html @@ -0,0 +1,130 @@ + + + + +Ant User Manual + + + + +

    Cab

    +

    Description

    +

    The cab task creates Microsoft cab archive files. It is invoked +similar to the jar or zip tasks. +This task will work on Windows using the external cabarc tool (provided by Microsoft) +which must be located in your executable path.

    +

    To use this task on other platforms you need to download and compile libcabinet from + +http://trill.cis.fordham.edu/~barbacha/cabinet_library/.

    +

    See the section on directory based +tasks, on how the inclusion/exclusion of files works, and how to +write patterns.

    +

    This task forms an implicit FileSet and +supports all attributes of <fileset> +(dir becomes basedir) as well as the nested +<include>, <exclude> and +<patternset> elements.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescriptionRequired
    cabfilethe name of the cab file to create.Yes
    basedirthe directory to start archiving files from.Yes
    verboseset to "yes" if you want to see the output from + the cabarc tool. defaults to "no".No
    compressset to "no" to store files without compressing. + defaults to "yes".No
    optionsuse to set additional command-line options for + the cabarc tool. should not normally be necessary.No
    includescomma separated list of patterns of files that + must be included. All files are included when omitted.No
    includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
    excludescomma separated list of patterns of files that + must be excluded. No files (except default excludes) are excluded + when omitted.No
    excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
    defaultexcludesindicates whether default excludes should be used + or not ("yes"/"no"). Default excludes are used when omitted.No
    +

    Examples

    +
    +<cab cabfile="${dist}/manual.cab"
    +     basedir="htdocs/manual" 
    +  />
    +
    +

    cabs all files in the htdocs/manual directory into a file called +manual.cab in the ${dist} directory.

    +
    +<cab cabfile="${dist}/manual.cab"
    +     basedir="htdocs/manual"
    +     excludes="mydocs/**, **/todo.html"
    +  />
    +
    +

    cabs all files in the htdocs/manual directory into a file called +manual.cab in the ${dist} directory. Files in the directory mydocs, +or files with the name todo.html are excluded.

    +
    +<cab cabfile="${dist}/manual.cab"
    +     basedir="htdocs/manual"
    +     includes="api/**/*.html"
    +     excludes="**/todo.html"
    +     verbose="yes"
    +  />
    +
    +

    Cab all files in the htdocs/manual directory into a file called +manual.cab in the ${dist} directory. Only html files under the +directory api are archived, and files with the name todo.html are +excluded. Output from the cabarc tool is displayed in the build +output.

    +
    +

    Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

    + + + + diff --git a/docs/clearcase.html b/docs/manual/OptionalTasks/clearcase.html similarity index 93% rename from docs/clearcase.html rename to docs/manual/OptionalTasks/clearcase.html index 706929bfd..82fb7e385 100644 --- a/docs/clearcase.html +++ b/docs/manual/OptionalTasks/clearcase.html @@ -7,8 +7,7 @@ -
    -

    Optional tasks

    +

    ClearCase Support

    • CCCheckin
    • CCCheckout
    • @@ -32,39 +31,39 @@ Task to perform a Checkin command to ClearCase. Path to the ClearCase view file or directory that the command will operate on No - + comment - Specify a comment. Only one of comment or cfile may be used. + Specify a comment. Only one of comment or commentfile may be used. No - + commentfile - Specify a file containing a comment. Only one of comment or cfile + Specify a file containing a comment. Only one of comment or commentfile may be used. No - + nowarn Suppress warning messages No - + preservetime Preserve the modification time No - + keepcopy Keeps a copy of the file with a .keep extension No - + identical Allows the file to be checked in even if it is identical to the original No - +

      Examples

      @@ -95,49 +94,49 @@ Task to perform a Checkout command to ClearCase. Path to the ClearCase view file or directory that the command will operate on No - + reserved Specifies whether to check out the file as reserved or not Yes - + out Creates a writable file under a different filename No - + nodata Checks out the file but does not create an editable file containing its data No - + branch Specify a branch to check out the file to No - + version Allows checkout of a version other than main latest No - + nowarn Suppress warning messages No - + comment - Specify a comment. Only one of comment or cfile may be used. + Specify a comment. Only one of comment or commentfile may be used. No - + commentfile Specify a file containing a comment. Only one of comment or - cfile may be used. + commentfile may be used. No - +

      Examples

      @@ -169,13 +168,13 @@ Task to perform a UnCheckout command to ClearCase. Path to the ClearCase view file or directory that the command will operate on No - + keepcopy Specifies whether to keep a copy of the file with a .keep extension or not No - +

      Examples

      @@ -202,41 +201,41 @@ Task to perform an Update command to ClearCase. Path to the ClearCase view file or directory that the command will operate on No - + graphical Displays a graphical dialog during the update No - + log Specifies a log file for ClearCase to write to No - + overwrite Specifies whether to overwrite hijacked files or not No - + rename Specifies that hijacked files should be renamed with a .keep extension No - + currenttime Specifies that modification time should be written as the current time. Either currenttime or preservetime can be specified. No - + preservetime Specifies that modification time should preserved from the VOB time. Either currenttime or preservetime can be specified. No - +

      Examples

      diff --git a/docs/manual/OptionalTasks/depend.html b/docs/manual/OptionalTasks/depend.html new file mode 100644 index 000000000..d8d4293e1 --- /dev/null +++ b/docs/manual/OptionalTasks/depend.html @@ -0,0 +1,163 @@ + + + + +Ant User Manual + + + + +

      Depend

      + +A task to manage Java class file dependencies. + +

      Description

      + +

      +The depend task works by determining which classes are out of date with +respect to their source and then removing the class files of any other +classes which depend on the out-of-date classes. +

      + +

      To determine the class dependencies, the depend task analyses the class +files of all class files passed to it. Depend does not parse your source code in +any way but relies upon the class references encoded into the class files by the +compiler. This is generally faster than parsing the Java source.

      + +

      +To learn more about how this information is obtained from the class files, +please refer to the Java +Virtual Machine Specification +

      + +

      Since a class' dependencies only change when the class itself changes, the +depend task is able to cache dependency information. Only those class files +which have changed will have their dependency information re-analysed. Note that +if you change a class' dependencies by changing the source, it will be +recompiled anyway. You can examine the dependency files created to understand +the dependencies of your classes. Please do not rely, however, on the format of +the information, as it may change in a later release.

      + +

      Once depend discovers all of the class dependencies, it "inverts" +this relation to determine, for each class, which other classes are dependent +upon it. This "affects" list is used to discover which classes are +invalidated by the out of date class. The class files of the invalidated +classes are removed, triggering the compilation of the affected classes.

      + +

      The depend task supports an attribute, "closure" which controls +whether depend will only consider direct class-class relationships or whether it +will also consider transitive, indirect relationships. For example, say there +are three classes, A, which depends on B, which in-turn depend on C. Now say +that class C is out of date. Without closure, only class B would be removed by +depend. With closure set, class A would also be removed. Normally direct +relationships are sufficient - it is unusual for a class to depend on another +without having a direct relationship. With closure set, you will notice that +depend typically removes far more class files.

      + +

      Performance

      + +

      The performance of the depend task is dependent on a +number of factors such as class relationship complexity and how many class files +are out of date. The following tests have been run when build Ant itself, on the +author's machine using JDK1.3

      + + + + + + + + + + + + + + + + + + +
      Building Ant from clean using Javac11 seconds
      Building Ant from clean using Jikes5 seconds
      Running <depend> when up-to-date and no cache4 seconds (Depend takes 2 seconds)
      Running <depend> when up-to-date and with a cache2 seconds (Depend takes 1 seconds)
      + +

      This involves compiling 177 files. The above figures are indicative only. +The decision about whether it is cheaper to just recompile all classes or to +use the depend task will depend on the size of your project and how interrelated +your classes are.

      + + +

      Limitations

      + +

      There are some dependencies which depend will not detect.

      + +
        +
      • If the Java compiler optimizes away a class relationship, + there can be a source dependency without a class dependency.
      • + +
      • Non public classes cause two problems. Firstly depend cannot relate + the class file to a source file. In the future this may be addressed + using the source file attribute in the classfile. Secondly, neither + depend nor the compiler tasks can detect when a non public class is + missing. Inner classes are handled by the depend task.
      • +
      + + +

      Parameters

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired
      srcDirThis is the directory where the source exists. depend +will examine this to determine which classes. If you use multiple +source directories you can pass this a path of source directories.Yes
      destDirThis is the root directory of the class files which +will be analysed. If this is not present, the srcdir is used.No
      cacheThis is a directory in which depend can store and +retrieve dependency information. If this is not present, depend will not +use a cache No
      closureThis attribute controls whether depend only removes +classes which directly depend on out of date classes. If this is set to true, +depend will traverse the class dependency graph deleting all affected +classes. Defaults to falseNo
      + +

      Examples

      +
      +
          <depend srcdir="${java.dir}"
      +    destdir="${build.classes}"
      +    cache="depcache"
      +    closure="yes"/>
      +
      + +

      In this example classes in the ${build.classes} directory will be removed if +they depend on out-of-date classes. Classes are considered out of date with +respect to the source in the ${java.dir} directory using the same mechanism as +the javac task. In this instance the depend task caches its dependency +information in the depcache directory.

      + +
      +

      Copyright © 2000,2001 Apache Software Foundation. +All rights +Reserved.

      + + + + diff --git a/docs/dotnet.html b/docs/manual/OptionalTasks/dotnet.html similarity index 65% rename from docs/dotnet.html rename to docs/manual/OptionalTasks/dotnet.html index b81bfa136..2a829450c 100644 --- a/docs/dotnet.html +++ b/docs/manual/OptionalTasks/dotnet.html @@ -2,17 +2,21 @@ .NET classes for Ant + + -

      dotnet classes for Ant

      +

      .NET classes for Ant

      +

      By Steve Loughran; steve_l@iseran.com

      -

      Steve Loughran; steve_l@iseran.com

      Vision

      -Make ant the definative build tool for .NET projects, just -as it is becoming for java projects

      +Make ant the definitive build tool for .NET projects, just +as it is becoming for java projects +

      -

      Detail.

      +

      Detail

      +

      The emergent policy in big java projects is 'IDE for code and debug'; Ant for builds, test and deployment. While IDEs are great for an individual development task, Ant not only rebuilds everything insanely @@ -21,7 +25,7 @@ EJB servers, SQL commands, all can be done from a relatively simple XML declaration of what you want done. Also in a large project (especially open source) there is no means of dictating which IDE to use. Ant gives IDE independence, cross platform portability and ease of -extensibility. +extensibility.

      @@ -29,28 +33,28 @@ Projects using .net should be able to use the same tool. This will avoid everyone being dependent on Visual Studio.net (if they have it) supplemented with makefiles and batch files. Anyone doing mixed java/dotnet development will be particulary grateful, as they can have a unified build -process. +process.

      If at sometime in the future bits of .net do appear on different platforms then ant based build files will migrate -once the ant tasks have been migrated and any hard codings of DOS-descendant file system conventions -removed from the build.xml files +removed from the build.xml files.

      Key .net Tasks

        -
      1. csc - csharp compiler - *.csc -> output -
      2. ilasm - IL assembler - *.il ->.exe or .dll -
      3. ResX - ResXToResources.exe .resx -> .resources -
      4. al - assembly linker (.dll) -> -
      5. Signcode - .exe + keys -> .exe -
      6. Resgen - .properties -> .resources -
      7. Type Library Exporter (TlbExp.exe) .dll -> .tlb -
      8. TlbImp.exe Type Library Importer -
      9. RegAsm.exe Assembly Registration Tool .dll -> .reg | registration -
      10. WebServiceUtil -SOAP proxy import, SDL generation tool +
      11. csc - csharp compiler - *.csc -> output
      12. +
      13. ilasm - IL assembler - *.il ->.exe or .dll
      14. +
      15. ResX - ResXToResources.exe .resx -> .resources
      16. +
      17. al - assembly linker (.dll) ->
      18. +
      19. Signcode - .exe + keys -> .exe
      20. +
      21. Resgen - .properties -> .resources
      22. +
      23. Type Library Exporter (TlbExp.exe) .dll -> .tlb
      24. +
      25. TlbImp.exe Type Library Importer
      26. +
      27. RegAsm.exe Assembly Registration Tool .dll -> .reg | registration
      28. +
      29. WebServiceUtil -SOAP proxy import, SDL generation tool

      Ant Wrapper for net tasks

      @@ -63,27 +67,27 @@ from the file pattern matching function. The esoteric tasks can then supported on demand by those who need them. The initial .net tasks should provide a foundation for that demand creation -to be simple. +to be simple.

      Plan

      1. code up C sharp task and distribute for feedback & identify possible -aid -
      2. Use for a real end to end development task -
      3. Add the next task I need (whatever that is) -
      4. Refactor to produce a base class for .net tasks -
      5. Leave it other people write all the other tasks +aid
      6. +
      7. Use for a real end to end development task
      8. +
      9. Add the next task I need (whatever that is)
      10. +
      11. Refactor to produce a base class for .net tasks
      12. +
      13. Leave it other people write all the other tasks

      Risks

      • The .net SDK is unstable; the next builds will change the commands, arguments -and behaviours. Probability: 100%. Impact: 2 days. +and behaviours. Probability: 100%. Impact: 2 days.
      • Portable tasks turn out to be harder than envisaged - (=reworking if/when non Win32 .net build tools appear) + (=reworking if/when non Win32 .net build tools appear)
      @@ -93,22 +97,22 @@ and behaviours. Probability: 100%. Impact: 2 days. To use the net tasks one needs
        -
      • A Win2K box (or any other platform which supports the .net build tools) +
      • A Win2K box (or any other platform which supports the .net build tools)
      • -
      • JavaVM - Java1.1 or later; Java1.3 recommended. +
      • JavaVM - Java1.1 or later; Java1.3 recommended.
      • Ant downloaded and the environment and path variables set up so -that typing 'ant' invokes ant via a batch file. +that typing 'ant' invokes ant via a batch file.
      • An XML parser for ant. The usual distributions include an appropriate -version parser.jar and jaxp.jar. +version parser.jar and jaxp.jar.
      • the .net tasks archive (dotnettasks.jar) included in the - ant\lib directory + ant\lib directory
      • -
      • The .net sdk installed with the binaries on the path. (Test: type CSC) +
      • The .net sdk installed with the binaries on the path. (Test: type CSC)
      • -
      • A build.xml file to describe the build process +
      • A build.xml file to describe the build process

      @@ -121,31 +125,30 @@ more complex projects. This build does not work with the older SDK, primarily because the automatic reference feature references libraries only found in the new SDK version.

      -External changes +External changes

        -
      • Recursive inclusion of .cs and .il files +
      • Recursive inclusion of .cs and .il files
      • -
      • Documentation enhanced, includes examples and details of all parameters +
      • Documentation enhanced, includes examples and details of all parameters
      • The csc task automatically includes the common dotnet assemblies, so there is no need to remember to refer to 'System.dll', 'System.Web.Services', etc. This feature can be disabled by setting the 'includeDefaultReferences' - flag to false. + flag to false.
      • References can also be referred to using the ReferenceFiles parameter, which -is an ant path specification. The old 'references' string is still retained. -< -li> An 'extraoptions' attribute enables the build file to include any CSC options -which are not explicitly supported in the CSC task. +is an ant path specification. The old 'references' string is still retained.
      • +
      • An 'extraoptions' attribute enables the build file to include any CSC options +which are not explicitly supported in the CSC task.
      Internal changes
        -
      • Some minor refactoring (move common code a method) +
      • Some minor refactoring (move common code a method)
      • Application of Jedits JavaStyle task resulted in a major reshaping of the codebase and the insertion of a blank line every second line. Significant -effort was required to revert some (but not all) changes. -
      • Removed throws clause from methods which can't throw exceptions +effort was required to revert some (but not all) changes.
      • +
      • Removed throws clause from methods which can't throw exceptions
      The test harness has been expanded to include unicode source file @@ -173,18 +176,17 @@ an equivalent. CSC.exe must be on the execute path too.

      All parameters are optional: <csc/> should suffice to produce a debug build of all *.cs files. References to external files do require explicit -enumeration, so are one of the first attributes to consider adding. +enumeration, so are one of the first attributes to consider adding.

      -The task is a directory based task, so attributes like includes="**/*.cs" and -excludes="broken.cs" can be used to control the files pulled in. By default, +The task is a directory based task, so attributes like includes="**/*.cs" and +excludes="broken.cs" can be used to control the files pulled in. By default, all *.cs files from the project folder down are included in the command. When this happens the output file -if not specified- is taken as the first file in the list, which may be somewhat hard to control. -Specifying the output file with 'outfile' seems prudent. +Specifying the output file with 'outfile' seems prudent.

      -

      @@ -194,30 +196,30 @@ Specifying the output file with 'outfile' seems prudent. - + - - + + - + + - + + @@ -233,14 +235,14 @@ Specifying the output file with 'outfile' seems prudent. - - + + @@ -253,7 +255,7 @@ Specifying the output file with 'outfile' seems prudent. the common assemblies in dotnet beta1, and tells the compiler to link in mscore.dll - @@ -263,67 +265,68 @@ Specifying the output file with 'outfile' seems prudent. - + + - + + - + + - + + - + + + - + + + - + + - + + - + - + + +
      additionalModules - Semicolon separated list of modules to refer to + additionalModulesSemicolon separated list of modules to refer to
      defaultexcludes indicates whether default excludes should be used or not "true"(default) or "false" + "true"(default) or "false"
      definitions - defined constants - "RELEASE;BETA1" + definitionsdefined constants "RELEASE;BETA1"
      debug - include debug information - "true"(default) or "false" + debuginclude debug information"true"(default) or "false"
      docFile - name of file for documentation - "doc.xml" + docFilename of file for documentation"doc.xml"
      excludesextraOptions Any extra options which aren't explicitly supported by the CSharp task "/warnaserror+ /baseaddress:0x12840000" + "/warnaserror+ /baseaddress:0x12840000"
      failOnError - Should a failed compile halt the build? - "true"(default) or "false" + failOnErrorShould a failed compile halt the build?"true"(default) or "false"
      includes"true"(default) or "false" + "true"(default) or "false"
      incremental - Incremental build flag. Avoid till it works - "true" or "false"(default) + incrementalIncremental build flag. Avoid till it works"true" or "false"(default)
      mainClass - name of main class for executables - "com.example.project.entrypoint" + mainClassname of main class for executables"com.example.project.entrypoint"
      optimize - optimisation flag - "true" or "false"(default) + optimizeoptimisation flag"true" or "false"(default)
      outputFile - filename of output - "example.exe" + outputFilefilename of output"example.exe"
      references - Semicolon separated list of dlls to refer to - "mylib.dll;nunit.dll"referencesSemicolon separated list of dlls to refer to"mylib.dll;nunit.dll"
      referenceFiles Ant Path descriptioon of references to include. - Wildcards should work. + Wildcards should work.
      srcDir - source directory (default = project directory) - "."srcDirsource directory (default = project directory)"."
      targetType - Type of target - "exe","module","winexe" or "library" + targetTypeType of target"exe", "module", "winexe" or "library"
      unsafe - enable unsafe code - "true" or "false"(default) + unsafeenable unsafe code"true" or "false"(default)
      warnLevel + warnLevel level of warning currently between 1 and 4 with 4 - being the strictest. - "1"-"4" + being the strictest. "1"-"4"
      win32Icon - filename of icon to include - "res/myicon.ico"win32Iconfilename of icon to include"res/myicon.ico"

      Example +

      <csc
               optimize="true"
               debug="false"
      @@ -340,11 +343,10 @@ Example
       

      Task: ilasm

      -Task to assemble .net 'Intermediate Language' files. +

      Task to assemble .net 'Intermediate Language' files. The task will only work on win2K until other platforms support csc.exe or an equivalent. ilasm.exe must be on the execute path too. -

      - +

      All parameters are optional: <il/> should suffice to produce a debug build of all *.il files. @@ -354,16 +356,16 @@ equivalent. [The low level commands take things like /OUT=file, csc wants /out:file ... /verbose is used some places; /quiet here in ildasm... etc.] It would be nice if someone made all the command line tools consistent (and not as brittle as the java cmdline tools) - +

      -The task is a directory based task, so attributes like includes="*.il" and -excludes="broken.il" can be used to control the files pulled in. +The task is a directory based task, so attributes like includes="*.il" and +excludes="broken.il" can be used to control the files pulled in. Each file is built on its own, producing an appropriately named output file unless manually specified with outfile +

      -

      @@ -372,20 +374,18 @@ manually specified with outfile - - - - + + + - + - - + + @@ -419,45 +419,45 @@ manually specified with outfile taken to be an include pattern - + - + + - + + - + + - + + - + + - + +
      Example
      defaultexcludes indicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted.
      debug - include debug information - true (default) +
      debuginclude debug informationtrue (default)
      excludes comma separated list of patterns of files that must be @@ -400,13 +400,13 @@ manually specified with outfile extraOptions Any extra options which aren't explicitly supported by the ilasm task +
      failOnError - Should a failed compile halt the build? - "true"(default) + failOnErrorShould a failed compile halt the build?"true"(default)
      includes
      listing + listing Produce a listing (off by default). Listings go to the - current output stream - "on", "off" (default) + current output stream"on", "off" (default)
      outputFile - filename of output - "example.exe" + outputFilefilename of output"example.exe"
      owner - restrict disassembly by setting the 'owner' string - "secret" + ownerrestrict disassembly by setting the 'owner' string"secret"
      resourceFile - name of resource file to include - "resources.res" + resourceFilename of resource file to include"resources.res"
      srcDir - source directory (default = project directory) - + srcDirsource directory (default = project directory)
      targetType - Type of target. library means DLL is output. - "exe"(default),"library" + targetTypeType of target. library means DLL is output. "exe"(default), "library"
      verbose - output progress messages - "on", "off" (default) + verboseoutput progress messages"on", "off" (default)

      -Example +Example

      <ilasm
               outputFile="app.exe"
               verbose="on"
      diff --git a/docs/manual/OptionalTasks/ejb.html b/docs/manual/OptionalTasks/ejb.html
      new file mode 100644
      index 000000000..3527a3e8d
      --- /dev/null
      +++ b/docs/manual/OptionalTasks/ejb.html
      @@ -0,0 +1,857 @@
      +
      +
      +
      +
      +Ant EJB Tasks
      +
      +
      +
      +
      +
      +

      Ant EJB Tasks User Manual

      +

      by

      + + + +

      Version 1.1 - 2000/07/18

      +
      +

      Table of Contents

      + + +
      +

      Introduction

      +

      Ant provides a number of optional tasks for developing +Enterprise Java Beans (EJBs). +In general these tasks are specific to the particular vendor's EJB Server. At present the tasks support +Weblogic 4.5.1 and 5.1 EJB servers. Over time we expect further optional tasks +to support additional EJB Servers. +

      +
      +

      EJB Tasks

      + + + + + + + +
      TaskApplication Servers
      ddcreatorWeblogic 4.5.1
      ejbcWeblogic 4.5.1
      wlrunWeblogic 4.5.1, 5.1 & 6.0
      wlstopWeblogic 4.5.1, 5.1 & 6.0
      ejbjarWeblogic 5.1 & 6.0
      + +
      +

      ddcreator

      +

      Description:

      +

      ddcreator will compile a set of Weblogic text-based deployment descriptors into a serialized +EJB deployment descriptor. The selection of which of the text-based descriptors are to be compiled +is based on the standard Ant include and exclude selection mechanisms. +

      + +

      Parameters:

      + + + + + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired
      descriptorsThis is the base directory from which descriptors are selected.Yes
      destThe directory where the serialised deployment descriptors will be writtenYes
      classpathThis is the classpath to use to run the underlying weblogic ddcreator tool. + This must include the weblogic.ejb.utils.DDCreator classNo
      +

      Examples

      +
      <ddcreator descriptors="${dd.dir}" 
      +           dest="${gen.classes}" 
      +           classpath="${descriptorbuild.classpath}">
      +  <include name="*.txt" />
      +</ddcreator>
      +
      + +
      +

      ejbc

      +

      Description:

      +

      The ejbc task will run Weblogic's ejbc tool. This tool will take a serialised deployment descriptor, +examine the various EJB interfaces and bean classes and then generate the required support classes +necessary to deploy the bean in a Weblogic EJB container. This will include the RMI stubs and skeletons +as well as the classes which implement the bean's home and remote interfaces.

      +

      +The ant task which runs this tool is able to compile several beans in a single operation. The beans to be +compiled are selected by including their serialised deployment descriptors. The standard ant +include and exclude constructs can be used to select the deployment descriptors +to be included.

      +

      +Each descriptor is examined to determine whether the generated classes are out of date and need to be +regenerated. The deployment descriptor is de-serialized to discover the home, remote and +implementation classes. The corresponding source files are determined and checked to see their +modification times. These times and the modification time of the serialised descriptor itself are +compared with the modification time of the generated classes. If the generated classes are not present +or are out of date, the ejbc tool is run to generate new versions.

      +

      Parameters:

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired
      descriptorsThis is the base directory from which the serialised deployment descriptors are selected.Yes
      destThe base directory where the generated classes, RIM stubs and RMI skeletons are writtenYes
      manifestThe name of a manifest file to be written. This manifest will contain an entry for each EJB processedYes
      srcThe base directory of the source tree containing the source files of the home interface, + remote interface and bean implementation classes.Yes
      classpathThis classpath must include both the weblogic.ejbc class and the + classfiles of the bean, home interface, remote interface, etc of the bean being + processed.No
      +

      Examples

      +
      <ejbc descriptors="${gen.classes}"
      +           src="${src.dir}" 
      +           dest="${gen.classes}"
      +           manifest="${build.manifest}" 
      +           classpath="${descriptorbuild.classpath}">
      +  <include name="*.ser" />
      +</ejbc>
      +
      + +
      +

      wlrun

      +

      Description:

      + +

      The wlrun task is used to start a weblogic server. The task runs +a weblogic instance in a separate Java Virtual Machine. A number of parameters +are used to control the operation of the weblogic instance. Note that the task, +and hence ant, will not complete until the weblogic instance is stopped.

      + +

      Parameters:

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired for 4.5.1 and 5.1Required for 6.0
      BEA HomeThe location of the BEA Home qwhere the server's config is defined. + If this attribute is present, wlrun assumes that the server will + be running under Weblogic 6.0N/AYes
      homeThe location of the weblogic home that is to be used. This is the location + where weblogic is installed.YesYes. Note this is the absolute location, not relative to + BEA home.
      DomainThe domain to which the server belongs.N/AYes
      classpathThe classpath to be used with the Java Virtual Machine that runs the Weblogic + Server. Prior to Weblogic 6.0, this is typically set to the Weblogic + boot classpath. Under Weblogic 6.0 this should include all the + weblogic jarsYesYes
      wlclasspathThe weblogic classpath used by the Weblogic Server.NoN/A
      propertiesThe name of the server's properties file within the weblogic home directory + used to control the weblogic instance.YesN/A
      nameThe name of the weblogic server within the weblogic home which is to be run. + This defaults to "myserver"NoNo
      policyThe name of the security policy file within the weblogic home directory that + is to be used. If not specified, the default policy file weblogic.policy + is used.NoNo
      usernameThe management username used to manage the serverN/ANo
      passwordThe server's management passwordN/AYes
      pkPasswordThe private key password so the server can decrypt the SSL + private key fileN/ANo
      jvmargsAdditional argument string passed to the Java Virtual Machine used to run the + Weblogic instance.NoNo
      argsAdditional argument string passed to the Weblogic instance.NoNo
      + +

      Nested Elements

      + +

      The wlrun task supports nested <classpath> and <wlclasspath> +elements to set the repsective classpaths.

      + +

      Examples

      + +

      This example shows the use of wlrun to run a server under Weblogic 5.1

      + +
      +    <wlrun taskname="myserver"
      +           classpath="${weblogic.boot.classpath}"
      +           wlclasspath="${weblogic.classes}:${code.jars}"
      +           name="myserver" 
      +           home="${weblogic.home}"
      +           properties="myserver/myserver.properties"/>
      +
      + +

      This example shows wlrun being used to run the petstore server under +Weblogic 6.0

      + +
      +    <wlrun taskname="petstore"
      +           classpath="${weblogic.classes}"
      +           name="petstoreServer" 
      +           domain="petstore" 
      +           home="${weblogic.home}"
      +           password="petstorePassword"
      +           beahome="${bea.home}"/>
      +
      + +
      +

      wlstop

      +

      Description:

      + +

      The wlstop task is used to stop a weblogic instance which is +currently running. To shut down an instance you must supply both a username and +a password. These will be stored in the clear in the build script used to stop +the instance. For security reasons, this task is therefore only appropriate in a +development environment.

      + +

      This task works for most version of Weblogic, including 6.0. You need to +specify the BEA Home to have this task work correctly under 6.0

      + +

      Parameters:

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired
      BEAHomeThis attribute selects Weblogic 6.0 shutdown.No
      classpathThe classpath to be used with the Java Virtual Machine that runs the Weblogic + Shutdown comment.Yes
      userThe username of the account which will be used to shutdown the serverYes
      passwordThe password for the account specified in the user parameter.Yes
      urlThe URL which describes the port to which the server is listening for T3 connections. + For example, t3://localhost:7001Yes
      delayThe delay in seconds after which the server will stop. This defaults to an + immediate shutdown.No
      + +

      Nested Element

      + +

      The classpath of the welstop task can be set by a <classpath> nested element.

      + +

      Examples

      + +

      This example show the shutdown for a Weblogic 6.0 server

      + +
      +    <wlstop classpath="${weblogic.classes}"
      +            user="system"
      +            url="t3://localhost:7001"
      +            password="foobar"
      +            beahome="${bea.home}"/>
      +
      + +
      +

      ejbjar

      +

      Description:

      + +

      This task is designed to support building of EJB1.1 jar files. Support is +currently provided for 'vanilla' EJB1.1 jar files - i.e. those containing only +the user generated class files and the standard deployment descriptor. Nested +elements provide support for vendor specific deployment tools. These currently +include:

      +
        +
      • an element or building Weblogic 5.1/6.0 session/entity beans using the + weblogic.ejbc tool.
      • +
      • an element for building TOPLink for WebLogic 2.5.1-enabled entity beans.
      • +
      + +

      This task supports two approaches to creating ejb jar files. The first +approach assumes a particular naming convention for deployment descriptor files. +For an Account bean, for example, the deployment descriptor would be named +Account-ejb-jar.xml. This naming convention allows the task to +distinguish deployment descriptors without relying on their positioning within a +source tree. It is also used to derive the name of the .jar file which is +generated. For the example this would be Account.jar. Vendor +specific files are assumed to be named in a similar fashion. The deployment +descriptor file which defines additional weblogic specific information for the +above bean would be Account-weblogic-ejb-jar.xml. The second +approach does not require a naming convention. This approach uses a specified a +jar name for the resultant ejb jar. If the jar name is present, then no naming +convention is required. If the jar name is not specified, then the default +naming convention is expected for the deployment descriptor files.

      + +

      The task works as a directory scanning task, and performs an action for each +deployment descriptor found. As such the includes and excludes should be set +to ensure that all desired EJB1.1 descriptors are found, but no application +server descriptors are found. For each descriptor found, ejbjar will parse the +deployment descriptor to determine the necessary class files which implement the +bean. These files are assembled along with the deployment descriptors into a +well formed EJB jar file. Any support files which need to be included in the +generated jarcan be added with the <support> nested element. For each +class included in the jar, ejbjar will scan for any super classes or super +interfaces. These will be added to the generated jar.

      + +

      If no nested vendor-specific deployment elements are present, the task will +simply generate a generic EJB jar. Such jars are typically used as the input to +vendor-specific deployment tools. For each nested deployment element, a vendor +specific deployment tool is run to generate a jar file ready for deployment in +that vendor's EJB container.

      + +

      The jar files are only built if they are out of date. Each deployment tool +element will examine its target jar file and determine if it is out of date with +respect to the class files and deployment descriptors that make up the bean. If +any of these files are newer than the jar file the jar will be rebuilt otherwise +a message is logged that the jar file is up to date.

      + +

      Parameters:

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired
      descriptordirThe base directory under which to scan for EJB + deployment descriptors. If this attribute is not + specified, then the deployment descriptors must be + located in the directory specified by the 'srcdir' + attribute.No
      srcdirThe base directory containing the .class files that + make up the bean. Note that this can be the same as + the descriptordir if all files are in the same directory + tree.Yes
      destdirThe base directory into which generated jar files are + deposited. Jar files are deposited in directories + corresponding to their location within the descriptordir + namespace. Note that this attribute is only used if the + task is generating generic jars (i.e. no vendor-specific + deployment elements have been specified).Yes
      basejarnameThe base name that is used for the generated jar files. + If this attribute is specified, the generic jar file name + will use this value as the prefix (followed by the value + specified in the 'genericjarsuffix' attribute) and the + resultant ejb jar file (followed by any suffix specified + in the nested element).No
      basenameterminatorString value used to substring out a string from the name + of each deployment descriptor found, which is then used to + locate related deployment descriptors (e.g. the WebLogic + descriptors). For example, a basename of '.' and a + deployment descriptor called 'FooBean.ejb-jar.xml' would + result in a basename of 'FooBean' which would then be used + to find FooBean.weblogic-ejb-jar.xml and + FooBean.weblogic-cmp-rdbms-jar.xml, as well as to create + the filenames of the jar files as FooBean-generic.jar and + FooBean-wl.jar. This attribute is not used if the + 'basejarname' attribute is specified.No, defaults to '-'.
      genericjarsuffixString value appended to the basename of the deployment + descriptor to create the filename of the generic EJB jar + file.No, defaults to '-generic.jar'.
      classpathThis classpath is used when resolving classes which + are to be added to the jar. Typically nested deployment + tool elements will also support a classpath which + will be combined with this classpath when resolving + classesNo.
      flatdestdirSet this attribute to true if you want all generated jars + to be placed in the root of the destdir, rather than + according to the location of the deployment descriptor + within the descriptor dir hierarchy.No.
      + +

      Nested Elements

      + +

      In addition to the vendor specific nested elements, the ejbjar task provides +three nested elements.

      + +

      Classpath

      + +

      The <classpath> nested element allows the classpath +to be set. It is useful when setting the classpath from a reference path. IN all +othe rrespects the behaviour is the same as the classpath attribute.

      + +

      dtd

      + +

      The <dtd> element is used to specify the local location of DTDs to be +used when parsing the EJB deployment descriptor. Using a local DTD is much +faster than loading the DTD across the net. If you are running ejbjar behind a +firewall you may not even be able to access the remote DTD. The supported +vendor-specific nested elements know the location of the required DTDs within +the vendor class hierarchy and, in general, this means <dtd> elements are +not required. It does mean, however, that the vendor's class hierarchy must be +available in the classpath when Ant is started. If your want to run Ant without +requiring the vendor classes in the classpath, you would need to use a +<dtd> element.

      + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired
      publicIdThe public Id of the DTD for which the location is being providedYes
      locationThe location of the local copy of the DTD. This can either be a + file or a resource loadable from the classpath.Yes
      + +

      support

      + +

      The <support> nested element is used to supply additional classes +(files) to be included in the generated jars. The <support> element is a +FileSet, so it can either reference a fileset declared elsewehere or it can be +defined in-place with the approrpiate <include> and <exclude> nested +elements. The files in the support fileset are added into the generated EJB jar +in the same relative location as their location within the support fileset. Note +that when ejbjar generates more than one jar file, the support files are added +to each one.

      + +

      Vendor-specific deployment elements

      + +Each vendor-specific nested element controls the generation of a deployable jar +specific to that vendor's EJB container. The parameters for each supported +deployment element are detailed here. + +

      Weblogic element

      + +

      The weblogic element is used to control the weblogic.ejbc compiler for +generating weblogic EJB jars. Prior to Ant 1.3, the method of locating CMP +descriptors was to use the ejbjar naming convention. So if your ejb-jar was +called, Customer-ejb-jar.xml, your weblogic descriptor was called Customer- +weblogic-ejb-jar.xml and your CMP descriptor had to be Customer-weblogic-cmp- +rdbms-jar.xml. In addition, the <type-storage> element in the weblogic +descriptor had to be set to the standard name META-INF/weblogic-cmp-rdbms- +jar.xml, as that is where the CMP descriptor was mapped to in the generated +jar.

      + +

      There are a few problems with this scheme. It does not allow for more than +one CMP descriptor to be defined in a jar and it is not compatible with the +deployment descriptors generated by some tools.

      + +

      In Ant 1.3, ejbjar parses the weblogic deployment descriptor to discover the +CMP descriptors, which are then included automatically. This behaviour is +controlled by the newCMP attribute. Note that if you move to the new method of +determining CMP descriptors, you will need to update your weblogic deployment +descriptor's <type-storage> element. In the above example, you would +define this as META-INF/Customer-weblogic-cmp-rdbms-jar.xml.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired
      destdirThe base directory into which the generated weblogic ready + jar files are deposited. Jar files are deposited in + directories corresponding to their location within the + descriptordir namespace. Yes
      genericjarsuffixA generic jar is generated as an intermediate step in + build the weblogic deployment jar. The suffix used to + generate the generic jar file is not particularly + important unless it is desired to keep the generic + jar file. It should not, however, be the same + as the suffix setting.No, defaults to '-generic.jar'.
      suffixString value appended to the basename of the deployment + descriptor to create the filename of the WebLogic EJB + jar file.No, defaults to '.jar'.
      classpathThe classpath to be used when running the weblogic ejbc + tool. Note that this tool typically requires the classes + that make up the bean to be available on the classpath. + Currently, however, this will cause the ejbc tool to be + run in a separate VMNo
      wlclasspathWeblogic 6.0 will give a warning if the home and remote interfaces + of a bean are on the system classpath used to run weblogic.ejbc. + In that case, the standard weblogic classes should be set with + this attribute (or equivalent nested element) and the + home and remote interfaces located with the standard classpath + attributeNo
      keepgenericThis controls whether the generic file used as input to + ejbc is retained.No, defaults to false
      compilerThis allows for the selection of a different compiler + to be used for the compilation of the generated Java + files. This could be set, for example, to Jikes to + compile with the Jikes compiler.No
      rebuildThis flag controls whether weblogic.ejbc is always + invoked to build the jar file. In certain circumstances, + such as when only a bean class has been changed, the jar + can be generated by merely replacing the changed classes + and not rerunning ejbc. Setting this to false will reduce + the time to run ejbjar. + No, defaults to true.
      keepgeneratedControls whether weblogic will keep the generated Java + files used to build the class files added to the + jar. This can be useful when debugging + No, defaults to false.
      argsAny additional arguments to be passed to the weblogic.ejbc + tool. + No.
      weblogicdtdDeprecated. Defines the location of the ejb-jar DTD in + the weblogic class hierarchy. This should not be necessary if you + have weblogic in your classpath. If you do not, you should use a + nested <dtd> element, described above. If you do choose + to use an attribute, you should use the ejbdtd attribute in + preference to this one, anyway. + No.
      wldtdDeprecated. Defines the location of the weblogic-ejb-jar + DTD which covers the Weblogic specific deployment descriptors. + This should not be necessary if you have weblogic in your + classpath. If you do not, you should use a nested <dtd> + element, described above. + No.
      ejbdtdDeprecated. Defines the location of the ejb-jar DTD in + the weblogic class hierarchy. This should not be necessary if you + have weblogic in your classpath. If you do not, you should use a + nested <dtd> element, described above. + No.
      newCMPIf this is set to true, the ne wmethod for locating + CMP descriptors will be used.No. Defaults to false
      oldCMPDeprecated This is an antonym for newCMP which should be used instead.No.
      + +

      The weblogic nested element itself supports two nested elements <classpath> and +<wlclasspath> which are used to set the respective classpaths. These nested elements +are useful when setting up class paths using reference Ids.

      + +

      TOPLink for Weblogic element

      + +

      The TopLink element is used to handle beans which use Toplink for the CMP operations. It +is derived from the standard weblogic element so it supports the same set of attributes please these +additional attributes

      + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired
      toplinkdescriptorThis specifies the name of the TOPLink deployment descriptor file contained in the + 'descriptordir' directory.Yes
      toplinkdtdThis specifies the location of the TOPLink DTD file. This can be a file path or + a file URL. This attribute is not required, but using a local DTD is recommended.No, defaults to dtd file at www.objectpeople.com.
      + + +

      Examples

      + +

      This example shows ejbjar being used to generate deployment jars using a +Weblogic EJB container. This example requires the naming standard to be used for +the deployment descriptors. Using this format will create a ejb jar file for +each variation of '*-ejb-jar.xml' that is found in the deployment descriptor +directory.

      + +
      +    <ejbjar srcdir="${build.classes}"
      +            descriptordir="${descriptor.dir}">
      +      <weblogic destdir="${deploymentjars.dir}"
      +                classpath="${descriptorbuild.classpath}"/>
      +      <include name="**/*-ejb-jar.xml"/>
      +      <exclude name="**/*weblogic*.xml"/>
      +    </ejbjar>
      +
      + +

      If weblogic is not in the Ant classpath, the following example +shows how to specify the location of the weblogic DTDs. This +example also show the use of a nested classpath element.

      + +
      +    <ejbjar descriptordir="${src.dir}" srcdir="${build.classes}">
      +       <weblogic destdir="${deployment.webshop.dir}" 
      +                 keepgeneric="true"
      +                 args="-g -keepgenerated ${ejbc.compiler}"
      +                 suffix=".jar"
      +                 oldCMP="false">
      +         <classpath>
      +           <pathelement path="${descriptorbuild.classpath}"/>
      +         </classpath>
      +       </weblogic>
      +       <include name="**/*-ejb-jar.xml"/> 
      +       <exclude name="**/*-weblogic-ejb-jar.xml"/>
      +       <dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
      +            location="${weblogic.home}/classes/weblogic/ejb/deployment/xml/ejb-jar.dtd"/>
      +       <dtd publicId="-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN"
      +            location="${weblogic.home}/classes/weblogic/ejb/deployment/xml/weblogic-ejb-jar.dtd"/>
      +    </ejbjar>
      +
      + + +

      This example shows ejbjar being used to generate a single deployment jar +using a Weblogic EJB container. This example does not require the deployment +descriptors to use the naming standard. This will create only one ejb jar file - +'TheEJBJar.jar'.

      + + +
      +    <ejbjar srcdir="${build.classes}"
      +            descriptordir="${descriptor.dir}"
      +            basejarname="TheEJBJar">
      +      <weblogic destdir="${deploymentjars.dir}"
      +                classpath="${descriptorbuild.classpath}"/>
      +      <include name="**/ejb-jar.xml"/>
      +      <exclude name="**/weblogic*.xml"/>
      +    </ejbjar>
      +
      + +

      This example shows ejbjar being used to generate deployment jars for a TOPLink-enabled entity bean using a +Weblogic EJB container. This example does not require the deployment descriptors to use the naming standard. +This will create only one TOPLink-enabled ejb jar file - 'Address.jar'.

      + +
      +    <ejbjar srcdir="${build.dir}"
      +            destdir="${solant.ejb.dir}"
      +            descriptordir="${descriptor.dir}"
      +            basejarname="Address">
      +            <weblogictoplink destdir="${solant.ejb.dir}"
      +                    classpath="${java.class.path}"
      +                    keepgeneric="false"
      +                    toplinkdescriptor="Address.xml"
      +                    toplinkdtd="file:///dtdfiles/toplink-cmp_2_5_1.dtd"
      +                    suffix=".jar"/>
      +            <include name="**/ejb-jar.xml"/>
      +            <exclude name="**/weblogic-ejb-jar.xml"/>
      +    </ejbjar>
      +
      + +

      This final example shows how you would set-up ejbjar under Weblogic 6.0. It also shows the use of the +<support> element to add support files + +

      +    <ejbjar descriptordir="${dd.dir}" srcdir="${build.classes.server}">
      +       <include name="**/*-ejb-jar.xml"/> 
      +       <exclude name="**/*-weblogic-ejb-jar.xml"/>
      +       <support dir="${build.classes.server}">
      +            <include name="**/*.class"/> 
      +       </support>
      +       <weblogic destdir="${deployment.dir}" 
      +                 keepgeneric="true"
      +                 suffix=".jar"
      +                 rebuild="false">
      +         <classpath>
      +            <pathelement path="${build.classes.server}"/>
      +         </classpath>
      +         <wlclasspath>
      +            <pathelement path="${weblogic.classes}"/>
      +         </wlclasspath>
      +       </weblogic>
      +    </ejbjar>
      +
      + + + + + + + diff --git a/docs/manual/OptionalTasks/ftp.html b/docs/manual/OptionalTasks/ftp.html new file mode 100644 index 000000000..d6e04b9de --- /dev/null +++ b/docs/manual/OptionalTasks/ftp.html @@ -0,0 +1,224 @@ + + + + +Ant User Manual + + + + +

      FTP

      +

      Description

      +

      Note: The ftp-task uses the NetComponents-Package which you will need to download from +http://www.savarese.org and add to your classpath.

      +

      The ftp task implements a basic FTP client that can send, receive, +list, and delete files. See below for descriptions and examples of how +to perform each task.

      +

      The ftp task makes no attempt to determine what file system syntax is +required by the remote server, and defaults to Unix standards. +remotedir must be specified in the exact syntax required by the ftp +server. If the usual Unix conventions are not supported by the server, +separator can be used to set the file separator that should be used +instead.

      +

      See the section on directory based +tasks, on how the inclusion/exclusion of files works, and how to +write patterns.

      +

      Parameters

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired
      serverthe address of the remote ftp server.Yes
      portthe port number of the remote ftp server. + Defaults to port 21.No
      useridthe login id to use on the ftp server.Yes
      passwordthe login password to use on the ftp server.Yes
      remotedirthe directory to which to upload files on the + ftp server.No
      actionthe ftp action to perform, defaulting to "send". + Currently supports "put", "get", + "del", and "list".No
      binaryselects binary-mode ("yes") or text-mode + ("no") transfers. + Defaults to "yes"No
      passiveselects passive-mode ("yes") transfers. + Defaults to "no"No
      verbosedisplays information on each file transferred if set + to "yes". Defaults to "no".No
      dependstransfers only new or changed files if set to + "yes". Defaults to "no".No
      newera synonym for depends.No
      separatorsets the file separator used on the ftp server. + Defaults to "/".No
      listingthe file to write results of the "list" action. + Required for the "list" action, ignored otherwise.No
      +

      Sending Files

      +

      The easiest way to describe how to send files is with a couple of examples:

      +
      +  <ftp server="ftp.apache.org"
      +       userid="anonymous"
      +       password="me@myorg.com">
      +    <fileset dir="htdocs/manual"/>
      +  </ftp>
      +
      +

      Logs in to ftp.apache.org as anonymous and +uploads all files in the htdocs/manual directory +to the default directory for that user.

      +
        <ftp server="ftp.apache.org"
      +       remotedir="incoming"
      +       userid="anonymous"
      +       password="me@myorg.com"
      +       depends="yes"
      +  >
      +    <fileset dir="htdocs/manual"/>
      +  </ftp>
      +

      Logs in to ftp.apache.org as anonymous and +uploads all new or changed files in the htdocs/manual directory +to the incoming directory relative to the default directory +for anonymous.

      +
        <ftp server="ftp.apache.org"
      +       port="2121"
      +       remotedir="/pub/incoming"
      +       userid="coder"
      +       password="java1"
      +       depends="yes"
      +       binary="no"
      +  >
      +    <fileset dir="htdocs/manual">
      +      <include name="**/*.html"/>
      +    </fileset>
      +  </ftp>
      +

      Logs in to ftp.apache.org at port 2121 as +coder with password java1 and uploads all new or +changed HTML files in the htdocs/manual directory to the +/pub/incoming directory. The files are transferred in text mode. Passive mode has been switched on to send files from behind a firewall.

      +
        <ftp server="ftp.nt.org"
      +       remotedir="c:\uploads"
      +       userid="coder"
      +       password="java1"
      +       separator="\"
      +       verbose="yes"
      +
      +  >
      +    <fileset dir="htdocs/manual">
      +      <include name="**/*.html"/>
      +    </fileset>
      +  </ftp>

      Logs in to the Windows-based ftp.nt.org as +coder with password java1 and uploads all +HTML files in the htdocs/manual directory to the +c:\uploads directory. Progress messages are displayed as each +file is uploaded.

      +

      Getting Files

      +

      Getting files from an FTP server works pretty much the same way as +sending them does. The only difference is that the nested filesets +use the remotedir attribute as the base directory for the files on the +FTP server, and the dir attribute as the local directory to put the files +into. The file structure from the FTP site is preserved on the local machine.

      +
      +  <ftp action="get"
      +       server="ftp.apache.org"
      +       userid="anonymous"
      +       password="me@myorg.com">
      +    <fileset dir="htdocs/manual" >
      +      <include name="**/*.html"/>
      +    </fileset>
      +  </ftp>
      +
      +

      Logs in to ftp.apache.org as anonymous and +recursively downloads all .html files from default directory for that user +into the htdocs/manual directory on the local machine.

      +

      Deleting Files

      +As you've probably guessed by now, you use nested fileset elements to +select the files to delete from the remote FTP server. Again, the +filesets are relative to the remote directory, not a local directory. In +fact, the dir attribute of the fileset is ignored completely. +
      +  <ftp action="del"
      +       server="ftp.apache.org"
      +       userid="anonymous"
      +       password="me@myorg.com" >
      +    <fileset>
      +      <include name="**/*.tmp"/>
      +    </fileset>
      +  </ftp>
      +
      +

      Logs in to ftp.apache.org as anonymous and +tries to delete all *.tmp files from the default directory for that user. +If you don't have permission to delete a file, a BuildException is thrown.

      +

      Listing Files

      +
      +  <ftp action="list"
      +       server="ftp.apache.org"
      +       userid=quot;anonymous"
      +       password="me@myorg.com" 
      +       listing="data/ftp.listing" >
      +    <fileset>
      +      <include name="**"/>
      +    </fileset>
      +  </ftp>
      +
      +

      This provides a file listing in data/ftp.listing of all the files on +the FTP server relative to the default directory of the anonymous +user. The listing is in whatever format the FTP server normally lists files.

      +
      +

      Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

      + + + + diff --git a/docs/javacc.html b/docs/manual/OptionalTasks/javacc.html similarity index 96% rename from docs/javacc.html rename to docs/manual/OptionalTasks/javacc.html index 511dd343c..4a04afd74 100644 --- a/docs/javacc.html +++ b/docs/manual/OptionalTasks/javacc.html @@ -10,7 +10,7 @@

      JavaCC

      Description

      - Invokes the JavaCC compiler + Invokes the JavaCC compiler compiler on a grammar file.

      @@ -172,3 +172,11 @@


      +

      Copyright © 2000,2001 Apache Software Foundation. +All rights +Reserved.

      + + + + + diff --git a/docs/manual/OptionalTasks/jjtree.html b/docs/manual/OptionalTasks/jjtree.html new file mode 100644 index 000000000..4e76e9c8d --- /dev/null +++ b/docs/manual/OptionalTasks/jjtree.html @@ -0,0 +1,178 @@ + + + + + + JJTree Task + + + +

      +JJTree

      + +

      +Description

      +Invokes the JJTree preprocessor +for the JavaCC compiler compiler. It inserts parse tree building actions +at various places in the JavaCC source that it generates. The output of +JJTree is run through JavaCC to create the parser. +

      To use the jjtree task, set the target attribute to the name +of the jjtree grammar file to process. You also need to specify the directory +containing the JavaCC installation using the javacchome attribute, +so that ant can find the JavaCC classes. Optionally, you can also set the +outputdirectory +to write the generated file to a specific directory. Otherwise jjtree writes +the generated JavaCC grammar file to the directory containing the JJTree +grammar file. +

      This task only invokes JJTree if the grammar file is newer than the +generated JavaCC file. +

      +Parameters

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      AttributeDescriptionRequired
      targetThe jjtree grammar file to process.Yes
      javacchomeThe directory containing the JavaCC distribution.Yes
      outputdirectoryThe directory to write the generated file to. If not set, +the files are written to the directory containing the grammar file. No
      buildnodefilesSets the BUILD_NODE_FILES grammar option. This is a boolean +option.No
      multiSets the MULTI grammar option. This is a boolean option.No
      nodedefaultvoidSets the NODE_DEFAULT_VOID grammar option. This is a boolean +option.No
      nodefactorySets the NODE_FACTORY grammar option. This is boolean option.No
      nodescopehookSets the NODE_SCOPE_HOOK grammar option. This is a boolean +option.No
      nodeusesparserSets the NODE_USES_PARSER grammar option. This is a boolean +option.No
      staticSets the STATIC grammar option. This is a boolean option.No
      visitorSets the VISITOR grammar option. This is a boolean option.No
      nodepackageSets the NODE_PACKAGE grammar option. This is a string option.No
      visitorexceptionSets the VISITOR_EXCEPTION grammar option. This is a string +option.No
      nodeprefixSets the NODE_PREFIX grammar option. This is a string option.No
      + +

      +Example

      + +
      +
      <jjtree 
      +    target="src/Parser.jjt" 
      +    outputdirectory="build/src"
      +    javacchome="c:/program files/JavaCC" 
      +    nodeusesparser="true"
      +/>
      +
      +This invokes JJTree on grammar file src/Parser.jjt, writing the generated +grammar file, Parser.jj, file to build/src. The grammar option NODE_USES_PARSER +is set to true when invoking JJTree. +
      +
      + + + diff --git a/docs/jlink.html b/docs/manual/OptionalTasks/jlink.html similarity index 96% rename from docs/jlink.html rename to docs/manual/OptionalTasks/jlink.html index 7da42aabe..ce26a07a1 100644 --- a/docs/jlink.html +++ b/docs/manual/OptionalTasks/jlink.html @@ -54,7 +54,7 @@ The exclude or excludesfile attribute is used to specify the files you want to have excluded. This is also done with patterns. And finally with the defaultexcludes attribute, you can specify whether you want to use default exclusions or not. See the section on directory based tasks, on how the +href="../dirtasks.html#directorybasedtasks">directory based tasks, on how the inclusion/exclusion of files works, and how to write patterns. The patterns are relative to the base directory.

      @@ -83,7 +83,7 @@ relative to the base directory.

      mergefiles files to be merged into the output, if possible. - At least one of + At least one of mergefiles or addfiles diff --git a/docs/junit.html b/docs/manual/OptionalTasks/junit.html similarity index 93% rename from docs/junit.html rename to docs/manual/OptionalTasks/junit.html index 17c8a705d..b5efdf836 100644 --- a/docs/junit.html +++ b/docs/manual/OptionalTasks/junit.html @@ -75,38 +75,40 @@ elements.

      Nested Elements

      junit supports a nested <classpath> -element, that represents a PATH like +element, that represents a PATH like structure.

      jvmarg

      If fork is enabled, additional parameters may be passed to the new -VM via nested <jvmarg> attributes, for example:

      +VM via nested <jvmarg> attributes, for example: -
      +
       <junit fork="yes">
         <jvmarg value="-Djava.compiler=NONE"/>
         ...
       </junit>
      -
      +
      + would run the test in a VM without JIT.

      <jvmarg> allows all attributes described in Command line arguments.

      +href="../using.html#arg">Command line arguments.

      sysproperty

      Use nested <sysproperty> elements to specify system properties required by the class. These properties will be made available to the VM during the execution of the test (either ANT's VM or the forked VM). -The attributes for this element are the same as for environment variables. +The attributes for this element are the same as for environment variables. -

      +
       <junit fork="no">
         <sysproperty key="basedir" value="${basedir}"/>
         ...
       </junit>
      -
      +
+ would run the test in ANT's VM and make the basedir property available to the test.

@@ -221,7 +223,7 @@ can be specified.

batchtest collects the included files from any number of nested <fileset>s. It then +href="../CoreTypes/fileset.html"><fileset>s. It then generates a test class name for each file that ends in .java or .class.

@@ -271,29 +273,30 @@ generates a test class name for each file that ends in <formatter> elements.

Examples

-
+ +

 <junit>
   <test name="my.test.TestCase" />
 </junit>
-
+
-

Runs the test defined in my.test.TestCase in the same +Runs the test defined in my.test.TestCase in the same VM. No output will be generated unless the test fails.

-
+

 <junit printsummary="yes" fork="yes" haltonfailure="yes">
   <formatter type="plain" />
   <test name="my.test.TestCase" />
 </junit>
-
+
-

Runs the test defined in my.test.TestCase in a +Runs the test defined in my.test.TestCase in a separate VM. At the end of the test a single line summary will be printed. A detailed report of the test can be found in TEST-my.test.TestCase.txt. The build process will be stopped if the test fails.

-
+

 <junit printsummary="yes" haltonfailure="yes">
   <classpath>
     <pathelement location="${build.tests}" />
@@ -309,13 +312,13 @@ stopped if the test fails.

<batchtest fork="yes" todir="${reports.tests}"> <fileset dir="${src.tests}"> <include name="**/*Test*.java" /> - <exclude name="**/AllTests.java" /< + <exclude name="**/AllTests.java" /> </fileset> </batchtest> </junit> -
+
-

Runs my.test.TestCase in the same VM (ignoring the +Runs my.test.TestCase in the same VM (ignoring the given CLASSPATH), only a warning is printed if this test fails. In addition to the plain text test results, for this test a XML result will be output to result.xml.

diff --git a/docs/manual/OptionalTasks/junitreport.html b/docs/manual/OptionalTasks/junitreport.html new file mode 100644 index 000000000..435dc90b4 --- /dev/null +++ b/docs/manual/OptionalTasks/junitreport.html @@ -0,0 +1,118 @@ + + +JUnitReport + + + + +

JUnitReport

+Merge the individual XML files generated by the JUnit task and eventually apply +a stylesheet on the resulting merged document to provide a browsable report of +the testcases results. +

Requirements

+

You need  Xalan 1 to use this +task or use the Xalan1 compatibility jar of Xalan2.

+

Parameters

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
tofileThe name of the XML file that will aggregate all individual + XML testsuite previously generated by the JUnit task.No. Default to TESTS-TestSuites.xml
todirThe directory where should be written the file resulting + from the individual XML testsuite aggregation.No. Default to current directory
+

Nested Elements

+

fileset

+

junitreport collects individual xml files generated by the JUnit +task using the nested <FileSet> +element.

+

report

+

Generate a browsable report based on the document created by the merge.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
formatThe format of the generated report. Must be "noframes" + or "frames".No, default to "frames"
styledirThe directory where the stylesheets are defined. They must + be conforming to the following conventions: +

For the noframes format, only the stylesheet overview-summary.xsl is + used.

+

For the frames format, the result will be javadoc-like. List of package + will be in top left frame, the list of classes in bottom left frame and + the details/summary in the main window.  It uses the following XSLs:

+
    +
  • all-packages.xsl - creates an all-packages.html file that + contains the list of all packages (top-left frame) with links to their + corresponding package-summary.html files in their respective + location (package name matches path name)
  • +
  • all-classes.xsl - creates an all-classes.html file that contains the + whole list of classes in all packages with links to their + corresponding <classname>-details.html in their + respective package directory.
  • +
  • overview-packages.xsl - creates an overview-packages.html + that makes a summary of all packages and classes not belonging to a + package.
  • +
  • class-details.xsl - creates a detailed page about the testcases of a + testsuite. This this xsl will be applied on all testsuites and written + to the <classname>-details.html file located in their + respective package directory.
  • +
  • package-summary.xsl - create a testsuite summary for a package. This + will be written to package-summary.html in its corresponding package + directory.
  • +
  • classes-list.xsl - creates the list of classes belonging to a + specific package. This will be written to classes-list.html  in + its corresponding package directory.
  • +
+
No. Default to embedded stylesheets.
todirThe directory where the files resulting from the + transformation should be written to.No. Default to current directory
extensionThe extension of the generated files, they must include the + dot (ex: .html)No. Default to .html
+

Example of report

+
+
<junitreport todir="./reports">
+  <fileset dir="./reports">
+    <include name="TEST-*.xml"/>
+  </fileset>
+  <report format="frames" todir="./report/html"/>
+</junitreport>
+
+
+

would generate a TESTS-TestSuites.xml file in the directory reports and +generate the default framed report in the directory report/html.

+ + + + diff --git a/docs/manual/OptionalTasks/mparse.html b/docs/manual/OptionalTasks/mparse.html new file mode 100644 index 000000000..0ee403cf3 --- /dev/null +++ b/docs/manual/OptionalTasks/mparse.html @@ -0,0 +1,83 @@ + + + + +JavaCC Task + + + + +

MParse

+

Requirements

+

This task requires Metamata Development environment 1.1. It does not work as +is with the latest 2.0 version freely available at Metamata.

+

Description

+

+ Invokes the Metamata MParse compiler + compiler on a grammar file. +

+

+ To use the mparse task, set the target attribute to the name of the + grammar file to process. You also need to specify the directory containing + the Metamata installation using the metamatahome attribute, so that Ant + can find the MParse classes. +

+

+ This task only invokes MParse if the grammar file is newer than the generated + Java files. MParse assumes that the Java class name of the generated parser + is the same as the name of the grammar file, less the .jj extension. +

+ +

For additional information about MParse, please consult the online manual available here +(PDF) +

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
targetThe .jj grammar file to process. It will only be processed + if the grammar is newer than the corresponding .java file.Yes
metamatahomeThe home directory containing the Metamata distribution.Yes
workingdir + The temporary directory used by MParse. + Yes
cleanuphackRemove the stale file as well as the intermediate Sun + JavaCC file created during the transformation of the grammar file.No. Default to false.
+

Nested elements

+

userclasspath

+

 The userclasspath element is required and represents a PATH like +structure.

+

Example

+
  <mparse target="src/Parser.jj" metamatahome="c:/metamata" workingdir="c:/tmp">
+    <userclasspath>
+      <pathelement location="./lib/dependency.jar"/>
+    </userclasspath>
+  </mparse>
+

+ This invokes Metamata MParse installed in c:/metamata on a grammar file src/Parser.jj +with a working directory in c:/tmp and a specific classpath +

+
+ + diff --git a/docs/native2ascii.html b/docs/manual/OptionalTasks/native2ascii.html similarity index 92% rename from docs/native2ascii.html rename to docs/manual/OptionalTasks/native2ascii.html index e711b627e..816fa54c9 100644 --- a/docs/native2ascii.html +++ b/docs/manual/OptionalTasks/native2ascii.html @@ -19,32 +19,32 @@ includes and excludes attributes. For more information on file matching patterns, see the section on - directory based tasks. + directory based tasks. If no encoding is specified, the default encoding for the JVM is used. If ext is specified, then output files are renamed to use it as a new extension. More sophisticated file name translations can be achieved using a nested <mapper> element. By default an - identity mapper will be used. + identity mapper will be used. If dest and src point to the same directory, the ext attribute or a nested <mapper> is required.

- This task forms an implicit File Set, + This task forms an implicit File Set, and supports all attributes of <fileset> (dir becomes src) as well as nested <include>, <exclude>, and <patternset> elements.

- +
- + diff --git a/docs/manual/OptionalTasks/netrexxc.html b/docs/manual/OptionalTasks/netrexxc.html new file mode 100644 index 000000000..cc4530d9d --- /dev/null +++ b/docs/manual/OptionalTasks/netrexxc.html @@ -0,0 +1,277 @@ + + + + +Ant User Manual + + + + +

NetRexxC

+

Description

+

Compiles a NetRexx +source tree within the running (Ant) VM.

+

The source and destination directory will be recursively scanned for +NetRexx source files to compile. Only NetRexx files that have no corresponding +class file or where the class file is older than the java file will be compiled.

+

Files in the source tree are copied to the destination directory, +allowing support files to be located properly in the classpath. The source +files are copied because the NetRexx compiler cannot produce class files in a +specific directory via parameters

+

The directory structure of the source tree should follow the package +hierarchy.

+

It is possible to refine the set of files that are being compiled/copied. +This can be done with the includes, includesfile, excludes, excludesfile and +defaultexcludes attributes. With the includes or includesfile attribute you +specify the files you want to have included by using patterns. The +exclude or excludesfile attribute is used to specify the files you want to have +excluded. This is also done with patterns. And finally with the +defaultexcludes attribute, you can specify whether you +want to use default exclusions or not. See the section on directory based tasks, on how the +inclusion/exclusion of files works, and how to write patterns.

+

This task forms an implicit FileSet and +supports all attributes of <fileset> +(dir becomes srcdir) as well as the nested +<include>, <exclude> and +<patternset> elements.

+ +

Parameters

+
Attribute DescriptionRequiredRequired
reverse
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
binaryWhether literals are treated as the java binary + type rather than the NetRexx typesNo
classpathThe classpath to use during compilationNo
commentsWhether comments are passed through to the + generated java sourceNo
compactWhether error messages come out in compact or + verbose formatNo
compileWhether the NetRexx compiler should compile the + generated java codeNo
consoleWhether or not messages should be displayed on the + 'console'No
crossrefWhether variable cross references are generatedNo
decimalWhether decimal arithmetic should be used for the + NetRexx codeNo
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when + omitted.No
destDirthe destination directory into which the NetRexx + source files should be copied and then compiledYes
diagWhether diagnostic information about the compile is + generatedNo
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when + omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
explicitWhether variables must be declared explicitly + before useNo
formatWhether the generated java code is formatted nicely + or left to match NetRexx line numbers for call stack debuggingNo
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
javaWhether the generated java code is producedNo
keepSets whether the generated java source file should be kept + after compilation. The generated files will have an extension of + .java.keep, not .javaNo
logoWhether the compiler text logo is displayed when + compilingNo
replaceWhether the generated .java file should be replaced + when compilingNo
savelogWhether the compiler messages will be written to + NetRexxC.log as well as to the consoleNo
sourcedirTells the NetRexx compiler to store the class files in the + same directory as the source files. The alternative is the working + directoryNo
srcDirSet the source dir to find the source NetRexx + filesYes
strictargsTells the NetRexx compiler that method calls always + need parentheses, even if no arguments are needed, e.g. + aStringVar.getBytes vs. + aStringVar.getBytes()No
strictassignTells the NetRexx compile that assignments must + match exactly on typeNo
strictcaseSpecifies whether the NetRexx compiler should be + case sensitive or notNo
strictimportWhether classes need to be imported explicitly using an + import statement. By default the NetRexx compiler will + import certain packages automaticallyNo
strictpropsWhether local properties need to be qualified + explicitly using thisNo
strictsignalWhether the compiler should force catching of + exceptions by explicitly named typesNo
symbolsWhether debug symbols should be generated into the + class fileNo
timeAsks the NetRexx compiler to print compilation + times to the consoleNo
traceTurns on or off tracing and directs the resultant + trace outputNo
utf8Tells the NetRexx compiler that the source is in UTF8No
verboseWhether lots of warnings and error messages should + be generatedYes
+

Examples

+
+

<netrexxc srcDir="/source/project" + includes="vnr/util/*" + destDir="/source/project/build" + classpath="/source/project2/proj.jar" + comments="true" + crossref="false" replace="true" + keep="true"/> +

+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/perforce.html b/docs/manual/OptionalTasks/perforce.html similarity index 92% rename from docs/perforce.html rename to docs/manual/OptionalTasks/perforce.html index 11b68fa6a..ba66244e3 100644 --- a/docs/perforce.html +++ b/docs/manual/OptionalTasks/perforce.html @@ -18,14 +18,14 @@

Introduction

-

These tasks provide an interface to the Perforce SCM. +

These tasks provide an interface to the Perforce SCM. The org.apache.tools.ant.taskdefs.optional.perforce package consists of a simple framework to support p4 functionality as well as some Ant tasks encapsulating frequently used (by me :-) p4 commands. However, the addition of new p4 commands is a pretty simple task (see the source). Although it is possible to use these commands on the desktop, they were primarily intended to be used by automated build systems.

-

Note: These tasks require the oro 2.0 regular +

Note: These tasks require the oro 2.0 regular expression package. Simply download this package and copy the jakarta-oro-2.0.jar file into Ant's lib directory. You will also need the perforce client executable (p4 or p4.exe but not p4win.exe) in your path.

@@ -33,7 +33,7 @@ You will also need the perforce client executable (p4 or p4.exe but not p4win.ex

The Tasks

-
    + @@ -42,21 +42,24 @@ You will also need the perforce client executable (p4 or p4.exe but not p4win.ex + + + +
    P4Sync
    P4Change Request a new changelist from the perforce server
    P4Edit Open files for edit (checkout)
    P4Submit Submit a changelist to the perforce server (checkin)
    P4Have List current files in client view, useful for reporting
    P4Label Create a label reflecting files in the current workspace
    -

General P4 Properties

Each p4 task requires a number of settings, either through build-wide properties, individual attributes @@ -107,9 +110,9 @@ Your local installation of perforce may require other settings (e.g. P4PASSWD,

Examples

Setting in the environment:-

-(Unix csh) +(Unix csh)

setenv P4PORT myperforcebox:1666
-(Unix sh et al) +

(Unix sh et al)

P4USER=myp4userid; export P4USER

Using build properties:-

<property name="p4.client" value="nightlybuild"/>
@@ -124,14 +127,14 @@ Your local installation of perforce may require other settings (e.g. P4PASSWD, . />
-

+

For more information regarding the underlying 'p4' commands you are referred to the Perforce Command Reference -available from the Perforce website. +available from the Perforce website.

Taskdefs

-

Standard taskdefs (for you to copy'n'paste) +

Standard taskdefs (for you to copy'n'paste)

     <taskdef name="p4sync" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Sync" />
     <taskdef name="p4change" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Change" />
@@ -143,10 +146,10 @@ available from the Perforce website.
 
 

Task Descriptions

-

P4Sync

+

P4Sync

Description:

-

Synchronise the current workspace with the depot.

-

+

Synchronize the current workspace with the depot.

+

Parameters

@@ -174,7 +177,7 @@ available from the Perforce website. -

P4Change

+

P4Change

Description:

Request a new changelist from the perforce server. This task sets the ${p4.change} property which can then be passed to P4Submit or P4Edit. @@ -201,7 +204,7 @@ This task sets the ${p4.change} property which can then be passed to P4Submit or -

P4Edit

+

P4Edit

Description:

Open file(s) for edit. P4Change should be used to obtain a new changelist for P4Edit as, although P4Edit can open files to the default change, P4Submit cannot yet submit it. @@ -237,7 +240,7 @@ although P4Edit can open files to the default change, P4Submit cannot yet submi -

P4Submit

+

P4Submit

Description:

Submit a changelist, usually obtained from P4Change.

@@ -263,7 +266,7 @@ although P4Edit can open files to the default change, P4Submit cannot yet submi -

P4Have

+

P4Have

Description:

List handy file info reflecting the current client contents.

@@ -289,7 +292,7 @@ although P4Edit can open files to the default change, P4Submit cannot yet submi -

P4Label

+

P4Label

Description:

Create a new label and set contents to reflect current client file revisions.

@@ -329,18 +332,18 @@ although P4Edit can open files to the default change, P4Submit cannot yet submi
-

Change History

+

Change History

- - diff --git a/docs/propertyfile.html b/docs/manual/OptionalTasks/propertyfile.html similarity index 60% rename from docs/propertyfile.html rename to docs/manual/OptionalTasks/propertyfile.html index 37bab1d42..786f37fb0 100644 --- a/docs/propertyfile.html +++ b/docs/manual/OptionalTasks/propertyfile.html @@ -1,3 +1,4 @@ +Ant PropertyFile Task @@ -20,19 +21,19 @@

Introduction

-

Ant provides an optional task for editing property files. Thes is very useful +

Ant provides an optional task for editing property files. This is very useful when wanting to make unattended modifications to configuration files for application servers and applications. Currently, the task maintains a working property file with the ability to add properties or make changes to existing ones. However, any comments -are lost. Work is being done to make this task a bit more "human friendly". +are lost. Work is being done to make this task a bit more "human friendly".


-

PropertyFile Task

+

PropertyFile Task

Parameters

Sept 2000 --Internal Release within Rubus + Internal Release within Rubus
Nov 2000 V1.0Initial Release donated to ASF :-) + Initial Release donated to ASF :-)
Jan 2001
@@ -53,9 +54,9 @@ are lost. Work is being done to make this task a bit more "human friendly".

Parameters specified as nested elements

-

Entry

+

Entry

Use nested <entry> -elements to specify actual modifcations to the property file itself +elements to specify actual modifcations to the property file itself

@@ -79,7 +80,7 @@ elements to specify actual modifcations to the property file itself - @@ -87,68 +88,69 @@ elements to specify actual modifcations to the property file itself + For type date, two additional keywords are allowed: "now" or "never". + be parsed and formatted accordingly.
Attribute
operation"+" or "=" (default) for all datatypes
"-" (for date and int only).
+
"+" or "=" (default) for all datatypes
"-" (for date and int only).
No
default Initial value to set for a property if it is not already defined in the property file.
- For type date, two additional keywordsw are allowed: "now" or "never".
No
pattern For int and date type only. If present, Values will - be paresed and formated accordingly. No

Examples

-

The following changes the my.properties file. Assume my.properties look like:
-

-

    # A comment
    -akey=novalue
+

The following changes the my.properties file. Assume my.properties look like:

+ +
# A comment
+akey=novalue
+ +

After running, the file would now look like

-After running, the file would now look like +
#Thu Nov 02 23:41:47 EST 2000
+akey=avalue
+adate=2000/11/02 23\:41
+anint=1
+formated.int=0014
+formated.date=028 17\:34
+

-

    #Thu Nov 02 23:41:47 EST 2000
    -akey=avalue
    -adate=2000/11/02 23\:41
    -anint=1
    -formated.int=0014
    -formated.date=028 17\:34
-

The slashes conform to the expectations of the Properties class. The file will be stored in a manner so that each character is examined and escaped if necessary. Note that the original comment is now lost. Please keep this in mind when running this task against heavily commented properties files. It may be best to have a commented version in the source tree, copy it to a deployment area, and then run the modifications on the copy. Future versions of PropertyFile will hopefully eliminate this shortcoming.

-
<propertyfile - file="my.properties" - comment"My properties" > - <entry key="akey" value="avalue" /> - <entry key="adate" type="date" value="now"/> - <entry key="anint" type="int" operation="+"/> - <entry key="formated.int" type="int" default="0013" operation="+" pattern="0000"/> - <entry key="formated.date" type="date" value="now" pattern="DDD HH:mm"/> +
<propertyfile
+    file="my.properties"
+    comment"My properties" >
+  <entry  key="akey" value="avalue" />
+  <entry  key="adate" type="date" value="now"/>
+  <entry  key="anint" type="int" operation="+"/>
+  <entry  key="formated.int" type="int" default="0013" operation="+" pattern="0000"/>
+  <entry  key="formated.date" type="date" value="now" pattern="DDD HH:mm"/>
 </propertyfile>
-
+

-To produce dates relative from today : -

<propertyfile - file="my.properties" - comment"My properties" > - <entry key="formated.date-1" - type="date" default="now" pattern="DDD" - operation="-" value="1"/> - <entry key="formated.tomorrow" - type="date" default="now" pattern="DDD" - operation="+" value="1"/> +To produce dates relative from today :

+
<propertyfile
+    file="my.properties"
+    comment="My properties" >
+  <entry  key="formated.date-1"
+      type="date" default="now" pattern="DDD"
+      operation="-" value="1"/>
+  <entry  key="formated.tomorrow"
+      type="date" default="now" pattern="DDD"
+      operation="+" value="1"/>
 </propertyfile>
-
-

+
+

-Concatenation of strings : -

<propertyfile - file="my.properties" - comment"My properties" > - <entry key="progress" default="" operation="+" value="."/> +Concatenation of strings :

+
<propertyfile
+    file="my.properties"
+    comment="My properties" >
+  <entry  key="progress" default="" operation="+" value="."/>
 </propertyfile>
-
-Each time called, a "." will be appended to "progress" +
+

Each time called, a "." will be appended to "progress"

diff --git a/docs/manual/OptionalTasks/renameextensions.html b/docs/manual/OptionalTasks/renameextensions.html new file mode 100644 index 000000000..430b31185 --- /dev/null +++ b/docs/manual/OptionalTasks/renameextensions.html @@ -0,0 +1,108 @@ + + + + +Ant User Manual + + + + +

RenameExtensions

+

Deprecated

+

This task has been deprecated. Use the move +task with a glob mapper instead.

+

Description

+

Renames files in the srcDir directory ending with the +fromExtension string so that they end with the +toExtension string. Files are only replaced if +replace is true +

+

See the section on +directory based tasks, on how the +inclusion/exclusion of files works, and how to write patterns. +This task forms an implicit FileSet and +supports all attributes of <fileset> +(dir becomes srcDir) as well as the nested +<include>, <exclude> and +<patternset> elements.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when + omitted.No
excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when + omitted.No
excludesfilethe name of a file. Each line of this file is + taken to be an exclude patternNo
fromExtentionThe string that files must end in to be renamedYes
includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
includesfilethe name of a file. Each line of this file is + taken to be an include patternNo
replaceWhether the file being renamed to should be + replaced if it already existsNo
srcDirThe starting directory for files to search inYes
toExtensionThe string that renamed files will end with on + completionYes
+

Examples

+
+

<renameext srcDir="/source/project1" + includes="**" + excludes="**/samples/*" + fromExtension=".java.keep" + toExtension=".java" + replace="true"/> + +

+
+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/OptionalTasks/script.html b/docs/manual/OptionalTasks/script.html new file mode 100644 index 000000000..fdb8a2602 --- /dev/null +++ b/docs/manual/OptionalTasks/script.html @@ -0,0 +1,121 @@ + + + + +Ant User Manual + + + + +

Script

+

Description

+

Execute a script in a + BSF supported language.

+

All items (tasks, targets, etc) of the running project are +accessible from the script, using either their name or +id attributes.

+

Scripts can do almost anything a task written in Java could do.

+

Parameters

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
languageThe programming language the script is written in. + Must be a supported BSF languageNo
srcThe location of the script as a file, if not inlineNo
+

Examples

+
+<project name="squares" default="main" basedir=".">
+
+  <target name="setup">
+
+    <script language="javascript"> <![CDATA[
+
+      for (i=1; i<=10; i++) {
+        echo = squares.createTask("echo");
+        main.addTask(echo);
+        echo.setMessage(i*i);
+      }
+
+    ]]> </script>
+
+  </target>
+
+  <target name="main" depends="setup"/>
+
+</project>
+
+

generates

+
+setup:
+
+main:
+1
+4
+9
+16
+25
+36
+49
+64
+81
+100
+
+BUILD SUCCESSFUL
+
+

Another example, using references by id +and two different scripting languages:

+
+<project name="testscript" default="main">
+  <target name="sub">
+    <echo id="theEcho"/>
+  </target>
+
+  <target name="sub1">
+    <script language="netrexx"><![CDATA[
+      theEcho.setMessage("In sub1")
+      sub.execute
+    ]]></script>
+  </target>
+
+  <target name="sub2">
+    <script language="javascript"><![CDATA[
+      theEcho.setMessage("In sub2");
+      sub.execute();
+    ]]></script>
+  </target>
+
+  <target name="main" depends="sub1,sub2"/>
+</project>
+
+

generates

+
+sub1:
+In sub1
+
+sub2:
+In sub2
+
+main:
+
+BUILD SUCCESSFUL
+
+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/OptionalTasks/sound.html b/docs/manual/OptionalTasks/sound.html new file mode 100644 index 000000000..1e3599772 --- /dev/null +++ b/docs/manual/OptionalTasks/sound.html @@ -0,0 +1,95 @@ + + + + +Ant User Manual + + + + +

Sound

+

Description

+

Plays a sound-file at the end of the build, according to whether +the build failed or succeeded. You can specify either a specific +sound-file to play, or, if a directory is specified, the +<sound> task will randomly select a file to play. +Note: At this point, the random selection is based on all the files +in the directory, not just those ending in appropriate suffixes +for sound-files, so be sure you only have sound-files in the +directory you specify.

+ +

Parameters

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
loopsthe number of extra times to play the sound-file; + default is 0. + No
durationthe amount of time (in milliseconds) to play + the sound-file. + No
+

+To specify the sound-files or the sound-file directories, use the +nested <success> and <fail> +elements:

+
+
+<success>     the path to a sound-file directory, or the name of a
+              specific sound-file, to be played if the build succeeded.
+<fail>        the path to a sound-file directory, or the name of a
+              specific sound-file, to be played if the build succeeded.
+
+
+ +

Examples

+
+
+<target name="fun" if="fun" unless="fun.done">
+  <sound loops="2">
+    <success source="${user.home}/sounds/bell.wav"/>
+    <fail source="${user.home}/sounds/ohno.wav"/>
+  </sound>
+  <property name="fun.done" value="true"/>
+</target>
+
+
+plays the bell.wav sound-file if the build succeeded, or +the ohno.wav sound-file if the build failed, three times, +if the fun property is set to true. +If the target +is a dependency of an "initialization" target that other +targets depend on, the +fun.done property prevents the target from being executed +more than once. +
+
+<target name="fun" if="fun" unless="fun.done">
+  <sound>
+    <success source="//intranet/sounds/success"/>
+    <fail source="//intranet/sounds/failure"/>
+  </sound>
+  <property name="fun.done" value="true"/>
+</target>
+
+
+randomly selects a sound-file to play when the build succeeds or fails. + +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/OptionalTasks/stylebook.html b/docs/manual/OptionalTasks/stylebook.html new file mode 100644 index 000000000..e1d39f23c --- /dev/null +++ b/docs/manual/OptionalTasks/stylebook.html @@ -0,0 +1,63 @@ + + + + +Ant User Manual + + + + +

Stylebook

+

Description

+

This executes the apache Stylebook documentation generator. +Unlike the commandline version of this tool, all three arguments +are required to run stylebook.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
bookthe book xml file that the documentation generation starts from + Yes
skindirectorythe directory that contains the stylebook skin + Yes
targetdirectorythe destination directory where the documentation is generated + Yes
+

+The user can also specify the nested <classpath> element which defines classpath +in which the task is executed.

+ +

Examples

+
+
+<stylebook targetdirectory="build/docs" 
+           book="src/xdocs/book.xml" 
+           skindirectory="src/skins/myskin"/>
+
+
+The above will generate documentation in build/docs starting from the book +src/xdocs/book.xml and using the skin located in directory src/skins/myskin. + +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/OptionalTasks/telnet.html b/docs/manual/OptionalTasks/telnet.html new file mode 100644 index 000000000..96337770a --- /dev/null +++ b/docs/manual/OptionalTasks/telnet.html @@ -0,0 +1,100 @@ + + + + +Ant User Manual + + + + +

Telnet

+

Description

+Task to automate a remote telnet session. The task uses nested <read> to indicate strings to wait for, and <write> tags to specify text to send. + +

If you do specify a userid and password, the system will assume a common unix prompt to wait on. This behavior can be easily over-ridden.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeValuesRequired
useridthe login id to use on the telnet server.No
passwordthe login password to use on the telnet server.No
serverthe address of the remote telnet server.Yes
portthe port number of the remote telnet server. Defaults to port 23.No
initialCRsend a cr after connecting ("yes"). Defaults to "no".No
timeoutset a default timeout to wait for a response. Specified in seconds. Default is no timeout.No
+

Examples

+A simple example of connecting to a server and running a command. This assumes a prompt of "ogin:" for the userid, and a prompt of "assword:" for the password. +
+<telnet userid="bob" password="badpass" server="localhost">
+   <read>/home/bob</read>
+   <write>ls</write>
+   <read string="/home/bob"/>
+</telnet>
+
+ +This task can be rewritten as: +
+<telnet server="localhost">
+   <read>ogin:</read>
+   <write>bob</write>
+   <read>assword:</read>
+   <write>badpass</write>
+   <read>/home/bob</read>
+   <write>ls</write>
+   <read>/home/bob</read>
+</telnet>
+
+ +A timeout can be specified at the <telnet> level or at the <read> level. This will connect, issue a sleep command that is suppressed from displaying and wait 10 seconds before quitting. +
+<telnet userid="bob" password="badpass" server="localhost" timeout="20">
+   <read>/home/bob</read>
+   <write echo="false">sleep 15</write>
+   <read timeout="10">/home/bob</read>
+</telnet>
+
+ +The task can be used with other ports as well: +
+<telnet port="80" server="localhost" timeout="20">
+   <read/>
+   <write>GET / http/0.9</write>
+   <write/>
+   <read timeout="10">&lt;/HTML&gt;</read>
+</telnet>
+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/OptionalTasks/test.html b/docs/manual/OptionalTasks/test.html new file mode 100644 index 000000000..880be1f98 --- /dev/null +++ b/docs/manual/OptionalTasks/test.html @@ -0,0 +1,72 @@ + + + + +Ant User Manual + + + + +

Test

+

Description

+

This is a primitive task to execute a unit test in the org.apache.testlet framework.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
showSuccessa boolean value indicating whether tests should display a + message on success + No
showBannera boolean value indicating whether a banner should be displayed + when starting testlet engine + No
forceShowTracea boolean indicating that a stack trace is displayed on any failure + No
showTracea boolean indicating that a stack trace is displayed on + error (but not normal failure) + No
+

+The user can also specify the nested <classpath> element which defines classpath +in which the task is executed. The user also specifies a subelement per testlet executed +which has content that specifies tasklet classname.

+ +

Examples

+
+
+<test showSuccess="false" showBanner="false" showTrace="true" forceShowTrace="true">
+   <classpath refid="test.classpath"/>
+   <testlet>org.foo.MyTestlet<testlet/>
+   <testlet>org.foo.MyOtherTestlet<testlet/>
+<test/>
+
+
+The above will run the testlets org.foo.MyTestlet and org.foo.MyOtherTestlet + +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/OptionalTasks/vssget.html b/docs/manual/OptionalTasks/vssget.html new file mode 100644 index 000000000..b639c2e45 --- /dev/null +++ b/docs/manual/OptionalTasks/vssget.html @@ -0,0 +1,91 @@ + + + + +Ant User Manual + + + + +

VssGet

+

Description

+Task to perform GET commands to Microsoft Visual Source Safe. +

If you specify two or more attributes from version, date and +label only one will be used in the order version, date, label.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeValuesRequired
loginusername,passwordNo
vsspathSourceSafe pathYes
localpathOverride the working directory and get to the specified pathNo
writabletrue or falseNo
recursivetrue or falseNo
versiona version number to getNo
datea date stamp to get atNo
labela label to get forNo
ssdirdirectory where ss.exe resides. By default the + task expects it to be in the PATH.No
+

Note that only one of version, date or label should be specified

+

Examples

+
+
+<vssget localPath="C:\mysrc\myproject"
+        recursive="true" 
+        label="Release1"
+        login="me,mypassword"
+        vsspath="/source/aProject"
+        writable="true"/>
+
+
+

Does a get on the VSS-Project $/source/aproject using the username +me and the password mypassword. It will recursively get the files +which are labeled Release1 and write them to the local directory +C:\mysrc\myproject. The local files will be writable.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/coretasklist.html b/docs/manual/coretasklist.html new file mode 100644 index 000000000..92c1d6aeb --- /dev/null +++ b/docs/manual/coretasklist.html @@ -0,0 +1,70 @@ + + + + +Ant User Manual + + + + + +

Table of Contents

+ +

Concepts and Types

+Directory Based Tasks
+Patternset
+Fileset
+File Mappers
+ +

Core Tasks

+Ant
+AntCall
+AntStructure
+Apply
+Available
+Chmod
+Copy
+Copydir
+Copyfile
+Cvs
+Delete
+Deltree
+Echo
+Exec
+ExecOn
+Fail
+Filter
+FixCRLF
+GenKey
+Get
+GUnzip
+GZip
+Jar
+Java
+Javac
+Javadoc/Javadoc2
+Mail
+Mkdir
+Move
+Patch
+Property
+Rename
+Replace
+Rmic
+SignJar
+Sql
+Style
+Tar
+Taskdef
+Touch
+Tstamp
+Unjar
+Untar
+Unwar
+Unzip
+Uptodate
+War
+Zip
+ + + diff --git a/docs/manual/credits.html b/docs/manual/credits.html new file mode 100644 index 000000000..a3a7f61a0 --- /dev/null +++ b/docs/manual/credits.html @@ -0,0 +1,45 @@ + + + + +Ant User Manual + + + + +
+

Ant User Manual

+

by

+
+ + + +
+

Version: @VERSION@
+$Id$

+
+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/develop.html b/docs/manual/develop.html new file mode 100644 index 000000000..d767fa113 --- /dev/null +++ b/docs/manual/develop.html @@ -0,0 +1,204 @@ + + + + +Ant User Manual + + + +

Developing with Ant

+ +

Writing Your Own Task

+

It is very easy to write your own task:

+
    +
  1. Create a Java class that extends org.apache.tools.ant.Task.
  2. +
  3. For each attribute, write a setter method. The setter method must be a + public void method that takes a single argument. The + name of the method must begin with set, followed by the + attribute name, with the first character of the name in uppercase, and the rest in + lowercase. The type of the attribute can be: +
      +
    • +String +
    • +
    • +any primitive type (they are converted for you from their String-representation +in the buildfile) +
    • +
    • +boolean – your method will be passed the value +true if the value specified in the buildfile is one of true, +yes, or on) +
    • +
    • +Class +
    • +
    • +File +(in which case the value of the attribute is interpreted relative to the +project's basedir) +
    • +
    • +any other type that has a constructor with a single +String argument +
    • +
    +
  4. +
  5. If your task has enumerated attributes, you should consider using +a subclass of org.apache.tools.ant.types.EnumeratedAttribute +as an argument +to your setter method. See +org/apache/tools/ant/taskdefs/FixCRLF.java for +an example.
  6. +
  7. If the task should support character data, write a public void +addText(String) method.
  8. +
  9. For each nested element, write a create or add method. +A create method +must be a public method that takes no arguments and returns +an Object type. The name of the create method must begin with +create, followed by the element name. An add method must be +a public void method that takes a single argument of an +Object type with a no-argument constructor. +The name of the add method +must begin with add, followed by the element name.
  10. +
  11. Write a public void execute method, with no arguments, that +throws a BuildException. This method implements the task +itself.
  12. +
+ +

The Life-cycle of a Task

+
    +
  1. The task gets instantiated using a no-argument constructor, at parser + time. This means even tasks that are never executed get + instantiated.
  2. + +
  3. The task gets references to its project and location inside the + buildfile via its inherited project and + location variables.
  4. + +
  5. If the user specified an id attribute to this task, + the project + registers a reference to this newly created task, at parser + time.
  6. + +
  7. The task gets a reference to the target it belongs to via its + inherited target variable.
  8. + +
  9. init() is called at parser time.
  10. + +
  11. All child elements of the XML element corresponding to this task + are created via this task's createXXX() methods or + instantiated and added to this task via its addXXX() + methods, at parser time.
  12. + +
  13. All attributes of this task get set via their corresponding + setXXX methods, at runtime.
  14. + +
  15. The content character data sections inside the XML element + corresponding to this task is added to the task via its + addText method, at runtime.
  16. + +
  17. All attributes of all child elements get set via their corresponding + setXXX methods, at runtime.
  18. + +
  19. execute() is called at runtime. While the above initialization + steps only occur once, the execute() method may be + called more than once, if the task is invoked more than once. For example, + if target1 and target2 both depend + on target3, then running + 'ant target1 target2' will run all tasks in + target3 twice.
  20. +
+ +

Example

+

Let's write our own task, which prints a message on the +System.out stream. +The +task has one attribute, called message.

+
+
+package com.mydomain;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+public class MyVeryOwnTask extends Task {
+  private String msg;
+
+  // The method executing the task
+  public void execute() throws BuildException {
+    System.out.println(msg);
+  }
+
+  // The setter for the "message" attribute
+  public void setMessage(String msg) {
+    this.msg = msg;
+  }
+}
+
+
+

It's really this simple ;-)

+

Adding your task to the system is rather simple too:

+
    +
  1. Make sure the class that implements your task is in the classpath when + starting Ant.
  2. +
  3. Add a <taskdef> element to your project. + This actually adds your task to the system.
  4. +
  5. Use your task in the rest of the buildfile.
  6. +
+ +

Example

+
+
+<?xml version="1.0"?>
+
+<project name="OwnTaskExample" default="main" basedir=".">
+  <taskdef name="mytask" classname="com.mydomain.MyVeryOwnTask"/>
+
+  <target name="main">
+    <mytask message="Hello World! MyVeryOwnTask works!"/>
+  </target>
+</project>
+
+
+

Another way to add a task (more permanently), is to add the task name and +implementing class name to the default.properties file in the +org.apache.tools.ant.taskdefs +package. Then you can use it as if it were a built-in task.

+ +
+

Build Events

+

Ant is capable of generating build events as it performs the tasks necessary to build a project. +Listeners can be attached to Ant to receive these events. This capability could be used, for example, +to connect Ant to a GUI or to integrate Ant with an IDE. +

+

To use build events you need to create an ant Project object. You can then call the +addBuildListener method to add your listener to the project. Your listener must implement +the org.apache.tools.antBuildListener interface. The listener will receive BuildEvents +for the following events

+
    +
  • Build started
  • +
  • Build finished
  • +
  • Target started
  • +
  • Target finished
  • +
  • Task started
  • +
  • Task finished
  • +
  • Message logged
  • +
+ +

+If you wish to attach a listener from the command line you may use the +-listener option. For example:

+
+
ant -listener org.apache.tools.ant.XmlLogger
+
+

will run Ant with a listener that generates an XML representation of the build progress. This +listener is included with Ant, as is the default listener, which generates the logging to standard output.

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/dirtasks.html b/docs/manual/dirtasks.html new file mode 100644 index 000000000..83cc0ce77 --- /dev/null +++ b/docs/manual/dirtasks.html @@ -0,0 +1,168 @@ + + + + +Ant User Manual + + + + +

Directory-based Tasks

+

Some tasks use directory trees for the task they perform. +For example, the javac task, which works upon a directory tree +with .java files. +Sometimes it can be very useful to work on a subset of that directory tree. This +section describes how you can select a subset of such a directory tree.

+

Ant gives you two ways to create a subset, both of which can be used at the same +time:

+
    +
  • Only include files/directories that match at least one pattern of a set of + patterns.
  • +
  • Exclude files/directories that match at least one pattern a set of + patterns.
  • +
+

When both inclusion and exclusion are used, only files/directories that match +the include patterns, and don't match the exclude patterns, are used.

+

Patterns can be specified inside the buildfile via task attributes or +nested elements and via external files. Each line of the external file +is taken as a pattern that is added to the list of include or exclude +patterns.

+

Patterns

+

As described earlier, patterns are used for the inclusion and exclusion. +These patterns look very much like the patterns used in DOS and UNIX:

+

'*' matches zero or more characters, '?' matches one character.

+

Examples:

+

+*.java  matches  .java, +x.java and FooBar.java, but +not FooBar.xml (does not end with .java).

+

+?.java  matches  x.java, +A.java, but not .java or xyz.java +(both don't have one character before .java).

+

+Combinations of *'s and ?'s are allowed.

+

Matching is done per-directory. This means that first the first directory in +the pattern is matched against the first directory in the path to match. Then +the second directory is matched, and so on. For example, when we have the pattern /?abc/*/*.java +and the path /xabc/foobar/test.java, +the first ?abc is matched with xabc, +then * is matched with foobar, +and finally *.java is matched with test.java. +They all match, so the path matches the pattern.

+

To make things a bit more flexible, we add one extra feature, which makes it +possible to match multiple directory levels. This can be used to match a +complete directory tree, or a file anywhere in the directory tree. +To do this, ** +must be used as the name of a directory. +When ** is used as the name of a +directory in the pattern, it matches zero or more directories. +For example: +/test/** matches all files/directories under /test/, +such as /test/x.java, +or /test/foo/bar/xyz.html, but not /xyz.xml.

+

There is one "shorthand" – if a pattern ends +with / +or \, then ** +is appended. +For example, mypackage/test/ is interpreted as if it were +mypackage/test/**.

+

Example patterns:

+ + + + + + + + + + + + + + + + + + +
**/CVS/*Matches all files in CVS directories that can be located + anywhere in the directory tree.
+ Matches: +
+      CVS/Repository
+      org/apache/CVS/Entries
+      org/apache/jakarta/tools/ant/CVS/Entries
+      
+ But not: +
+      org/apache/CVS/foo/bar/Entries (foo/bar/ part does not match)
org/apache/jakarta/**Matches all files in the org/apache/jakarta directory tree.
+ Matches: +
+      org/apache/jakarta/tools/ant/docs/index.html
+      org/apache/jakarta/test.xml
+      
+ But not: +
+      org/apache/xyz.java
+      
+ (jakarta/ part is missing).
org/apache/**/CVS/*Matches all files in CVS directories + that are located anywhere in the directory tree under + org/apache.
+ Matches: +
+      org/apache/CVS/Entries
+      org/apache/jakarta/tools/ant/CVS/Entries
+      
+ But not: +
+      org/apache/CVS/foo/bar/Entries
+      
+ (foo/bar/ part does not match)
**/test/**Matches all files that have a test + element in their path, including test as a filename.
+

When these patterns are used in inclusion and exclusion, you have a powerful +way to select just the files you want.

+ +

Examples

+
  
+<copy todir="${dist}">
+  <fileset dir="${src}" 
+           includes="**/images/*" 
+           excludes="**/*.gif" 
+  />
+</copy>
+

This copies all files in directories called images that are +located in the directory tree defined by ${src} to the +destination directory defined by ${dist}, +but excludes all *.gif files from the copy.

+

This example can also be expressed using nested elements:

+
+<copy todir="${dist}">
+  <fileset dir="${src}"/>
+    <include name="**/images/*"/>
+    <exclude name="**/*.gif"/>
+  </fileset>
+</copy>
+
+ +

Default Excludes

+

There are a set of definitions that are excluded by default from all directory-based tasks. +They are:

+
+     **/*~
+     **/#*#
+     **/%*%
+     **/CVS
+     **/CVS/**
+     **/.cvsignore
+
+

If you do not want these default excludes applied, you may disable them with the +defaultexcludes="no" attribute.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/feedback.html b/docs/manual/feedback.html new file mode 100644 index 000000000..fe2f25134 --- /dev/null +++ b/docs/manual/feedback.html @@ -0,0 +1,31 @@ + + + + +Ant User Manual + + + + +

Feedback

+

To provide feedback on this software, please subscribe to the +Ant User Mailing List +

+ +

If you want to contribute to Ant or stay current with the latest +development, join the +Ant Development Mailing List +

+

Archives of both lists can be found at http://archive.covalent.net/. Many +thanks to Covalent Technologies. A searchable archive can be found at http://marc.theaimsgroup.com. If +you know of any additional archive sites, please report them to the +lists.

+
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/ide.html b/docs/manual/ide.html new file mode 100644 index 000000000..0411b1677 --- /dev/null +++ b/docs/manual/ide.html @@ -0,0 +1,23 @@ + + + + +Ant User Manual + + + + + +

Table of Contents

+ +

IDE Integration

+ + Antidote
(in development)


+ + AntRunner For JBuilder
(unbundled)


+NetBeans
Forte for Java
(unbundled)


+VisualAge for Java

+ + + + diff --git a/docs/manual/index.html b/docs/manual/index.html new file mode 100644 index 000000000..3b17dbad3 --- /dev/null +++ b/docs/manual/index.html @@ -0,0 +1,17 @@ + + + + +Ant User Manual + + + + + + + +<H2>Ant User Manual</H2> + +<a href="toc.html">Ant User Manual</a> + + diff --git a/docs/manual/install.html b/docs/manual/install.html new file mode 100644 index 000000000..1ba7de02d --- /dev/null +++ b/docs/manual/install.html @@ -0,0 +1,378 @@ + + + + +Ant User Manual + + + + +

Installing Ant

+

Getting Ant

+

Binary edition

+

The latest stable version of Ant can be downloaded from +http://jakarta.apache.org/builds/ant/release/v1.3/bin/. + +If you like living on the edge, you can download the latest version from http://jakarta.apache.org/builds/ant/nightly/.

+

Source Edition

+ +

If you prefer the source edition, you can download the source for the latest Ant release from +http://jakarta.apache.org/builds/ant/release/v1.3/src/. + +Again, if you prefer the edge, you can access +the code as it is being developed via CVS. The Jakarta website has details on +accessing CVS. Please checkout the +jakarta-ant module. + +See the section Building Ant on how to +build Ant from the source code. +You can also access the + +Ant CVS repository on-line.

+ +
+

System Requirements

+

+To build and use Ant, you must have a JAXP-compliant XML parser installed and +available on your classpath.

+

+Both the binary and source distributions of Ant include the reference +implementation of JAXP 1.0. Please see +http://java.sun.com/xml/ +for more information. +If you wish to use a different JAXP-compliant parser, you should remove +jaxp.jar and parser.jar +from Ant's lib directory. + +You can then either put the jars from your preferred parser into Ant's +lib directory or put the jars on the system classpath.

+ +

+For the current version of Ant, you will also need a JDK installed on +your system, version 1.1 or later. A future version of Ant will require +JDK 1.2 or later. +

+ +
+

Installing Ant

+

The binary distribution of Ant consists of three directories: +bin, +docs and +lib + +Only the bin and lib directories are +required to run Ant. + +To install Ant, choose a directory and copy the distribution +file there. This directory will be known as ANT_HOME. + +Before you can run ant there is some additional set up you +will need to do:

+
    +
  • Add the bin directory to your path.
  • +
  • Set the ANT_HOME environment variable to +the directory where you installed Ant.
  • +
  • Optionally, set the JAVA_HOME environment variable +(see the Advanced section below). +This should be set to the directory where your JDK is installed.
  • +
  • If you are using Ant's optional tasks then you may need to add additional +jars to your lib directory or to your CLASSPATH. +See Library Dependencies +for for a list of jar requirements for various optional tasks. +
  • + +
+

Note: Do not install Ant's ant.jar file into the lib/ext +directory of the JDK/JRE. Ant is an application, whilst the extension +directory is intended for JDK extensions. In particular there are security +restrictions on the classes which may be loaded by an extension.

+ +

Windows

+

Assume Ant is installed in c:\ant\. The following sets up the +environment:

+
set ANT_HOME=c:\ant
+set JAVA_HOME=c:\jdk1.2.2
+set PATH=%PATH%;%ANT_HOME%\bin
+ +

Unix (bash)

+

Assume Ant is installed in /usr/local/ant. The following sets up +the environment:

+
export ANT_HOME=/usr/local/ant
+export JAVA_HOME=/usr/local/jdk-1.2.2
+export PATH=${PATH}:${ANT_HOME}/bin
+ + +

Advanced

+ +

There are lots of variants that can be used to run Ant. What you need is at +least the following:

+
    +
  • The classpath for Ant must contain ant.jar and any jars/classes +needed for your chosen JAXP-compliant XML parser.
  • +
  • When you need JDK functionality +(such as for the javac task or the +rmic task), then for JDK 1.1, the classes.zip +file of the JDK must be added to the classpath; for JDK 1.2 or JDK 1.3, tools.jar +must be added. The scripts supplied with Ant, +in the bin directory, will add +the required JDK classes automatically, if the JAVA_HOME +environment variable is set.
  • + +
  • When you are executing platform-specific applications, such as the +exec task or the +cvs task, the property ant.home +must be set to the directory containing where you installed Ant. Again +this is set by the Ant scripts to the value of the ANT_HOME environment +variable.
  • +
+ +
+

Building Ant

+

To build Ant from source, you can either install the Ant source distribution +or checkout the jakarta-ant module from CVS.

+

Once you have installed the source, change into the installation +directory.

+ +

Set the JAVA_HOME environment variable +to the directory where the JDK is installed. +See Installing Ant +for examples on how to do this for your operating system.

+ +

Make sure you have downloaded any auxiliary jars required to +build tasks you are interested in. These should either be available +on the CLASSPATH or added to the lib/optional +directory. +See Library Dependencies +for for a list of jar requirements for various features. +Note that this will make the auxiliary jars +available for the building of Ant only. For running Ant you will +still need to +make the jars available as described under +Installing Ant.

+ +

Your are now ready to build Ant:

+
+

build -Ddist.dir=<directory_to_contain_Ant_distribution> dist    (Windows)

+

build.sh -Ddist.dir=<directory_to_contain_Ant_distribution> dist    (Unix)

+
+ +

This will create a binary distribution of Ant in the directory you specified.

+ +

The above action does the following:

+
    + +
  • If necessary it will bootstrap the Ant code. Bootstrapping involves the manual +compilation of enough Ant code to be able to run Ant. The bootstrapped Ant is +used for the remainder of the build steps.
  • + +
  • Invokes the bootstrapped Ant with the parameters passed to the build script. In +this case, these parameters define an Ant property value and specify the "dist" target +in Ant's own build.xml file. +
+ +

On most occasions you will not need to explicitly bootstrap Ant since the build +scripts do that for you. If however, the build file you are using makes use of features +not yet compiled into the bootstrapped Ant, you will need to manually bootstrap. +Run bootstrap.bat (Windows) or bootstrap.sh (UNIX) +to build a new bootstrap version of Ant.

+ +If you wish to install the build into the current ANT_HOME +directory, you can use: +
+

build install    (Windows)

+

build.sh install    (Unix)

+
+ +You can avoid the lengthy Javadoc step, if desired, with: +
+

build install-lite    (Windows)

+

build.sh install-lite    (Unix)

+
+This will only install the bin and lib directories. +

Both the install and +install-lite targets will overwrite +the current Ant version in ANT_HOME.

+ +
+

Running Ant

+

Running Ant is simple, when you installed it as described in the previous +section. Just type ant.

+

When nothing is specified, Ant looks for a build.xml +file in the current directory. If found, it uses that file as the +buildfile. If you use the -find option, +Ant will search for a buildfile in +the parent directory, and so on, until the root of the filesystem +has been reached. To make Ant use +another buildfile, use the command-line +option -buildfile file, +where file is the buildfile you want to use.

+ +

You can also set properties that override properties specified in the +buildfile (see the property task). +This can be done with +the -Dproperty=value option, +where property is the name of the property, +and value is the value for that property. +This can also be used to pass in the value of some environment variables. +You can also access environment variables using the +property task. + +Just pass -DMYVAR=%MYVAR% (Windows) or +-DMYVAR=$MYVAR (Unix) +to Ant – you can then access +these variables inside your buildfile as ${MYVAR}.

+ +

Two more options are: -quiet, +which instructs Ant to print less +information on the console when running, and +-verbose, which causes Ant to print +additional information to the console.

+ +

It is also possible to specify one or more targets that should be executed. +When omitted, the target that is specified in the +default attribute of the <project> tag is +used.

+ +

The -projecthelp +option gives a list of this project's +targets. First those with a description, then those without one.

+ +

Command-line option summary:

+
ant [options] [target [target2 [target3] ...]]
+Options:
+-help                  print this message
+-projecthelp           print project help information
+-version               print the version information and exit
+-quiet                 be extra quiet
+-verbose               be extra verbose
+-debug                 print debugging information
+-emacs                 produce logging information without adornments
+-logfile file          use given file for log output
+-logger classname      the class that is to perform logging
+-listener classname    add an instance of class as a project listener
+-buildfile file        use specified buildfile
+-find file             search for buildfile towards the root of the filesystem and use the first one found
+-Dproperty=value       set property to value
+
+

Examples

+
+
ant
+
+

runs Ant using the build.xml file in the current directory, on +the default target.

+
+
ant -buildfile test.xml
+
+

runs Ant using the test.xml file in the current directory, on +the default target.

+
+
ant -buildfile test.xml dist
+
+

runs Ant using the test.xml file in the current directory, on a +target called dist.

+
+
ant -buildfile test.xml -Dbuild=build/classes dist
+
+

runs Ant using the test.xml file in the current directory, on a +target called dist, setting the build property to the +value build/classes.

+ +

Running Ant by Hand

+

If you have installed Ant in the do-it-yourself way, Ant can be started +with:

+
+
java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]
+
+ +

These instructions actually do exactly the same as the ant +command. The options and target are the same as when running Ant with the ant +command. This example assumes you have set your classpath to include:

+
    +
  • ant.jar
  • +
  • jars/classes for your XML parser
  • +
  • the JDK's required jar/zip files
  • +
+
+

Library Dependencies

+

The following libraries are needed in your CLASSPATH or in the +install directory's lib directory if you are using the +indicated feature. Note that only one of the regexp libraries is +needed for use with the mappers.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Jar NameNeeded ForAvailable At
jakarta-regexp-1.2.jarregexp type with mappersjakarta.apache.org/regexp/
jakarta-oro-2.0.1.jarregexp type with mappers and the perforce tasksjakarta.apache.org/oro/
junit.jarjunit taskswww.junit.org
stylebook.jarstylebook taskCVS repository of xml.apache.org
testlet.jartest taskjava.apache.org/framework
antlr.jarantlr taskwww.antlr.org
bsf.jarscript task + oss.software.ibm.com/developerworks/projects/bsf
netrexx.jarnetrexx task + www2.hursley.ibm.com/netrexx
rhino.jarjavascript with script taskwww.mozilla.org
jpython.jarpython with script taskwww.jpython.org
netcomponents.jarftp and telnet taskswww.savarese.org/oro/downloads
+
+


+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/intro.html b/docs/manual/intro.html new file mode 100644 index 000000000..859a8f270 --- /dev/null +++ b/docs/manual/intro.html @@ -0,0 +1,54 @@ + + + + +Ant User Manual + + + +

Introduction

+

Ant is a Java-based build tool. In theory, it is kind of like +make, without make's wrinkles.

+

Why?

+

Why another build tool when there is already +make, +gnumake, +nmake, +jam, +and +others? Because all those tools have limitations that Ant's original author +couldn't live with when developing software across multiple platforms. +Make-like +tools are inherently shell-based: they evaluate a set of dependencies, +then execute commands not unlike what you would issue on a shell. +This means that you +can easily extend these tools by using or writing any program for the OS that +you are working on; however, this also means that you limit yourself to the OS, +or at least the OS type, such as Unix, that you are working on.

+

Makefiles are inherently evil as well. Anybody who has worked on them for any +time has run into the dreaded tab problem. "Is my command not executing +because I have a space in front of my tab?!!" said the original author of +Ant way too many times. Tools like Jam took care of this to a great degree, but +still have yet another format to use and remember.

+

Ant is different. Instead of a model where it is extended with shell-based +commands, Ant is extended using Java classes. Instead of writing shell commands, +the configuration files are XML-based, calling out a target tree where various +tasks get executed. Each task is run by an object that implements a particular +Task interface.

+

Granted, this removes some of the expressive power that is inherent in being +able to construct a shell command such as +`find . -name foo -exec rm {}`, but it +gives you the ability to be cross-platform – to work anywhere and +everywhere. And +hey, if you really need to execute a shell command, Ant has an +<exec> task that +allows different commands to be executed based on the OS it is executing +on.

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/optionaltasklist.html b/docs/manual/optionaltasklist.html new file mode 100644 index 000000000..be1df30d6 --- /dev/null +++ b/docs/manual/optionaltasklist.html @@ -0,0 +1,40 @@ + + + + +Ant User Manual + + + + + +

Table of Contents

+ +

Optional Tasks

+.NET Tasks
+ANTLR
+Cab
+Clearcase Tasks
+EJB Tasks
+FTP
+JavaCC
+JJTree
+Jlink
+JUnit
+JUnitReport
+MParse
+Native2Ascii
+NetRexxC
+PropertyFile
+Perforce Tasks
+RenameExtensions
+Script
+Sound
+Stylebook
+Test
+Telnet
+VssGet
+ + + + diff --git a/docs/manual/resources.html b/docs/manual/resources.html new file mode 100644 index 000000000..1d7b2417b --- /dev/null +++ b/docs/manual/resources.html @@ -0,0 +1,25 @@ + + + + +Ant User Manual + + + +

Ant Resources

+ +

FAQ

+

There is an on-line FAQ for Ant at jakarta.apache.org. This +FAQ is interactive, which means you can ask and answer questions +on line.

+

One of the questions popping up quite often is "Is there a DTD for +buildfiles?" Please refer to the FAQ for an answer.

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/toc.html b/docs/manual/toc.html new file mode 100644 index 000000000..67f28f1f6 --- /dev/null +++ b/docs/manual/toc.html @@ -0,0 +1,26 @@ + + + + +Ant User Manual + + + + + +

Table of Contents

+Introduction
+Installing Ant
+Using Ant
+Built-in Tasks
+Optional Tasks
+IDE Integration
+Developing with Ant
+Ant Resources
+LICENSE
+Feedback

+Authors
+ + + + diff --git a/docs/manual/using.html b/docs/manual/using.html new file mode 100644 index 000000000..bc74fc4be --- /dev/null +++ b/docs/manual/using.html @@ -0,0 +1,468 @@ + + + + +Ant User Manual + + + +

Using Ant

+

Writing a Simple Buildfile

+

Ant's buildfiles are written in XML. Each buildfile contains one project.

+

Each task element of the buildfile can have an id attribute and +can later be referred to by the value supplied to this. The value has +to be unique. (For additional information, see the + Tasks section below.)

+

Projects

+

A project has three attributes:

+ + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
namethe name of the project.No
defaultthe default target to use when no target is supplied.Yes
basedirthe base directory from which all path calculations are + done. This attribute might be overridden by setting + the "basedir" + property beforehand. When this is done, it must be omitted in the + project tag. If neither the attribute nor the property have + been set, the parent directory of the buildfile will be used.No
+

Each project defines one or more targets. +A target is a set of tasks you want +to be executed. When starting Ant, you can select which target(s) you +want to have executed. When no target is given, +the project's default is used.

+ +

Targets

+

A target can depend on other targets. You might have a target for compiling, +for example, and a target for creating a distributable. You can only build a +distributable when you have compiled first, so the distribute target +depends on the compile target. Ant resolves these dependencies.

+

It should be noted, however, that Ant's depends attribute +only specifies the order in which targets should be executed – it +does not affect whether the target that specifies the dependency(s) gets +executed if the dependent target(s) did not (need to) run. +

+

Ant tries to execute the targets in the depends +attribute in the order +they appear (from left to right). Keep in mind that it is possible that a target +can get executed earlier when an earlier target depends on it:

+
+
<target name="A"/>
+<target name="B" depends="A"/>
+<target name="C" depends="B"/>
+<target name="D" depends="C,B,A"/>
+
+

Suppose we want to execute target D. From its +depends attribute, you +might think that first target C, then B and then A is executed. +Wrong! C depends on B, and B depends on A, so first A is executed, then B, then C, and finally D.

+

A target gets executed only once, even when more than one target +depends on it (see the previous example).

+

A target also has the ability to perform its execution if (or +unless) a property has been set. This allows, for example, better +control on the building process depending on the state of the system +(java version, OS, command-line property defines, etc.). To make a target +sense this property, you should add the if (or +unless) attribute with the name of the property that the target +should react to. For example:

+
+
<target name="build-module-A" if="module-A-present"/>
+
<target name="build-own-fake-module-A" unless="module-A-present"/>
+
+

If no if and no unless attribute is present, +the target will always be executed.

+

The optional description attribute can be used to provide a one-line description of this target, which is printed by the +-projecthelp command-line option.

+

It is a good practice to place your tstamp tasks in a so-called +initialization target, on which +all other targets depend. Make sure that target is always the first one in +the depends list of the other targets. In this manual, most initialization targets +have the name "init".

+

A target has the following attributes:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
namethe name of the target.Yes
dependsa comma-separated list of names of targets on which this + target depends.No
ifthe name of the property that must be set in order for this + target to execute.No
unlessthe name of the property that must not be set in order + for this target to execute.No
descriptiona short description of this target's function.No
+ + +

Tasks

+
+

A task is a piece of code that can be executed.

+

A task can have multiple attributes (or arguments, if you prefer). The value +of an attribute might contain references to a property. These references will be +resolved before the task is executed.

+

Tasks have a common structure:

+
+
<name attribute1="value1" attribute2="value2" ... />
+
+

where name is the name of the task, +attributeN is the attribute name, and +valueN is the value for this attribute.

+

There is a set of built-in tasks, along with a +number of + optional tasks, but it is also very +easy to write your own.

+

All tasks share a task name attribute. The value of +this attribute will be used in the logging messages generated by +Ant.

+Tasks can be assigned an id attribute: +
+
<taskname id="taskID" ... />
+
+where taskname is the name of the task, and taskID is +a unique name for this task. +You can refer to the +corresponding task object in scripts or other tasks via this name. +For example, in scripts you could do: +
+
+<script ... >
+  task1.setFoo("bar");
+</script>
+
+
+to set the foo attribute of this particular task instance. +In another task (written in Java), you can access the instance via +project.getReference("task1"). +

+Note1: If "task1" has not been run yet, then +it has not been configured (ie., no attributes have been set), and if it is +going to be configured later, anything you've done to the instance may +be overwritten. +

+

+Note2: Future versions of Ant will most likely not +be backward-compatible with this behaviour, since there will likely be no +task instances at all, only proxies. +

+ +

Properties

+

A project can have a set of properties. These might be set in the buildfile +by the property task, or might be set outside Ant. A +property has a name and a value. Properties may be used in the value of +task attributes. This is done by placing the property name between +"${" and "}" in the +attribute value. For example, +if there is a "builddir" property with the value +"build", then this could be used in an attribute like this: +${builddir}/classes. +This is resolved as build/classes.

+ +

Built-in Properties

+

Ant provides access to all system properties as if they had been +defined using a <property> task. +For example, ${os.name} expands to the +name of the operating system.

+

In addition, Ant has some built-in properties:

+
+basedir             the absolute path of the project's basedir (as set
+                    with the basedir attribute of <project>).
+ant.file            the absolute path of the buildfile.
+ant.project.name    the name of the project that is currently executing;
+                    it is set in the name attribute of <project>.
+ant.java.version    the JVM version Ant detected; currently it can hold
+                    the values "1.1", "1.2" and "1.3".
+
+ +

Example

+
+<project name="MyProject" default="dist" basedir=".">
+
+  <!-- set global properties for this build -->
+  <property name="src" value="."/>
+  <property name="build" value="build"/>
+  <property name="dist"  value="dist"/>
+
+  <target name="init">
+    <!-- Create the time stamp -->
+    <tstamp/>
+    <!-- Create the build directory structure used by compile -->
+    <mkdir dir="${build}"/>
+  </target>
+
+  <target name="compile" depends="init">
+    <!-- Compile the java code from ${src} into ${build} -->
+    <javac srcdir="${src}" destdir="${build}"/>
+  </target>
+
+  <target name="dist" depends="compile">
+    <!-- Create the distribution directory -->
+    <mkdir dir="${dist}/lib"/>
+
+    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
+    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
+  </target>
+
+  <target name="clean">
+    <!-- Delete the ${build} and ${dist} directory trees -->
+    <delete dir="${build}"/>
+    <delete dir="${dist}"/>
+  </target>
+</project>
+
+ +

Token Filters

+

A project can have a set of tokens that might be automatically expanded if +found when a file is copied, when the filtering-copy behavior is selected in the +tasks that support this. These might be set in the buildfile +by the filter task

+

Since this can potentially be a very harmful behavior, +the tokens in the files must +be of the form @token@, where +token is the token name that is set +in the filter task. This token syntax matches the syntax of other build systems +that perform such filtering and remains sufficiently orthogonal to most +programming and scripting languages, as well as with documentation systems.

+

Note: If a token with the format @token@ +is found in a file, but no +filter is associated with that token, no changes take place; +therefore, no escaping +method is available – but as long as you choose appropriate names for your +tokens, this should not cause problems.

+

Warning: If you copy binary files with filtering turned on, you can corrupt the +files. This feature should be used with text files only.

+ +

Path-like Structures

+

You can specify PATH- and CLASSPATH-type +references using both +":" and ";" as separator +characters. Ant will +convert the separator to the correct character of the current operating +system.

+

Wherever path-like values need to be specified, a nested element can +be used. This takes the general form of:

+
+    <classpath>
+      <pathelement path="${classpath}"/>
+      <pathelement location="lib/helper.jar"/>
+    </classpath>
+
+

The location attribute specifies a single file or +directory relative to the project's base directory (or an absolute +filename), while the path attribute accepts colon- +or semicolon-separated lists of locations. The path +attribute is intended to be used with predefined paths – in any other +case, multiple elements with location attributes should be +preferred.

+

As a shortcut, the <classpath> tag +supports path and +location attributes of its own, so:

+
+    <classpath>
+      <pathelement path="${classpath}"/>
+    </classpath>
+
+

can be abreviated to:

+
+    <classpath path="${classpath}"/>
+
+

In addition, FileSets can be specified via +nested <fileset> elements. The order in which the files +building up a fileset are added to the path-like structure is not +defined.

+
+    <classpath>
+      <pathelement path="${classpath}"/>
+      <fileset dir="lib">
+        <include name="**/*.jar"/>
+      </fileset>
+      <pathelement location="classes"/>
+    </classpath>
+
+

Builds a path that holds the value of ${classpath}, +followed by all jar files in the lib directory, followed +by the classes directory.

+

If you want to use the same path-like structure for several tasks, +you can define them with a <path> element at the +same level as targets, and reference them via their +id attribute – see References for an +example.

+

A path-like structure can include a reference to another path-like +structure via nested <path> elements:

+
+    <path id="base.path">
+      <pathelement path="${classpath}"/>
+      <fileset dir="lib">
+        <include name="**/*.jar"/>
+      </fileset>
+      <pathelement location="classes"/>
+    </path>
+
+    <path id="tests.path">
+      <path refid="base.path"/>
+      <pathelement location="testclasses"/>
+    </path>
+
+ The shortcuts previously mentioned for <classpath> are also valid for <path>.For example: +
+    <path id="base.path">
+      <pathelement path="${classpath}"/>
+    </path>
+
+can be written as: +
+    <path id="base.path" path="${classpath}"/>
+
+ +

Command-line Arguments

+

Several tasks take arguments that will be passed to another +process on the command line. To make it easier to specify arguments +that contain space characters, nested arg elements can be used.

+ + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
valuea single command-line argument; can contain space + characters.Exactly one of these.
linea space-delimited list of command-line arguments.
fileThe name of a file as a single command-line + argument; will be replaced with the absolute filename of the file.
pathA string that will be treated as a path-like + string as a single command-line argument; you can use ; + or : as + path separators and Ant will convert it to the platform's local + conventions.
+

Examples

+
+  <arg value="-l -a"/>
+
+

is a single command-line argument containing a space character.

+
+  <arg line="-l -a"/>
+
+

represents two separate command-line arguments.

+
+  <arg path="/dir;/dir2:\dir3"/>
+
+

is a single command-line argument with the value +\dir;\dir2;\dir3 on DOS-based systems and +/dir:/dir2:/dir3 on Unix-like systems.

+ +

References

+

The id attribute of the buildfile's elements can be +used to refer to them. This can useful if you are going to replicate +the same snippet of XML over and over again – using a +<classpath> structure more than once for +example.

+

The following example:

+
+<project ... >
+  <target ... >
+    <rmic ...>
+      <classpath>
+        <pathelement location="lib/"/>
+        <pathelement path="${java.class.path}/"/>
+        <pathelement path="${additional.path}"/>
+      </classpath>
+    </rmic>
+  </target>
+
+  <target ... >
+    <javac ...>
+      <classpath>
+        <pathelement location="lib/"/>
+        <pathelement path="${java.class.path}/"/>
+        <pathelement path="${additional.path}"/>
+      </classpath>
+    </javac>
+  </target>
+</project>
+
+

could be rewritten as:

+
+<project ... >
+  <path id="project.class.path">
+    <pathelement location="lib/"/>
+    <pathelement path="${java.class.path}/"/>
+    <pathelement path="${additional.path}"/>
+  </path>
+
+  <target ... >
+    <rmic ...>
+      <classpath refid="project.class.path"/>
+    </rmic>
+  </target>
+
+  <target ... >
+    <javac ...>
+      <classpath refid="project.class.path"/>
+    </javac>
+  </target>
+</project>
+
+

All tasks that use nested elements for PatternSets, FileSets or +path-like structures accept references to these +structures as well.

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/lib/optional/README b/lib/optional/README index 906a1d2c5..c7a66acd5 100644 --- a/lib/optional/README +++ b/lib/optional/README @@ -1,15 +1,2 @@ -The required libraries should be placed here. - -The dependencies are: - -junit.jar - required for junit tasks, available at www.junit.org -stylebook.jar - required by stylebook task, available in CVS repository of xml.apache.org -testlet.jar - required for test task, available with Avalon via java.apache.org/framework -jakarta-regexp-1.2.jar - required by some mappers, available at http://jakarta.apache.org/regexp/ -jakarta-oro-2.0.1.jar - required for some mappers and the perforce tasks, available at http://jakarta.apache.org/oro/ -???antlr.jar???- required for antlr task, available at www.antlr.org -bsf.jar - required for script task, available at http://oss.software.ibm.com/developerworks/opensource/bsf/ -netrexx.jar - required for netrexx task, available at http://www2.hursley.ibm.com/netrexx -rhino.jar - required for script task if you want to use javascript, available at www.mozilla.org -jpython.jar - required for script task if you want to use python, available at www.jpython.org -netcomponents.jar - required by ftp and telnet tasks, available at http://www.savarese.org/oro/downloads/index.html#NetComponents +Please refer to the Ant manual under Installing Ant / Library Dependencies for a list +of the jar requirements for various optional tasks and features. diff --git a/src/main/org/apache/tools/ant/DefaultLogger.java b/src/main/org/apache/tools/ant/DefaultLogger.java index aedf2a8a3..4ceabcc65 100644 --- a/src/main/org/apache/tools/ant/DefaultLogger.java +++ b/src/main/org/apache/tools/ant/DefaultLogger.java @@ -138,17 +138,7 @@ public class DefaultLogger implements BuildLogger { else { err.println(lSep + "BUILD FAILED" + lSep); - if (error instanceof BuildException) { - err.println(error.toString()); - - Throwable nested = ((BuildException)error).getException(); - if (nested != null) { - nested.printStackTrace(err); - } - } - else { - error.printStackTrace(err); - } + error.printStackTrace(err); } out.println(lSep + "Total time: " + formatTime(System.currentTimeMillis() - startTime)); diff --git a/src/main/org/apache/tools/ant/taskdefs/Available.java b/src/main/org/apache/tools/ant/taskdefs/Available.java index 642868a52..0ff188a7f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Available.java +++ b/src/main/org/apache/tools/ant/taskdefs/Available.java @@ -129,9 +129,20 @@ public class Available extends Task { this.loader = new AntClassLoader(project, classpath, false); } - if ((classname != null) && !checkClass(classname)) return; - if ((file != null) && !checkFile(file)) return; - if ((resource != null) && !checkResource(resource)) return; + if ((classname != null) && !checkClass(classname)) { + log("Unable to load class " + classname + " to set property " + property, Project.MSG_VERBOSE); + return; + } + + if ((file != null) && !checkFile(file)) { + log("Unable to find file " + file + " to set property " + property, Project.MSG_VERBOSE); + return; + } + + if ((resource != null) && !checkResource(resource)) { + log("Unable to load resource " + resource + " to set property " + property, Project.MSG_VERBOSE); + return; + } this.project.setProperty(property, value); } @@ -170,10 +181,8 @@ public class Available extends Task { } return true; } catch (ClassNotFoundException e) { - log("Class not found: " + classname, Project.MSG_VERBOSE); return false; } catch (NoClassDefFoundError e) { - log("Class cound not be loaded: " + classname, Project.MSG_VERBOSE); return false; } } diff --git a/src/main/org/apache/tools/ant/taskdefs/Execute.java b/src/main/org/apache/tools/ant/taskdefs/Execute.java index be2a73b0f..69b401198 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Execute.java +++ b/src/main/org/apache/tools/ant/taskdefs/Execute.java @@ -428,6 +428,8 @@ public class Execute { */ public Process exec(Project project, String[] cmd, String[] env) throws IOException { + project.log("Execute:CommandLauncher: " + + Commandline.toString(cmd), Project.MSG_DEBUG); return Runtime.getRuntime().exec(cmd, env); } @@ -469,6 +471,8 @@ public class Execute { for ( int i = 0; i < cmd.length; i++ ) { newcmd[i] = Commandline.quoteArgument(cmd[i]); } + project.log("Execute:Java11CommandLauncher: " + + Commandline.toString(newcmd), Project.MSG_DEBUG); return Runtime.getRuntime().exec(newcmd, env); } } @@ -493,6 +497,8 @@ public class Execute { throws IOException { try { + project.log("Execute:Java13CommandLauncher: " + + Commandline.toString(cmd), Project.MSG_DEBUG); Object[] arguments = { cmd, env, workingDir }; return (Process)_execWithCWD.invoke(Runtime.getRuntime(), arguments); } diff --git a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java index 6cec5ca82..51b71d769 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java +++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java @@ -193,6 +193,7 @@ public class Javadoc extends Task { private File destDir = null; private String sourceFiles = null; private String packageNames = null; + private String excludePackageNames = null; private boolean author = true; private boolean version = true; private DocletInfo doclet = null; @@ -260,6 +261,11 @@ public class Javadoc extends Task { public void setPackagenames(String src) { packageNames = src; } + + public void setExcludePackageNames(String src) { + excludePackageNames = src; + } + public void setOverview(File f) { if (!javadoc1) { cmd.createArgument().setValue("-overview"); @@ -722,8 +728,16 @@ public class Javadoc extends Task { toExecute.createArgument().setValue(name); } } + + Vector excludePackages = new Vector(); + if ((excludePackageNames != null) && (excludePackageNames.length() > 0)) { + StringTokenizer exTok = new StringTokenizer(excludePackageNames, ",", false); + while (exTok.hasMoreTokens()) { + excludePackages.addElement(exTok.nextToken().trim()); + } + } if (packages.size() > 0) { - evaluatePackages(toExecute, sourcePath, packages); + evaluatePackages(toExecute, sourcePath, packages, excludePackages); } } @@ -770,9 +784,10 @@ public class Javadoc extends Task { * patterns. */ private void evaluatePackages(Commandline toExecute, Path sourcePath, - Vector packages) { + Vector packages, Vector excludePackages) { log("Source path = " + sourcePath.toString(), Project.MSG_VERBOSE); log("Packages = " + packages, Project.MSG_VERBOSE); + log("Exclude Packages = " + excludePackages, Project.MSG_VERBOSE); Vector addedPackages = new Vector(); @@ -793,6 +808,17 @@ public class Javadoc extends Task { fs.createInclude().setName(pkg); } // while + e = excludePackages.elements(); + while (e.hasMoreElements()) { + String pkg = (String)e.nextElement(); + pkg = pkg.replace('.','/'); + if (pkg.endsWith("*")) { + pkg += "*"; + } + + fs.createExclude().setName(pkg); + } + for (int j=0; j-compiler) to use @@ -204,7 +208,15 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { } /** - * Set the value of the oldCMP scheme. The oldCMP scheme locates the + * Set the value of the oldCMP scheme. This is an antonym for + * newCMP + */ + public void setOldCMP(boolean oldCMP) { + this.newCMP = !oldCMP; + } + + /** + * Set the value of the newCMP scheme. The old CMP scheme locates the * weblogic CMP descriptor based on the naming convention where the * weblogic CMP file is expected to be named with the bean name as the prefix. * @@ -212,10 +224,9 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { * actually used in the main weblogic EJB descriptor. Also, descriptors which * contain multiple CMP references could not be used. * - * The old scheme is currently the default, but is also deprecated. */ - public void setOldCMP(boolean oldCMP) { - this.oldCMP = oldCMP; + public void setNewCMP(boolean newCMP) { + this.newCMP = newCMP; } @@ -237,7 +248,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { return handler; } - protected DescriptorHandler getWeblogicDescriptorHandler(File srcDir) { + protected DescriptorHandler getWeblogicDescriptorHandler(final File srcDir) { DescriptorHandler handler = new DescriptorHandler(srcDir) { protected void processElement() { @@ -247,7 +258,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { //trim the META_INF\ off of the file name String fileName = fileNameWithMETA.substring(META_DIR.length(), fileNameWithMETA.length() ); - File descriptorFile = new File(getConfig().descriptorDir, fileName); + File descriptorFile = new File(srcDir, fileName); + ejbFiles.put(fileNameWithMETA, descriptorFile); } } @@ -255,6 +267,11 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { handler.registerDTD(PUBLICID_WEBLOGIC_EJB, weblogicDTD == null ? DEFAULT_WL_DTD_LOCATION : weblogicDTD); + + for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) { + EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation)i.next(); + handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation()); + } return handler; } @@ -277,9 +294,9 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { return; } - if (oldCMP) { + if (!newCMP) { log("The old method for locating CMP files has been DEPRECATED.", Project.MSG_VERBOSE); - log("Please adjust your weblogic descriptor and set oldCMP=\"false\" " + + log("Please adjust your weblogic descriptor and set newCMP=\"true\" " + "to use the new CMP descriptor inclusion mechanism. ", Project.MSG_VERBOSE); // The the weblogic cmp deployment descriptor File weblogicCMPDD = new File(getConfig().descriptorDir, ddPrefix + WL_CMP_DD); diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadProjects.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadProjects.java index 664ad2692..4f0fc37e1 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadProjects.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadProjects.java @@ -130,7 +130,7 @@ public class VAJLoadProjects extends Task { /** * Add a project description entry on the project list. */ - public VAJProjectDescription createProject() { + public VAJProjectDescription createVAJProject() { VAJProjectDescription d = new VAJProjectDescription(); projectDescriptions.addElement(d); return d; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java index b605cc02c..9cc9283fe 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java @@ -68,13 +68,10 @@ import java.io.IOException; import java.util.Enumeration; import java.util.Hashtable; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.stream.StreamSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; +import org.apache.xalan.xslt.XSLTProcessorFactory; +import org.apache.xalan.xslt.XSLTProcessor; +import org.apache.xalan.xslt.XSLTInputSource; +import org.apache.xalan.xslt.XSLTResultTarget; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; @@ -169,9 +166,6 @@ public class AggregateTransformer { /** XML Parser factory */ protected static final DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance(); - /** XSL Parser factory */ - protected static final TransformerFactory tfactory = TransformerFactory.newInstance(); - public AggregateTransformer(Task task){ this.task = task; } @@ -268,7 +262,7 @@ public class AggregateTransformer { } /** create a single page summary */ - protected void createSinglePageSummary(Element root) throws IOException, TransformerException { + protected void createSinglePageSummary(Element root) throws IOException, SAXException { transform(root, OVERVIEW_SUMMARY + ".xsl", OVERVIEW_SUMMARY + getExtension()); } @@ -286,7 +280,7 @@ public class AggregateTransformer { } } - protected void createCascadingStyleSheet() throws IOException, TransformerException { + protected void createCascadingStyleSheet() throws IOException, SAXException { if (styleDir == null) { InputStream in = getResourceAsStream("html/stylesheet.css"); OutputStream out = new FileOutputStream( new File(toDir, "stylesheet.css")); @@ -294,7 +288,7 @@ public class AggregateTransformer { } } - protected void createFrameStructure() throws IOException, TransformerException{ + protected void createFrameStructure() throws IOException, SAXException{ if (styleDir == null) { InputStream in = getResourceAsStream("html/index.html"); OutputStream out = new FileOutputStream( new File(toDir, "index.html") ); @@ -306,7 +300,7 @@ public class AggregateTransformer { * Create the list of all packages. * @param root root of the xml document. */ - protected void createPackageList(Node root) throws TransformerException { + protected void createPackageList(Node root) throws SAXException { transform(root, ALLPACKAGES + ".xsl", ALLPACKAGES + getExtension()); } @@ -314,7 +308,7 @@ public class AggregateTransformer { * Create the list of all classes. * @param root root of the xml document. */ - protected void createClassList(Node root) throws TransformerException { + protected void createClassList(Node root) throws SAXException { transform(root, ALLCLASSES + ".xsl", ALLCLASSES + getExtension()); } @@ -322,7 +316,7 @@ public class AggregateTransformer { * Create the summary used in the overview. * @param root root of the xml document. */ - protected void createPackageOverview(Node root) throws TransformerException { + protected void createPackageOverview(Node root) throws SAXException { transform(root, OVERVIEW_PACKAGES + ".xsl", OVERVIEW_PACKAGES + getExtension()); } @@ -349,7 +343,7 @@ public class AggregateTransformer { * create all resulting html pages for all testsuites. * @param root should be 'testsuites' node. */ - protected void createAllTestSuiteDetails(Element root) throws TransformerException { + protected void createAllTestSuiteDetails(Element root) throws SAXException { NodeList testsuites = root.getElementsByTagName(XMLConstants.TESTSUITE); final int size = testsuites.getLength(); for (int i = 0; i < size; i++){ @@ -362,7 +356,7 @@ public class AggregateTransformer { * create the html resulting page of one testsuite. * @param root should be 'testsuite' node. */ - protected void createTestSuiteDetails(Element testsuite) throws TransformerException { + protected void createTestSuiteDetails(Element testsuite) throws SAXException { String packageName = testsuite.getAttribute(XMLConstants.ATTR_PACKAGE); String pkgPath = packageToPath(packageName); @@ -382,7 +376,7 @@ public class AggregateTransformer { * create the html resulting page of the summary of each package of the root element. * @param root should be 'testsuites' node. */ - protected void createAllPackageDetails(Element root) throws TransformerException, ParserConfigurationException { + protected void createAllPackageDetails(Element root) throws SAXException, ParserConfigurationException { Enumeration packages = getPackages(root); while ( packages.hasMoreElements() ){ String pkgname = (String)packages.nextElement(); @@ -409,7 +403,7 @@ public class AggregateTransformer { * @param root should be 'testsuites' node. * @param pkgname Name of the package that we want a summary. */ - protected void createPackageDetails(Node root, String pkgname) throws TransformerException { + protected void createPackageDetails(Node root, String pkgname) throws SAXException { String path = packageToPath(pkgname); // apply style to get the list of the classes of this package and @@ -443,13 +437,13 @@ public class AggregateTransformer { * @param xslfile style file * @param outfilename filename of the result of the style applied on the Node * - * @throws TransformerException SAX Parsing Error on the style Sheet. + * @throws SAXException SAX Parsing Error on the style Sheet. */ - protected void transform(Node root, String xslname, String htmlname) throws TransformerException { + protected void transform(Node root, String xslname, String htmlname) throws SAXException { try{ final long t0 = System.currentTimeMillis(); - StreamSource xsl_source = getXSLStreamSource(xslname); - Transformer transformer = tfactory.newTransformer(xsl_source); + XSLTInputSource xsl_source = getXSLStreamSource(xslname); + XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); File htmlfile = new File(toDir, htmlname); // create the directory if it does not exist File dir = new File(htmlfile.getParent()); // getParentFile is in JDK1.2+ @@ -457,22 +451,23 @@ public class AggregateTransformer { dir.mkdirs(); } task.log("Applying '" + xslname + "'. Generating '" + htmlfile + "'", Project.MSG_VERBOSE); - transformer.transform( new DOMSource(root), new StreamResult(htmlfile)); + processor.process( new XSLTInputSource(root), xsl_source, new XSLTResultTarget(htmlfile.getAbsolutePath()) ); final long dt = System.currentTimeMillis() - t0; - task.log("Transform time: " + dt + "ms"); + task.log("Transform time for " + xslname + ": " + dt + "ms"); } catch (IOException e){ task.log(e.getMessage(), Project.MSG_ERR); e.printStackTrace(); //@todo bad, change this - throw new TransformerException(e.getMessage()); + throw new SAXException(e.getMessage()); } } + /** * default xsls are embedded in the distribution jar. As a default we will use * them, otherwise we will get the one supplied by the client in a given * directory. It must have the same name. */ - protected StreamSource getXSLStreamSource(String name) throws IOException { + protected XSLTInputSource getXSLStreamSource(String name) throws IOException { InputStream in; String systemId; //we need this because there are references in xsls if (styleDir == null){ @@ -483,7 +478,7 @@ public class AggregateTransformer { in= new FileInputStream(f); systemId = f.getAbsolutePath(); } - StreamSource ss = new StreamSource(in); + XSLTInputSource ss = new XSLTInputSource(in); ss.setSystemId(systemId); return ss; } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java index fdf5186fe..c8a413618 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java @@ -57,6 +57,7 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; +import java.io.StringWriter; import java.io.FileOutputStream; import java.util.Enumeration; import java.util.Vector; @@ -248,7 +249,10 @@ public class XMLResultAggregator extends Task implements XMLConstants { for (int i = 0; i < files.length; i++) { try { log("Parsing file: '" + files[i] + "'", Project.MSG_VERBOSE); - Document testsuiteDoc = builder.parse( files[i] ); + //XXX there seems to be a bug in xerces 1.3.0 that doesn't like file object + // will investigate later. It does not use the given directory but + // the vm dir instead ? Works fine with crimson. + Document testsuiteDoc = builder.parse( "file:///" + files[i].getAbsolutePath() ); Element elem = testsuiteDoc.getDocumentElement(); // make sure that this is REALLY a testsuite. if ( TESTSUITE.equals(elem.getNodeName()) ) { @@ -261,6 +265,9 @@ public class XMLResultAggregator extends Task implements XMLConstants { // a testcase might have failed and write a zero-length document, // It has already failed, but hey.... mm. just put a warning log("The file " + files[i] + " is not a valid XML document. It is possibly corrupted.", Project.MSG_WARN); + StringWriter sw = new StringWriter(); + e.printStackTrace(new PrintWriter(sw)); + log(sw.toString(), Project.MSG_DEBUG); } catch (IOException e){ log("Error while accessing file " + files[i] + ": " + e.getMessage(), Project.MSG_ERR); } diff --git a/src/main/org/apache/tools/ant/types/CommandlineJava.java b/src/main/org/apache/tools/ant/types/CommandlineJava.java index a27370646..a7d023b46 100644 --- a/src/main/org/apache/tools/ant/types/CommandlineJava.java +++ b/src/main/org/apache/tools/ant/types/CommandlineJava.java @@ -239,7 +239,9 @@ public class CommandlineJava implements Cloneable { c.vmCommand = (Commandline) vmCommand.clone(); c.javaCommand = (Commandline) javaCommand.clone(); c.sysProperties = (SysProperties) sysProperties.clone(); - c.classpath = (Path) classpath.clone(); + if (classpath != null) { + c.classpath = (Path) classpath.clone(); + } c.vmVersion = vmVersion; return c; } diff --git a/src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java b/src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java index b46829d7d..6c9a8a72e 100644 --- a/src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java +++ b/src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java @@ -92,9 +92,14 @@ public class CommandlineJavaTest extends TestCase { assertEquals("no classpath", "junit.textui.TestRunner", s[2]); assertEquals("no classpath", "org.apache.tools.ant.CommandlineJavaTest", s[3]); + try { + CommandlineJava c2 = (CommandlineJava) c.clone(); + } catch (NullPointerException ex) { + fail("cloning should work without classpath specified"); + } - c.createClasspath(project).setLocation(project.resolveFile("lib/core/junit.jar")); - c.createClasspath(project).setLocation(project.resolveFile("lib/ant.jar")); + c.createClasspath(project).setLocation(project.resolveFile("lib/optional/junit.jar")); + c.createClasspath(project).setLocation(project.resolveFile("bootstrap/lib/ant.jar")); s = c.getCommandline(); assertEquals("with classpath", 6, s.length); assertEquals("with classpath", "java", s[0]);