ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: Target Name in Build Listener
Date Thu, 27 Sep 2001 20:51:37 GMT
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" <kadams@gfs.com>
To: <ant-dev@jakarta.apache.org>
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



Mime
View raw message