ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <>
Subject Re: Target Name in Build Listener
Date Thu, 27 Sep 2001 20:51:37 GMT

The buildFinished method does not send a target, just the project object.

If you want to catch the target that last executed or something like that,
you'll want to do that in targetStarted or targetFinished.


----- Original Message -----
From: "Kyle Adams" <>
To: <>
Sent: Thursday, September 27, 2001 1:36 PM
Subject: Target Name in Build Listener

I've modified the BuildMonitor from the Ant FAQ in order to include the
Target name in the e-mail subject.  Here's the pertinent line of code (e is
the BuildEvent passed to the buildFinished method):

  message.setSubject(status.toUpperCase() + ": " +
    e.getProject().getName() + "," +

Right now this gets me a NullPointerException instead of an e-mail.  If I
remove e.getTarget().getName(), the e-mail gets sent all hunky dory.  I want
to confirm if it's not possible to get the target name from the event, or if
I'm just making a mistake.


View raw message