You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2000/11/23 16:42:55 UTC

New task committed

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

Re: New task committed

Posted by Stefan Bodewig <bo...@apache.org>.
Jon Stevens <jo...@latchkey.com> wrote:

> on 11/23/2000 7:42 AM, "Stefan Bodewig" <bo...@apache.org> wrote:
> 
> I'm not sure I like <transform> as a name cause other tasks like
> <style> are doing essentially the same thing that you are suggesting
> the name <transform> is for.

Actually I was thinking of <jtransform> and <javaon> tasks to
accompany <execon> and <transform> - removing the overhead of forking
a new VM you'd have when using <execon> of <transform> for Java based
transformations. <style> (and maybe even <javac>) should be made
subclasses of <jtransform> after that IMHO.

> 
> Why not:
> 
> <execon transform="true">

I'd like to keep these task separate as they are doing quite different
things. While <execon> really acts on all files, <transform> only
works on a - well defined - subset of them. Of course I'm not sticking
to the name <transform> for "the other task", it just seemed to
describe the intended use cases quite well.

Stefan

Re: New task committed

Posted by Jon Stevens <jo...@latchkey.com>.
on 11/23/2000 7:42 AM, "Stefan Bodewig" <bo...@apache.org> wrote:

> <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.

I'm not sure I like <transform> as a name cause other tasks like <style> are
doing essentially the same thing that you are suggesting the name
<transform> is for.

Why not:

<execon transform="true">

?

-jon

-- 
twice of not very much is still a lot more than not very much