ant-user mailing list archives

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

----- Original Message -----
From: "Gordon Tyler" <>
To: "Ant User List" <>
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
> 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
> a key-combination to interrupt the current build without interrupting
> AntShell (as Ctrl-C would do). However, I am having difficulty figuring
> 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
> but there are no points (that I could find) in the Ant build code path
> 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:   <>
For additional commands, e-mail: <>

View raw message