ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Russell" <>
Subject Re: Thinking in Ant...
Date Tue, 05 Oct 2004 11:26:35 GMT
>From my reading of the documentation, <concat> doesn't allow nested 

I tried using <for> and <var>, but found that I couldn't do much with 
<var>, as it appeared that the only way I could set the var was with the 
<var> task, and I needed to use functionality in <propertycopy> to get 
double-redirection. I can't *quite* recall why this didn't work, but it 
didn't. If you like, I'll try to recreate what I was trying to do, and see 
if I can demonstrate the problem I had...

I'm not sure what <pathconvert> can do for me here... A mapper sounds more 
useful (eg <globmapper from="${dir1}/*" to="${dir2}/*"/>), but I don't think it can
be used with <concat> ...

I keep coming across things that i could really use, but they can never be 
combined in the way I want.


Richard Russell 
Deutsche Bank AG London 
Global Markets Customer Solutions
Office: +44 (0)20 7545 8060
Mobile: +44 (0)79 0661 2237

Matt Benson <>
10/04/2004 09:16 PM
Please respond to "Ant Users List"

        To:     Ant Users List <>
        Subject:        Re: Thinking in Ant...

As a matter of curiosity, whenever a nested
<redirector> element gets added to <concat>, a builtin
solution will exist to the given problem.  My personal
workaround would use ant-contrib's <for> and <var>
with <concat> and <pathconvert>...


--- Stefan Bodewig <> wrote:

> On Mon, 4 Oct 2004, Richard Russell
> <> wrote:
> > I run into these issues so regularly that I cannot
> help but assume
> > that I am simply not 'thinking in Ant', and am
> therefore fighting
> > against its design rather than working with it.
> Sounds like it.
> One of the major points seems to be that you want to
> drive the
> execution instead of having ant make the decisions. 
> You usually don't
> code loops in Ant but use a task that will
> implicitly perform the
> loop.
> > for file in `ls ${dir1}/*.DAT`; do 
> >   cat ${dir1}/${file} | sed -e
> 's/@parameter@/value/' >>
> >   ${dir2}/${file}
> > done
> translates into a single <copy> with a nested
> <replactokens> if it
> wasn't for the second ">".  There isn't any append
> mode in <copy>.  Is
> this a real world requirement?  Must be, otherwise
> you wouldn't have
> written a task for it.
> If you can express it as a shell script, you can
> always use <exec> or
> <apply>, but then your platform independence has
> gone.
> Ant really isn't the best fit if your process is
> extremely procedural,
> it usually isn't even though your experience says it
> is in you case.
> The main mismatch I really see is that you want to
> express yourself in
> loops while Ant wants to work on collections.
> Stefan
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do you Yahoo!?
Declare Yourself - Register online to vote today!

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

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

View raw message