diff --git a/WHATSNEW b/WHATSNEW index 905d9cec1..7d0d49961 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -16,7 +16,7 @@ the filtering attribute. org.apache.tools.ant to org.apache.tools.ant.types. * the class attributes of , , and -has been removed. +have been removed. * the src attribute of has been removed. @@ -31,10 +31,9 @@ behavior has been dropped. Other changes: -------------- -* New tasks: antstructure, cab, ftp, genkey, junit, sql. +* New tasks: antstructure, cab, execon, ftp, genkey, junit, sql. -* New tasks mparse, execon. All pending documentation, most of -them pending review. +* New tasks mparse pending documentation. * uses ClassLoader of its own in no-fork mode if a classpath is specified. diff --git a/docs/index.html b/docs/index.html index b6ef8eba6..de202c5cd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -232,6 +232,9 @@ command. This example assumes you have set up your classpath to include

Writing a simple buildfile

The buildfile is written in XML. Each buildfile contains one project.

+

Each 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.

Projects

A project has three attributes:

@@ -507,6 +510,46 @@ that contain space characters, nested elements can be used.

is a single command line argument with 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

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

could be rewritten as

+
+<rmic ...>
+  <classpath ID="project.class.path">
+    <pathelement location="lib/" />
+    <pathelement path="${java.class.path}/" />
+    <pathelement path="${additional.path}" />
+  </classpath>
+</rmic>
+<javac ...>
+  <classpathref refid="project.class.path" />
+</javac>
+
+

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 instance, the

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 <patternsetref -refid="non.test.sources" /> by tasks that support -this feature or by FileSets.

+can be referred to via +<patternsetref refid="non.test.sources" +/> by tasks that support this feature or by FileSets.

FileSets

FileSets are groups of files. These files can be found in a directory tree starting in a base directory and are matched by @@ -2084,6 +2127,12 @@ the one that is currently running Ant.

+ + + + + + + + + + + + + + + @@ -2268,12 +2331,14 @@ supports all attributes of <fileset><include>, <exclude>, <patternset> and <patternsetref> elements.

-

src, classpath, bootclasspath and extdirs

+

src, classpath, classpathref, bootclasspath, bootclasspathref and extdirs

Javac's srcdir, classpath, bootclasspath and extdirs attributes are PATH like structure and can also be set via nested src, classpath, bootclasspath and -extdirs elements respectively.

+extdirs elements respectively. PATHs defined elsewhere can be +referred to via nested classpathref +and bootclasspathref elements.

Examples

  <javac srcdir="${src}"
@@ -2361,7 +2426,15 @@ instead.

- + + + + + + @@ -2406,6 +2479,21 @@ instead.

+ + + + + + + + + + + + @@ -2618,6 +2706,14 @@ instead.

+ + + + + + @@ -2634,14 +2730,11 @@ instead.

the classpath to use. No
classpathrefthe classpath to use, given as reference to a PATH defined elsewhere.No
fork if enabled triggers the class execution in another VM @@ -2123,10 +2172,12 @@ the one that is currently running Ant.

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

-

classpath

+

classpath and classpathref

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

+classpath element. PATHs defined elsewhere can be +referred to via nested classpathref +elements.

Example
  
        <java classname="test.Main" >
@@ -2231,6 +2282,18 @@ inclusion/exclusion of files works, and how to write patterns.

location of bootstrap class files. No
classpathrefthe classpath to use, given as reference to a PATH defined elsewhere.No
bootclasspathreflocation of bootstrap class files, given as by reference to a PATH defined elsewhere.No
extdirs location of installed extensions. sourcepath Specify where to find source files allYesAt least one of the two or nested + <sourcepath> or + <sourcepathref>
sourcepathrefSpecify where to find source files by reference to a PATH defined elsewhere.all
destdir 1.2 No
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
Extdirs Override location of installed extensions 1.2 No
docletpathrefSpecifies the path to the doclet class file that + is specified with the -doclet option by reference to a PATH defined elsewhere.1.2No
additionalparam Lets you add additional parameters to the javadoc command line. Useful for doclets

Parameters specified as nested elements

-Two parameters of the Javadoc task may be specified as nested elements of the -Javadoc task element: link and group. -When present, there can be any number of each of these elements. -They perform the same role as the link, linkoffline and -group attributes. You can use either syntax (or both at once), but with the nested -elements you can easily specify multiple occurrences of the arguments.

link

-Create link to javadoc output at the given URL +

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

@@ -2669,9 +2762,12 @@ Create link to javadoc output at the given URL
-

groups

-Separates packages on the overview page into whatever groups you specify, -one group per table. +

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.

@@ -2691,12 +2787,15 @@ one group per table.
-

sourcepath, classpath and bootclasspath

+

sourcepath, classpath, bootclasspath, sourcepathref, classpathref +and bootclasspathref

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

+respectively. PATHs defined elsewhere can be referred to via nested sourcepathref, +classpathref and bootclasspathref elements.

Example

  <javadoc packagenames="com.dummy.test.*"
@@ -3059,6 +3158,12 @@ elements.

The classpath to use during compilation No + + classpathref + The classpath to use during compilation, given as reference to a PATH defined elsewhere + No + includes comma separated list of patterns of files that must be @@ -3097,10 +3202,12 @@ elements.

Parameters specified as nested elements

-

classpath

+

classpath and classpathref

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

+classpath elements. PATHs defined elsewhere can be +referred to via nested classpathref +elements.

Examples

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

runs the rmic compiler for the class com.xyz.FooBar. The