ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Quick newbie question
Date Mon, 14 May 2001 09:31:45 GMT
<babramo@uswest.com> wrote:

> Very quick question to people who used exec/execOn/apply.  I would
> like to know that is major difference b/n these 3 methods,

<exec> simply executes a system command - you have to specify all
arguments explicitly.  For example, you'd start a server with this
task.

<execon> invokes the same system command on a set of files, you
specify these files as a fileset - for each file found in the fileset,
execon will construct a command line argument (where you've placed the
<srcfile/> element).  You can have multiple executions of the command
(each taking a single file from your set) or a single execution with
all files listed at once (controlled by the parallel attribute).  For
example you'd invoke "chmod" with a task like this, to change the file
mode of a couple of files.

<apply> is very similar to <execon>, but it works on two filesets, a
source fileset and a target.  You use this command, when your
executable creates/modifies files (the target files) based on other
files (your source file set).  Only source files, that are newer than
the corresponding target files will be passed to the executable.
Target file names get calculated by using a mapper.  For example,
you'd use <apply> to run a C compiler - this task wouldn't do anything
if all your object files were newer than your C source files.

Stefan

Mime
View raw message