ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Radha Sangal" <Radha.San...@pega.com>
Subject RE: retrive value in listener
Date Fri, 28 Jan 2005 17:39:49 GMT
U r right! But my project requirements are that I need to access
(manipulate) value of a variable (attribute of the task-'message') used
in the custom task I had created through Java. 

-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com] 
Sent: Thursday, January 27, 2005 6:14 PM
To: Ant Users List
Subject: RE: retrive value in listener

You don't do that. A listener listens to what tasks print or log, and
takes that string and meta-data about where it's coming from, to decide
what to do with it. It has no business introspecting the event's source
Task or Type for its attributes or nested elements, even if it can be
done.

Anyways... --DD

> -----Original Message-----
> From: Radha Sangal [mailto:Radha.Sangal@pega.com]
> Sent: Thursday, January 27, 2005 5:07 PM
> To: Ant Users List
> Subject: retrive value in listener
> 
> This might not be specific to ant, but if someone has implemented this
,
> how do we retrieve a value from the custom task made in listener
> 
> 
> 
> Eg.
> 
> 
> 
> In xml : <newtask message="Hello World! NewTask works!"/>
> 
> 
> 
> In listener: something similar to this , this one doesn't work ...
> 
> public void messageLogged( BuildEvent event )
> 
>       {
> 
>             RuntimeConfigurable aRC =
> event.getTask().getRuntimeConfigurableWrapper();
> 
>             AttributeList hTable = aRC.getAttributes();
> 
>             String message =
>
event.getProject().replaceProperties((String)hTable.getValue("message"))
> ;
> 
>             System.out.println( "A Message: " + message );
> 
>       }
> 
> 


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


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


Mime
View raw message