You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ba...@uswest.com on 2001/05/11 19:12:08 UTC
Quick newbie question
Hello
Very quick question to people who used exec/execOn/apply.
I would like to know that is major difference b/n these 3 methods, the doc
is not very clear on it.
If anyone can point pro/cons of each method, i would really appreciate it.
thank you
boris
Re: Quick newbie question
Posted by Stefan Bodewig <bo...@apache.org>.
<ba...@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