ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Vromans CPWR <johan.vrom...@nl.compuware.com>
Subject Getting task info in build listener
Date Wed, 28 Apr 2004 10:11:31 GMT
While playing with build listeners, I noticed that in the taskStarted 
method I can query event.getTask(), but it will always return an 
UnknownElement class. What is the appropriate way to get a the real task?

E.g.,

   public void taskStarted(BuildEvent event) {
     Task t = event.getTask();
     printMessage("TASK " + t.getTaskName() + " STARTED", ...);
     // This will always print UnknownElement.
     printMessage("TASK CLASS " + t.getClass().getName(), ...);
     // So this fails...
     if ( t instanceof SomeSpecialTask ) ...
   }

Thanks,
	Johan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message