ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Faustinelli <marco_faustine...@yahoo.com>
Subject Re: FileNameMapper implementation gets invoked twice inside a <chainedmapper>
Date Mon, 03 May 2010 14:15:40 GMT
Stefan,
Thank you for the quick and exhaustive answer. What you recall matches what I see.
I have to be careful.

Have a nice day,
Marco

 

________________________________
From: Stefan Bodewig <bodewig@apache.org>
To: user@ant.apache.org
Sent: Mon, May 3, 2010 3:53:42 PM
Subject: Re: FileNameMapper implementation gets invoked twice inside a <chainedmapper>

On 2010-05-03, Marco Faustinelli <marco_faustinelli@yahoo.com> wrote:

> I have written a FileNameMapper that gets invoked during the run of a
> <copy> task. What puzzles me is that the mapper is invoked TWICE per
> each file handled by the copy task, whereas I request only ONE
> invocation.

I don't think Ant makes any guarantees about how often it may want to
invoke a mapper.

From the top of my head - I'd have to look into the code to be sure -
the mapper is invoked once when Ant determines which files to copy at
all (to provide the target for timestamp comparisons) and once when the
file is actually copied.

Please note that it gets invoked during the "what needs to be copied
anyway" phase even for files that won't be copied later at all.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message