ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Leme <>
Subject Running ant in loop mode
Date Sat, 16 Aug 2003 03:01:56 GMT
Hello all,

I submitted a patch recently on Ant's bugzilla, and I'd like to discuss it 
here in the list.

The initial idea would be to add a command line parameter (-loop) to ant, so 
it can run in loop mode. 

In this mode, once the tasks are finished, ant will wait for the user to press 
Enter to run the tasks again or q to quit (similar to incremental compilation 
on Jikes).

That would be pretty useful in situations where a task must be performed many 
times in a short period of time - like redeploying modified JSP pages to a 
web container: usually these task itself is almost instantaneous, but it 
takes about 5-6 seconds using the regular ant due to the overhead caused by 
the JVM invocation.

With this patch, the new tasks are executed really fast, as shown below:

ant -loop copy_web_oc4j
Buildfile: build.xml

     [copy] Copying 1 file to /home/felipeal/eInquiry/build/deploy/oc4j/CSNAPP

Total time: 2 seconds // first evocation, took 2 seconds

Press Enter to continue or q + Enter to quit

     [copy] Copying 1 file to /home/felipeal/eInquiry/build/deploy/oc4j/CSNAPP

Total time: 0 seconds // sub-sequent iterations: 0 seconds

Press Enter to continue or q + Enter to quit

I submitted a first patch yesterday (even though we'been been using it 
internally in my company for a couple of days) and talked with Antoine in 
private, and he pointed a valid issue: the patch was too simplistic. For 
instance, how would an IDE handle the calls?

So, even though most IDEs call ant in a particular way, I improved the patch a 
little bit: now the Main class has 2 new attributes, loopMode and 
loopHandler, which could be set by the IDEs. LoopHandler is a new interface, 
whose default implementation uses

So, what do you guys think of the patch? I think it would be really useful, 
and easy to implement (of course, if I didn't think so I wouldn't suggest it 
:-). If it is accepted, I could offer more help documenting and testing it 
(personally and with the participation of folks at my company and JUG).



PS: here is the enhancement's URL:

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

View raw message