On Thu, Jul 23, 2009 at 02:55, Hans Dockter<[email protected]> wrote:
> Hi,
>
> I'm thinking about the best way to implement stopping a Gradle build.
>
> One way to do it would be to add a type BuildController. A instance of this
> can be optionally passed to the Gradle.run method. The TaskExecuter and the
> Task will be associated with an instance of BuildController. If the state of
> the build controller is changed to stop, the TaskExecuter, Task, etc can
> react upon this and will throw eventually a BuildInterruptedException. This
> is a pretty intrusive approach. It has the additional draw back, that every
> task needs to be smart about this to make it work well. For example a task
> that delegates to an Ant task must wait with stopping the build until the
> Ant task has finished.
>
> Another way of doing this is to still add a type BuildController. You can
> send a StopEvent to the BuildController. We have a separate Thread that
> receives this StopEvent. If it is received, the Thread running the Gradle
> build will be stopped.
>
> Thoughts?
>
> - Hans
>
> --
> Hans Dockter
> Gradle Project Manager
> http://www.gradle.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
Wouldn't the second approach still have the same drawback as the first
in regards to Ant tasks? At least if you wanted to shut down
gracefully and cleanup after the shutdown (closing connections,
streams, etc).
I do like the idea of issuing a stop command to an already running
build, like sending the stop command to tomcat. That would give a
more graceful exit and means of stopping a build that gets out of
control than using ^C.
--
Jason Porter
Real Programmers think better when playing Adventure or Rogue.
PGP key id: 926CCFF5
PGP fingerprint: 64C2 C078 13A9 5B23 7738 F7E5 1046 C39B 926C CFF5
PGP key available at: keyserver.net, pgp.mit.edu
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email