Kyle,

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.

    Erik


----- Original Message -----
From: "Kyle Adams" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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() + "," +
    e.getTarget().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.

Kyle


Reply via email to