ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ninju Bohra <>
Subject Re: Running a task between this hour and this hour
Date Tue, 13 Sep 2005 19:17:02 GMT
One way is to use the <tstamp> task with a custom pattern to contain only the hour (in
24hour format).  Then using the <if> task (from the ant-contrib project) along with
the a condition (like the <isLessThan> and <isGreaterThan> also from ant-contrib
or write your own <isInBetween>) to control the setting of a property (called "isLateNight")
Do all the above in a depends target and protect the worker targets with if=isLateNight
I think that makes sense,
Ninju wrote:

Running the stats on our code is a rather lenghty process (currently +/-70 minutes)...
I therefore consider to run the targets only at night.
Would someone have an hint on how to evaluate the current time and set a flag if it is between
: 10 PM and 6:00 AM ?



Any fool can write code that a computer can understand. 
Good programmers write code that humans can understand.
Martin Fowler 
T. : +32 (0)2 742 05 94
M. : +32 (0)497 44 68 12
@ :
Do you skype too ... ?

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

Yahoo! for Good
 Click here to donate to the Hurricane Katrina relief effort. 
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message