Getting Ant Build Updates Via Growl

November 25, 2009 by Jim · 2 Comments 

I have a few build scripts that take some time to run and I hate staring at the Eclipse console to see how things are progressing.  I've heard of Growl before and today decided to see if I could make this work to popup notices during my build.

Growl is originally for the Mac but there is a port for Windows aptly named Growl For Windows.  Download and install.  I also added the install path to my Windows PATH so I can run the growlnotify script from the command line.

Once you've done this you can verify it's working by popping open a DOS box and typing:

C:> growlnotify "THIS IS A TEST"

And you should get a popup:

Growl Popup

Growl Popup

Next you'll need to grab a few things so you can interact with Growl from Ant...

Download growlbuildlistener

An Ant BuildListener that displays notifications via Growl/JGrowl

Follow the installation instructions (in the wiki section).

This simply involves downloading two files that contain jar files - you'll need:

  • the growllistener jar  (growllistener.jar)
  • the JGrowl jar (binaryblizzard.jar) (from JGrowl)

Drop those in your Ant lib folder, and in Eclipse make sure those jars are added to your classpath (Ant Home Entries).

Next you will need to add a listener so Ant can use the GrowlBuildListener.  Run the following line from a command prompt:

set ANT_ARGS=-listener net.slimeslurp.growl.GrowlListener

Next I had to add a new taskdef line to my build script:

<taskdef name="growl" classname="net.slimeslurp.growl.GrowlEcho"/>

And now you should be able to drop in a new GrowlEcho task in your build file wherever you want a popup to occur.

<growl message="Kicking off build of ${projectname}"/>

Now when I kick off my scripts I see something like this:

Growl Example

Growl Example

I did this mainly for fun but I can see some applicable uses for this. Growl also looks neat because it appears you can configure it to push notices over the network. So in theory I could setup everyone on my team with Growl and when someone kicked off a build we could all be notified.

If you come up with a creative use for this please let me know in the comments!

Possibly Related:

Comments

2 Responses to “Getting Ant Build Updates Via Growl”
  1. John Hodorowicz says:

    Good stuff! I definitely like the idea of notifications over the network. I’ll have to check this out.

  2. Aaron Cox says:

    I swear to you John, if I start getting pop-ups from your willy-nilly deployments….

Tell us what you're thinking...