next up previous contents index
Next: Available Up: Apply/ExecOn Previous: Parameters   Contents   Index

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. This element can only be specified, if you also define a nested mapper and the dest attribute.

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

Examples

<apply executable="ls">
  <arg value="-l"/>
  <fileset dir="/tmp">
    <patternset>
      <exclude name="**/*.txt"/>
    </patternset>
  </fileset>
  <fileset refid="other.files"/>
</apply>
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.
<apply executable="somecommand" parallel="false">
  <arg value="arg1"/>
  <srcfile/>
  <arg value="arg2"/>
  <fileset dir="/tmp"/>
</apply>
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.
<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.


next up previous contents index
Next: Available Up: Apply/ExecOn Previous: Parameters   Contents   Index
Andrew Marlow 2003-07-08