ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Newbie ant question
Date Thu, 20 Mar 2003 14:02:07 GMT
On Thu, 20 Mar 2003, Norman Walsh <ndw@nwalsh.com> wrote:

> Yes, I understand that, I'm just wondering if there's some simpler
> ant idiom for expressing the conditionality of a target.

In general tasks are supposed to do the dependency checking.  <copy>
does so and it works for it.  <replace> will not touch your file if
there was nothing to replace - unfortunately there will always be
something to replace in your case.

The "simpler idiom" in this case probably would be a filterreader that
performed the replacements you need while copying the files.  This
would give you several benefits as you'd get the dependency tracking
working and the files wouldn't have to be openend, read, written and
closed three times.

Unfortunately there isn't such a replace-filter built-in into Ant
(yet), but several people have asked for it, both a simple and a
regular expression version.

Stefan

Mime
View raw message