ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rich Wagner" <richmwag...@hotmail.com>
Subject "destroy"-ing an Ant exec doesn't destroy what Ant is "exec"-ing...
Date Mon, 07 Apr 2003 00:06:35 GMT
Hi,

I've developed a simple Java-based GUI for invoking Ant.  That GUI uses 
"Runtime.exec" to run Ant in "Process" objects.  The GUI also includes a 
"Stop" button which executes the "destroy" method on the currently executing 
Ant process.

That much works fine.  However, say my GUI invokes Ant and it, in turn, uses 
the "exec" task to run another Process.  (In my particular case, my build 
file is using "exec" to run a Windows-based "build.exe" command-line build 
utility for creating an InstallAnywhere installer: each build is lengthy and 
consumes much of the available processor resources.)

If I hit the "Stop" button while my Ant build file is in the middle of 
"exec"-ing that "build.exe" sub-Process, the "destroy" call *DOES* kill Ant, 
but Ant does not - in turn - "destroy" the "build.exe" sub-process.  (As a 
result, even though I hit "Stop", I have to wait several minutes for the 
"build.exe" sub-process to terminate normally - or I can use the quite 
user-unfriendly method of manually killing the "build.exe" sub-Process 
myself...)

My guess is Ant isn't even given an oppurtunity to respond to "destory" and 
do pre-"destroy" cleanup when the Ant Process before quitting.  But I'm not 
sure if that's really the case, or if Ant *COULD* potentially "catch" some 
Throwable ("ThreadDeath" ?) that occurs as a part of the "destroy" call, and 
handle the situation more correctly by in turn destroying the "build.exe" 
sub-process before Ant gives up the ghost.  (In other words, is this an 
"Ant" bug?  Can it do anything between a "destroy" of it and it's own 
destruction ?)

Anyway, details aside, is there maybe a different way (other than "exec") 
that I can run "Ant" so that my GUI can stop BOTH Ant AND anything 
sub-Process it's in the middle of "exec"-ing ?

Thanks,
Rich Wagner


_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


Mime
View raw message