ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject New task <transform> committed
Date Thu, 23 Nov 2000 15:42:55 GMT
As mailing of the commit messages currently doesn't work:

I've committed two things today: (1) I've modified <execon> to give the
user more control over the placement of the source file name and (2)
I've committed a new task named transform.

Both features have not been documented yet (partly because <transform>
relies on <mapper> and this one hasn't been documented either 8-).

Ad (1):

<execon> now supports a nested <srcfile/> element which doesn't have
any attributes. This one does only work properly if you use nested
<arg> elements instead of the args attribute.

<execon executable="foo">
  <arg value="bar" />
  <srcfile />
  <arg value="baz" />

  <fileset dir="pling" />
</execon>

will execute the command "foo bar XYZ baz" for each file XYZ in the
directory pling. If no <srcfile/> has been specified, the filenames
are appended to the end - this is the old behavior of <execon>.

Ad (2):

<transform> is similar to <execon> in a way. It invokes a given
command on a couple of files. This task should be used for executables
that produce yet another file (_transform_-ing the source file) as it
will only invoke the command for source files that are newer than
their corresponding target files.

For example

<transform executable="gcc" dest="${build}/obj">
  <arg value="-c" />
  <arg value="-O2" />
  <arg value="-o" />
  <targetfile />
  <srcfile />

  <fileset dir="src/C" />
  <mapper type="glob" from="*.c" to="*.o" />
</transform>

will compile all C files from the directory src/C to object files in
${build}/obj that are newer than the files compiled on previous runs.

Stefan

Mime
View raw message