diff --git a/WHATSNEW b/WHATSNEW index 2778c3819..814b56093 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -19,7 +19,7 @@ Other changes: * A GUI Frontend: Antidote. This is currently in development. * New tasks: stylebook, propertyfile, depend, antlr, telnet, csc, - ilasm, transform, javah, several clearcase tasks + ilasm, apply, javah, several clearcase tasks * Added output attribute to . @@ -39,7 +39,7 @@ Other changes: * New data type that can be used to get influence on the target files for some tasks like or enable new types of tasks - like . + like . * provides more control over the command line now, the names of the source files are no longer required to be at the end of the diff --git a/docs/index.html b/docs/index.html index 4e436846c..066e70a28 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1382,6 +1382,7 @@ cannot be found, try jakarta-regexp.
  • Ant
  • AntCall
  • AntStructure
  • +
  • Apply
  • Available
  • Chmod
  • Copy
  • @@ -1418,7 +1419,6 @@ cannot be found, try jakarta-regexp.
  • Tar
  • Taskdef
  • Touch
  • -
  • Transform
  • Tstamp
  • Unjar
  • Untar
  • @@ -1547,6 +1547,123 @@ listed as #IMPLIED.

    <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. Defaults to true. If false, command will be executed + once for every file.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 @@ -4917,123 +5034,6 @@ modification time to the current time.

    modification time to Jun, 28 2000 2:02 pm (14:02 for those used to 24 hour times).


    -

    Transform

    -

    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. Defaults to true. If false, command will be executed - once for every file.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

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

    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.

    -

    Tstamp

    Description

    Sets the DSTAMP, TSTAMP and TODAY properties in the current project. The diff --git a/src/main/org/apache/tools/ant/taskdefs/defaults.properties b/src/main/org/apache/tools/ant/taskdefs/defaults.properties index d0a56c7ef..fd428c80d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/defaults.properties +++ b/src/main/org/apache/tools/ant/taskdefs/defaults.properties @@ -42,7 +42,7 @@ mail=org.apache.tools.ant.taskdefs.SendEmail fail=org.apache.tools.ant.taskdefs.Exit war=org.apache.tools.ant.taskdefs.War uptodate=org.apache.tools.ant.taskdefs.UpToDate -transform=org.apache.tools.ant.taskdefs.Transform +apply=org.apache.tools.ant.taskdefs.Transform # optional tasks script=org.apache.tools.ant.taskdefs.optional.Script