----- Original Message ----- From: "Gordon Tyler" <[EMAIL PROTECTED]> To: "Ant User List" <[EMAIL PROTECTED]> Sent: Monday, March 25, 2002 11:41 AM Subject: Programmatically stopping build
> Hi, > > I'm writing a tool called AntShell which provides a command shell-like > interface to Ant where target names are commands that can be executed to > start a build of that target. The tool has been implemented similarly to the > normal Ant Main class, i.e. it uses the Project class, etc. directly. > > One of the features I would like to implement is to allow the user to press > a key-combination to interrupt the current build without interrupting > AntShell (as Ctrl-C would do). However, I am having difficulty figuring out > exactly how to stop Ant's current build as initiated by > Project.executeTarget(). > > I could start the build on a new Thread and use Thread.stop() but that's > severely deprecated and for good reasons too. I could use Thread.interrupt() > but there are no points (that I could find) in the Ant build code path that > check for InterruptedException or Thread.isInterrupted and I've actually > written some test code that uses this and it definitely doesn't work. > > Any suggestions? How is the Ant GUI handling this? I dont think they do. how about adding a Project.canceRun property which can be set async, which Project polls between tasks and exits with some cancelled run exception if it is hit. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
