ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: Programmatically stopping build
Date Mon, 25 Mar 2002 23:29:59 GMT

----- Original Message -----
From: "Gordon Tyler" <gordon.tyler@sitraka.com>
To: "Ant User List" <ant-user@jakarta.apache.org>
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:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message