ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <>
Subject Re: Using shell command in ANT script
Date Mon, 29 Nov 2010 14:49:48 GMT
On Mon, Nov 29, 2010 at 1:22 AM,  <> wrote:
> The shell command which I wanted to incorporate on my ANT script is only a part of lengthy
> command in actual I wanted to write the content of a folder in a file with “/*” suffix
and “jobs/”
>  as prefix to each entry, so say a directory contains following folders
> Abc
> Def
> Ghi
> Jkl
> Above contents in my txt file should look like this:
> Jobs/Abc/*
> Jobs/Def/*
> Jobs/Ghi/*
> Jobs/Jkl/*
> And so on

Ah! You should look into "Mappers". A mapper can take a list of file
names, and convert them into other names. This can be used as part of
the copy process, or in selecting folders for a fileset.

Take a look at the <globmapper> at
<> and see if that does
what you need. You could use the <regexmapper> which allows for more
powerful name transformations, but the <globmapper> is easier to use
and is good enough for 90% of this type of situations. (And look,
there's an example of using a Mapper in a <pathconvert> task!)

Using "Mappers" is a bit esoteric and most Ant users aren't experts at
them. And, most users would include me personally. I usually have to
futz with them for a while to get them to do what I want, and I have
to do a lot of heavy referencing with the on line manual. If you play
around with "Mappers" enough in order to get them to work, you'll be
one of the experts here and can help answer my questions.

If you need any help, please feel free to post here, and let us know
what you finally were able to do. It'll be a learning experience for
all of us on this list.

David Weintraub

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message