From e2dfffecc55b55682f0ad2e43bb84ce1324b7216 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 1 Dec 2000 15:27:13 +0000 Subject: [PATCH] Documentation for tasks that can have a nested element. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268286 13f79535-47bb-0310-9956-ffa450edef68 --- docs/index.html | 59 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 7 deletions(-) diff --git a/docs/index.html b/docs/index.html index 51fb78d79..38662afd1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1558,7 +1558,8 @@ To use a fileset, the todir attribute must be set.

flatten Ignore directory structure of source directory, copy all files into a single directory, specified by the todir - attribute. Defaults to "no". + attribute. Defaults to "no". Note that you can achieve the + same effect by using a flatten mapper No @@ -1568,6 +1569,12 @@ To use a fileset, the todir attribute must be set.

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

@@ -1595,6 +1602,14 @@ To use a fileset, the todir attribute must be set.

<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

@@ -3662,7 +3677,8 @@ to move to the todir directory.

flatten ignore directory structure of source directory, copy all files into a single directory, specified by the todir - attribute (default is "false"). + attribute (default is "false").Note that you can achieve the + same effect by using a flatten mapper No @@ -3672,6 +3688,12 @@ to move to the todir directory.

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)

@@ -3696,6 +3718,16 @@ to move to the todir directory.

</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

@@ -4470,11 +4502,17 @@ initialization target.


Uptodate

Description

-

Sets a property if a Target file is more up to date than a set of +

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.

-

The value part of the property being set is true if the timestamp of the -Target file is more recent than the timestamp of every Source file.

+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

@@ -4492,7 +4530,8 @@ execution depending on the relative age of the specified files.

targetfile the file for which we want to determine the status. - Yes + Yes, unless a nested mapper element is + present.

Examples

@@ -4501,6 +4540,12 @@ execution depending on the relative age of the specified files.

</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