ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike McNally>
Subject Re: Newbie ant question
Date Thu, 20 Mar 2003 14:02:41 GMT
> No, this target
>   <target name="dm-example.xml.cdata">
>     <echo message="Building CDATA version of dm-example.xml ..." />
>     <copy file="dm-example.xml" tofile="dm-example.xml.cdata"/>
>     <replace file="dm-example.xml.cdata" token="&amp;" value="&amp;amp;"/>
>     <replace file="dm-example.xml.cdata" token="&lt;" value="&amp;lt;"/>
>   </target>
> still gets executed every time. 

It's the <copy> task that does the work of dependency checking, so yes,
the target will allways be "executed".

> But the replacements occur over and
> over again. 

Use <uptodate> to set up a relationship between the source of the
copy and the result, and then you can wrap your <replace> tasks
inside another target whose evaluation is predicated on the property
set by your <depends>

[ you are my main foo ] Mike McNally --

View raw message