--- Jiong Wei <[EMAIL PROTECTED]> wrote:
> It is very common to track and display the current time/date during a
> long build process.
> this will help to diagnose the bottleneck of a build or even just for
> info.
>
> but i found that the <tstamp> task is hard to be used to achieve. even
> if I
> include the <tstamp/> many times, seems just the first one is effective.
> This may be related to the fact that in ANT, the value of a property
> can't be dynamically changed (is my understanding right???)
Wherever you currently have a <tstamp/>, replace it with an <antcall> to a
target that sets and prints the time. As an example (just to show how it
would work -- you wouldn't need the 'sleep' stuff):
<target name="foo">
<antcall target="doTime"/>
<antcall target="doTime"/>
<antcall target="doTime"/>
</target>
<target name="doTime">
<tstamp>
<format property="now" pattern="d MMMM yyyy hh:mm:ss"/>
</tstamp>
<echo message="The time is now: ${now}"/>
<exec executable="sh">
<arg line="-c " sleep 3 ""/>
</exec>
</target>
Running 'ant foo' produces:
foo:
doTime:
[echo] The time is now: 25 April 2001 11:52:00
doTime:
[echo] The time is now: 25 April 2001 11:52:03
doTime:
[echo] The time is now: 25 April 2001 11:52:06
Diane
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/