ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: expanding properties in custom task
Date Mon, 01 Sep 2003 05:46:18 GMT
String nestedText;
public void addText(String theText) {
    nestedText = getProject().replaceProperties(theText);
}


The getProject() is implemented in class Task. Maybe you want to look
at org.apache.tools.ant.Project. There are some other interesting
methods ...


A good hint is looking into the source of other tasks. E.g. for use
of EnumeratedAttributes or logging <echo>, for executing other (native)
programs <exec>, working with filesets <copy>, ...



Jan



> -----Original Message-----
> From: Jon Madison [mailto:jon@tfftech.com]
> Sent: Friday, August 29, 2003 8:28 PM
> To: Ant Users List
> Subject: expanding properties in custom task
> 
> 
> sorry if i missed this--i guess a pointer would be helpful: 
> 
> from the manual on creating a task:
> ---
>  If the task should support character data (text nested 
> between the start end end tags), write a public void 
> addText(String) method. Note that Ant does not expand 
> properties on the text it passes to the task. 
> ---
> 
> unfortunately i don't see anywhere else it explains how to 
> make this the case. how would i handle any properties to 
> expand them? does Ant have any built-in facilities readily 
> available for this?
> 
> thanks!
> 
> j.
> 
> ---
> Jon Madison
> Consultant, Thought For Food Tech, LLC
> http://www.tfftech.com/
> http://jon.madisons.com/
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message