2001-02-13 12:32:01 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
2005-03-07 18:09:10 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css"/>
|
2002-02-03 22:00:42 +00:00
|
|
|
<title>Apply Task</title>
|
2004-06-24 19:22:20 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
2001-02-13 12:32:01 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
2001-07-12 12:06:45 +00:00
|
|
|
<h2><a name="apply">Apply/<i>ExecOn</i></a></h2>
|
2002-04-18 14:59:19 +00:00
|
|
|
<p><i>The name <code>execon</code> is deprecated and only kept for backwards
|
|
|
|
compatibility.</i></p>
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Description</h3>
|
|
|
|
<p>Executes a system command. When the <i>os</i> attribute is specified, then
|
|
|
|
the command is only executed when Ant is run on one of the specified operating
|
|
|
|
systems.</p>
|
2005-01-25 22:13:47 +00:00
|
|
|
<p>The files and/or directories of a number of
|
|
|
|
<a href="../CoreTypes/fileset.html">FileSet</a>s,
|
|
|
|
<a href="../CoreTypes/dirset.html">DirSet</a>s
|
|
|
|
(<em>since Ant 1.6</em>) or
|
|
|
|
<a href="../CoreTypes/filelist.html">FileList</a>s
|
|
|
|
(<em>since Ant 1.6</em>)
|
|
|
|
are passed as arguments to the system command.</p>
|
|
|
|
<p>If you specify a nested <a href="../CoreTypes/mapper.html">mapper</a>,
|
2001-07-12 12:06:45 +00:00
|
|
|
the timestamp of each source file is compared to the timestamp of a
|
|
|
|
target file which is defined by the nested mapper element and searched
|
2005-01-25 22:13:47 +00:00
|
|
|
for in the given <i>dest</i>, if specified.</p>
|
|
|
|
<p>At least one fileset or filelist is required,
|
|
|
|
and you must not specify more than one mapper.</p>
|
2003-10-13 13:08:52 +00:00
|
|
|
|
|
|
|
<p>Note that you cannot interact with the forked program, the only way
|
|
|
|
to send input to it is via the input and inputstring attributes.</p>
|
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Parameters</h3>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">executable</td>
|
|
|
|
<td valign="top">the command to execute without any command line
|
|
|
|
arguments.</td>
|
|
|
|
<td align="center" valign="top">Yes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">dest</td>
|
2005-01-25 22:13:47 +00:00
|
|
|
<td valign="top">the directory where the command is expected to place
|
|
|
|
target files when it is executed. This attribute is valid only when used
|
|
|
|
in conjunction with a nested mapper; if omitted, the target filenames
|
|
|
|
returned by the mapper will be interpreted as absolute paths.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
2003-09-19 08:44:22 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">spawn</td>
|
2005-01-25 22:13:47 +00:00
|
|
|
<td valign="top">whether or not you want the commands to be spawned.<br />
|
|
|
|
If you spawn a command, its output will not be logged by ant.<br />
|
|
|
|
The input, output, error, and result property settings are not active when spawning a process.<br />
|
|
|
|
<em>since Ant 1.6</em>
|
2003-09-19 08:44:22 +00:00
|
|
|
</td>
|
2005-01-25 22:13:47 +00:00
|
|
|
<td align="center" valign="top">No, default is <i>false</i></td>
|
2003-09-19 08:44:22 +00:00
|
|
|
</tr>
|
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">dir</td>
|
|
|
|
<td valign="top">the directory in which the command should be executed.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
2001-11-21 17:20:29 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">relative</td>
|
|
|
|
<td valign="top">whether the filenames should be passed on the
|
2005-01-25 22:13:47 +00:00
|
|
|
command line as relative pathnames (relative to the base directory
|
|
|
|
of the corresponding fileset/list for source files or the
|
|
|
|
<i>dest</i> attribute for target files).</td>
|
2001-11-21 17:20:29 +00:00
|
|
|
<td align="center" valign="top">No, default is <i>false</i></td>
|
|
|
|
</tr>
|
2003-03-27 13:14:31 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">forwardslash</td>
|
2003-03-27 13:22:33 +00:00
|
|
|
<td valign="top">whether the file names should be passed
|
2003-03-27 13:14:31 +00:00
|
|
|
with forward slashes even if the operating system requires other
|
|
|
|
file separator. The option is ignored if the system file separator
|
|
|
|
is a forward slash.</td>
|
|
|
|
<td align="center" valign="top">No, default is <i>false</i></td>
|
|
|
|
</tr>
|
2001-02-13 12:32:01 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">os</td>
|
|
|
|
<td valign="top">list of Operating Systems on which the command may be
|
|
|
|
executed.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">output</td>
|
2003-09-19 08:44:22 +00:00
|
|
|
<td valign="top">the file to which the output of the command
|
|
|
|
should be redirected. If the error stream is not also redirected
|
|
|
|
to a file or property, it will appear in this output.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">error</td>
|
|
|
|
<td valign="top">The file to which the standard error of the
|
2005-01-25 22:13:47 +00:00
|
|
|
command should be redirected. <em>since Ant 1.6</em></td>
|
2003-09-19 08:44:22 +00:00
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">logError</td>
|
|
|
|
<td valign="top">This attribute is used when you wish to see error
|
|
|
|
output in Ant's log and you are redirecting output to a
|
|
|
|
file/property. The error output will not be included in the output
|
|
|
|
file/property. If you redirect error with the "error" or
|
|
|
|
"errorProperty" attributes, this will have no effect.
|
2005-01-25 22:13:47 +00:00
|
|
|
<em>since Ant 1.6</em></td>
|
2001-02-13 12:32:01 +00:00
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
2002-09-26 13:55:28 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">append</td>
|
|
|
|
<td valign="top">whether output should be appended to or overwrite
|
2005-01-25 22:13:47 +00:00
|
|
|
an existing file. If you set parallel to false, you will probably
|
|
|
|
want to set this one to true.</td>
|
|
|
|
<td align="center" valign="top">No, default is <i>false</i></td>
|
2002-09-26 13:55:28 +00:00
|
|
|
</tr>
|
2001-07-27 09:57:35 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">outputproperty</td>
|
2003-09-19 08:44:22 +00:00
|
|
|
<td valign="top">the name of a property in which the output of the
|
|
|
|
command should be stored. Unless the error stream is redirected
|
|
|
|
to a separate file or stream, this property will include the error
|
|
|
|
output.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">errorproperty</td>
|
|
|
|
<td valign="top">The name of a property in which the standard error of the
|
2005-01-25 22:13:47 +00:00
|
|
|
command should be stored. <em>since Ant 1.6</em></td>
|
2003-09-19 08:44:22 +00:00
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">input</td>
|
|
|
|
<td valign="top">A file from which the executed command's standard
|
|
|
|
input is taken. This attribute is mutually exclusive with the
|
2005-01-25 22:13:47 +00:00
|
|
|
inputstring attribute. <em>since Ant 1.6</em></td>
|
2003-09-19 08:44:22 +00:00
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">inputstring</td>
|
|
|
|
<td valign="top">A string which serves as the input stream for the
|
|
|
|
executed command. This attribute is mutually exclusive with the
|
2005-01-25 22:13:47 +00:00
|
|
|
input attribute. <em>since Ant 1.6</em></td>
|
2001-07-27 09:57:35 +00:00
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
2002-09-26 13:55:28 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">resultproperty</td>
|
|
|
|
<td valign="top">the name of a property in which the return code
|
|
|
|
of the command should be stored. Only of interest if
|
|
|
|
failonerror=false. If you set parallel to false, only the result
|
|
|
|
of the first execution will be stored.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
2001-02-13 12:32:01 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">timeout</td>
|
|
|
|
<td valign="top">Stop the command if it doesn't finish within the
|
|
|
|
specified time (given in milliseconds).</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">failonerror</td>
|
|
|
|
<td valign="top">Stop the buildprocess if the command exits with a
|
|
|
|
returncode other than 0.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
2002-09-26 13:55:28 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">failifexecutionfails</td>
|
|
|
|
<td valign="top">Stop the build if we can't start the program.
|
|
|
|
Defaults to true. </td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
2001-05-22 09:56:10 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">skipemptyfilesets</td>
|
|
|
|
<td valign="top">Don't run the command, if no source files have
|
|
|
|
been found or are newer than their corresponding target
|
2003-05-19 12:18:08 +00:00
|
|
|
files. Despite its name, this attribute applies to filelists as
|
|
|
|
well.</td>
|
2001-05-22 09:56:10 +00:00
|
|
|
<td align="center" valign="top">No, default is <i>false</i></td>
|
|
|
|
</tr>
|
2001-02-13 12:32:01 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">parallel</td>
|
|
|
|
<td valign="top">Run the command only once, appending all files as
|
2005-01-25 22:13:47 +00:00
|
|
|
arguments. If false, command will be executed once for every file.</td>
|
|
|
|
<td align="center" valign="top">No, default is <i>false</i></td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">type</td>
|
|
|
|
<td valign="top">One of <i>file</i>, <i>dir</i> or
|
|
|
|
<i>both</i>. If set to <i>file</i>, only the names of plain
|
|
|
|
files will be sent to the command. If set to <i>dir</i>, only
|
2005-01-25 22:13:47 +00:00
|
|
|
the names of directories are considered.<br />
|
2003-06-24 09:16:10 +00:00
|
|
|
<strong>Note:</strong> The type attribute does not apply to
|
|
|
|
nested <i>dirset</i>s - <i>dirset</i>s always implicitly
|
|
|
|
assume type to be <i>dir</i>.</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
<td align="center" valign="top">No, default is <i>file</i></td>
|
|
|
|
</tr>
|
2001-07-12 12:06:45 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">newenvironment</td>
|
|
|
|
<td valign="top">Do not propagate old environment when new environment
|
|
|
|
variables are specified.</td>
|
|
|
|
<td align="center" valign="top">No, default is <i>false</i></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">vmlauncher</td>
|
|
|
|
<td valign="top">Run command using the Java VM's execution facilities
|
|
|
|
where available. If set to false the underlying OS's shell,
|
|
|
|
either directly or through the antRun scripts, will be used.
|
|
|
|
Under some operating systems, this gives access to facilities
|
|
|
|
not normally available through the VM including, under Windows,
|
|
|
|
being able to execute scripts, rather than their associated
|
2002-06-22 23:38:38 +00:00
|
|
|
interpreter. If you want to specify the name of the
|
|
|
|
executable as a relative path to the directory given by the
|
|
|
|
dir attribute, it may become necessary to set vmlauncher to
|
|
|
|
false as well.</td>
|
2001-07-12 12:06:45 +00:00
|
|
|
<td align="center" valign="top">No, default is <i>true</i></td>
|
|
|
|
</tr>
|
2003-09-19 08:44:22 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">resolveExecutable</td>
|
|
|
|
<td valign="top">When this attribute is true, the name of the
|
|
|
|
executable if resolved firstly against the project basedir and if
|
|
|
|
that does not exist, against the execution directory if
|
|
|
|
specified. On Unix systems, if you only want to allow execution of
|
2005-01-25 22:13:47 +00:00
|
|
|
commands in the user's path, set this to false.
|
|
|
|
<em>since Ant 1.6</em></td>
|
2003-09-19 08:44:22 +00:00
|
|
|
<td align="center" valign="top">No, default is <i>false</i></td>
|
|
|
|
</tr>
|
2003-05-19 12:18:08 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">maxparallel</td>
|
|
|
|
<td valign="top">Limit the amount of parallelism by passing at
|
|
|
|
most this many sourcefiles at once. Set it to <= 0 for
|
2005-01-25 22:13:47 +00:00
|
|
|
unlimited. <em>Since Ant 1.6.</em></td>
|
|
|
|
<td align="center" valign="top">No, unlimited by default</td>
|
2003-05-19 12:18:08 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">addsourcefile</td>
|
|
|
|
<td valign="top">Whether source file names should be added to the
|
2005-01-25 22:13:47 +00:00
|
|
|
command automatically. <em>Since Ant 1.6.</em></td>
|
|
|
|
<td align="center" valign="top">No, default is <i>true</i></td>
|
2003-05-19 12:18:08 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">verbose</td>
|
|
|
|
<td valign="top">Whether to print a summary after execution or not.
|
2005-01-25 22:13:47 +00:00
|
|
|
<em>Since Ant 1.6.</em></td>
|
|
|
|
<td align="center" valign="top">No, default <i>false</i></td>
|
2003-05-19 12:18:08 +00:00
|
|
|
</tr>
|
2004-06-16 16:41:38 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">ignoremissing</td>
|
|
|
|
<td valign="top">Whether to ignore nonexistent files specified
|
2005-01-25 22:13:47 +00:00
|
|
|
via filelists. <em>Since Ant 1.6.2.</em></td>
|
2004-06-16 16:41:38 +00:00
|
|
|
<td align="center" valign="top">No, default is <i>true</i></td>
|
|
|
|
</tr>
|
2004-11-16 20:58:22 +00:00
|
|
|
<tr>
|
2004-11-16 21:46:46 +00:00
|
|
|
<td valign="top">force</td>
|
2004-11-16 20:58:22 +00:00
|
|
|
<td valign="top">Whether to bypass timestamp comparisons
|
2005-01-25 22:13:47 +00:00
|
|
|
for target files. <em>Since Ant 1.6.3.</em></td>
|
2004-11-16 20:58:22 +00:00
|
|
|
<td align="center" valign="top">No, default is <i>false</i></td>
|
|
|
|
</tr>
|
2001-02-13 12:32:01 +00:00
|
|
|
</table>
|
|
|
|
<h3>Parameters specified as nested elements</h3>
|
|
|
|
<h4>fileset</h4>
|
|
|
|
<p>You can use any number of nested <code><fileset></code>
|
|
|
|
elements to define the files for this task and refer to
|
|
|
|
<code><fileset></code>s defined elsewhere.</p>
|
2003-05-19 12:18:08 +00:00
|
|
|
<h4>filelist</h4>
|
2005-01-25 22:13:47 +00:00
|
|
|
<p><em>Since Ant 1.6</em></p>
|
2003-05-19 12:18:08 +00:00
|
|
|
<p>You can use any number of nested <code><filelist></code>
|
|
|
|
elements to define the files for this task and refer to
|
|
|
|
<code><filelist></code>s defined elsewhere.</p>
|
2003-06-24 09:16:10 +00:00
|
|
|
<h4>dirset</h4>
|
2005-01-25 22:13:47 +00:00
|
|
|
<p><em>Since Ant 1.6</em></p>
|
2003-06-24 09:16:10 +00:00
|
|
|
<p>You can use any number of nested <code><dirset></code>
|
|
|
|
elements to define the directories for this task and refer to
|
|
|
|
<code><dirset></code>s defined elsewhere.</p>
|
2004-01-22 18:41:28 +00:00
|
|
|
<h4>mapper</h4>
|
2005-01-25 22:13:47 +00:00
|
|
|
<p>A single <code><mapper></code> specifies the target files relative
|
|
|
|
to the <code>dest</code> attribute for dependency checking. If the
|
|
|
|
<code>dest</code> attribute is specified it will be used as a base directory
|
|
|
|
for resolving relative pathnames returned by the mapper. At least one
|
|
|
|
<code><fileset></code> or <code><filelist></code> is required.</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
<h4>arg</h4>
|
|
|
|
<p>Command line arguments should be specified as nested
|
|
|
|
<code><arg></code> elements. See <a
|
|
|
|
href="../using.html#arg">Command line arguments</a>.</p>
|
|
|
|
<h4>srcfile</h4>
|
|
|
|
<p>By default the file names of the source files will be added to the
|
2003-05-19 12:18:08 +00:00
|
|
|
end of the command line (unless you set addsourcefile to
|
|
|
|
<code>false</code>). If you need to place it somewhere different,
|
2001-02-13 12:32:01 +00:00
|
|
|
use a nested <code><srcfile></code> element between your
|
|
|
|
<code><arg></code> elements to mark the insertion point.</p>
|
|
|
|
<h4>targetfile</h4>
|
|
|
|
<p><code><targetfile></code> is similar to
|
|
|
|
<code><srcfile></code> and marks the position of the target
|
|
|
|
filename on the command line. If omitted, the target filenames will
|
2001-07-12 12:06:45 +00:00
|
|
|
not be added to the command line at all. This element can only be
|
2005-01-25 22:13:47 +00:00
|
|
|
specified if you also define a nested mapper.</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
<h4>env</h4>
|
|
|
|
<p>It is possible to specify environment variables to pass to the
|
|
|
|
system command via nested <code><env></code> elements. See the
|
|
|
|
description in the section about <a href="exec.html#env">exec</a></p>
|
2004-03-27 21:22:59 +00:00
|
|
|
<h4>redirector</h4>
|
2005-01-25 22:13:47 +00:00
|
|
|
<i><b>Since Ant 1.6.2</b></i>
|
2004-03-27 21:22:59 +00:00
|
|
|
<p>A nested <a href="../CoreTypes/redirector.html">I/O Redirector</a>
|
|
|
|
can be specified. <apply>'s behavior is like that of
|
|
|
|
<a href="exec.html#redirector">exec</a> with regard to
|
|
|
|
redirectors, with the exception that, in non-<i>parallel</i> mode,
|
|
|
|
file mapping will take place with each iteration. This grants the
|
|
|
|
user the capacity to receive input from, and send output to, different
|
2004-04-23 14:44:43 +00:00
|
|
|
files for each sourcefile.
|
2004-03-27 21:22:59 +00:00
|
|
|
</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Examples</h3>
|
|
|
|
<blockquote><pre>
|
2002-09-04 11:05:19 +00:00
|
|
|
<apply executable="ls">
|
2001-07-12 12:06:45 +00:00
|
|
|
<arg value="-l"/>
|
|
|
|
<fileset dir="/tmp">
|
|
|
|
<patternset>
|
|
|
|
<exclude name="**/*.txt"/>
|
|
|
|
</patternset>
|
|
|
|
</fileset>
|
|
|
|
<fileset refid="other.files"/>
|
|
|
|
</apply>
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>invokes <code>ls -l</code>, adding the absolute filenames of all
|
|
|
|
files below <code>/tmp</code> not ending in <code>.txt</code> and all
|
|
|
|
files of the FileSet with <code>id</code> <code>other.files</code> to
|
|
|
|
the command line.</p>
|
|
|
|
<blockquote><pre>
|
2002-09-04 11:05:19 +00:00
|
|
|
<apply executable="somecommand" parallel="false">
|
2001-07-12 12:06:45 +00:00
|
|
|
<arg value="arg1"/>
|
2001-09-30 13:21:54 +00:00
|
|
|
<srcfile/>
|
2001-07-12 12:06:45 +00:00
|
|
|
<arg value="arg2"/>
|
|
|
|
<fileset dir="/tmp"/>
|
|
|
|
</apply>
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>invokes <code>somecommand arg1 SOURCEFILENAME arg2</code> for each
|
|
|
|
file in <code>/tmp</code> replacing SOURCEFILENAME with the absolute
|
|
|
|
filename of each file in turn. If <code>parallel</code> had been set
|
|
|
|
to true, SOURCEFILENAME would be replaced with the absolute filenames
|
|
|
|
of all files separated by spaces.</p>
|
|
|
|
<blockquote><pre>
|
2001-02-13 12:32:01 +00:00
|
|
|
<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>
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>invokes <code>cc -c -o TARGETFILE SOURCEFILE</code> for each
|
|
|
|
<code>.c</code> file that is newer than the corresponding
|
|
|
|
<code>.o</code>, replacing TARGETFILE with the absolute filename of
|
|
|
|
the <code>.o</code> and SOURCEFILE with the absolute name of the
|
|
|
|
<code>.c</code> file.</p>
|
2004-03-27 21:22:59 +00:00
|
|
|
<blockquote><pre>
|
|
|
|
<mapper id="out" type="glob"
|
|
|
|
from="src${file.separator}*.file"
|
2004-11-19 09:07:12 +00:00
|
|
|
to="dest${file.separator}*.out"/>
|
2004-03-27 21:22:59 +00:00
|
|
|
|
|
|
|
<apply executable="processfile" dest="dest">
|
|
|
|
<fileset dir="src" includes="*.file"/>
|
2004-11-19 09:07:12 +00:00
|
|
|
<mapper refid="out"/>
|
2004-03-27 21:22:59 +00:00
|
|
|
<redirector>
|
2004-11-19 09:07:12 +00:00
|
|
|
<outputmapper refid="out"/>
|
2004-03-27 21:22:59 +00:00
|
|
|
</redirector>
|
|
|
|
</apply>
|
|
|
|
</pre></blockquote>
|
|
|
|
Applies the fictitious "processfile" executable to all
|
2005-01-25 22:13:47 +00:00
|
|
|
files matching <code>*.file</code> in the <code>src</code> directory.
|
|
|
|
The <code>out</code> <code><mapper></code> has been set up to map
|
|
|
|
<code>*.file</code> to <code>*.out</code>, then this <code><mapper></code>
|
|
|
|
is used to specify <code>targetfile</code>s for this <apply>
|
|
|
|
task. A reference to <code>out</code> is then used as an
|
2004-11-19 09:07:12 +00:00
|
|
|
<code><outputmapper></code> nested in a <code><redirector></code>, which in turn is
|
|
|
|
nested beneath this <code><apply></code> instance. This allows us to perform
|
2004-03-27 21:22:59 +00:00
|
|
|
dependency checking against output files--the target files in this case.
|
|
|
|
|
2005-01-25 22:13:47 +00:00
|
|
|
<hr><p align="center">Copyright © 2000-2005 The Apache Software Foundation. All rights
|
2001-02-13 12:32:01 +00:00
|
|
|
Reserved.</p>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|