ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Burkley Frederick G NPRI <Burkle...@Npt.NUWC.Navy.Mil>
Subject RE: build events
Date Thu, 15 Jun 2000 15:48:49 GMT
It would be very nice to kick off a build and email developers about success
of failure of the build.  Would something like this be possible?

Fred Burkley

-----Original Message-----
From: Vitaly Stulsky [mailto:vitaly_stulsky@yahoo.com]
Sent: Thursday, June 15, 2000 11:36 AM
To: ant-dev@jakarta.apache.org
Subject: RE: build events


Really interesting. It would be nice for me as additional testing feature
and may be it will be useful for GUI
notification purposes.

Vitaly

> -----Original Message-----
> From: mpfoemme@ThoughtWorks.com [mailto:mpfoemme@ThoughtWorks.com]
> Sent: Thursday, June 15, 2000 1:39 AM
> To: ant-dev@jakarta.apache.org
> Subject: build events
>
>
> I've made a few changes to Ant for my project here, and I'd like some
> feedback on whether its worth cleaning up and submitting as a patch.
> Basically, we needed a way to generate an XML file with a summary of what
> errors happened during the build. To do this cleanly, I ended up
> implementing event/listener classes so that one can add listeners to a
> project and be notified when various things happen. The classes look
> something like:
>
> public class BuildEvent extends java.util.EventObject {
>      public Project getProject();
>      public Target getTarget();
>      public Task getTask();
>      public Throwable getException();
>      public String getMessage();
>      public int getMessageLevel();
> }
>
> public interface BuildListener extends java.util.EventListener {
>      public void buildStarted(BuildEvent event);
>      public void buildFinished(BuildEvent event);
>
>      public void targetStarted(BuildEvent event);
>      public void targetFinished(BuildEvent event);
>
>      public void taskStarted(BuildEvent event);
>      public void taskFinished(BuildEvent event);
>
>      public void messageLogged(BuildEvent event);
> }
>
> public class Project {
>      public void addBuildListener(BuildListener listener);
>      ...
> }
>
> Then I simply defined an XmlLogger class that dumped whatever XML I wanted
> into a file, and added it as a listener to the Project. I was also able to
> move all of the "user interface" code for Ant (ie all of the out.println
> ()'s) into Main.java so that it was all in one place by making it a
> BuildListener. The makes the rest of the code cleaner if we want to create
> a gui version of Ant, say. It also makes it easy to create listeners to do
> profiling, debugging, etc...
>
> Is this worth pursuing?


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Mime
View raw message