You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Pablo Garralda <PG...@amtec.net> on 2000/08/01 21:14:46 UTC

setting properties from a User defined Task.

Hi !!

I'm trying to build a user defined Task to store a directory listing into a
Property. 
Someting like this: 

  ...
  <target name="Test" depends="" >
      <dirlisting basedir="." includes="*.java" property="ppp" separator=" "
/>
      <echo message="Java files: ${ppp}" />
  </target>
  ...

This prints:

  Java files: ${ppp}

It don't replace ${ppp} with "ppp" value!!! What's wrong? 

Thanks in advance,
		Pablo.



    

RE: setting properties from a User defined Task.

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Pablo,

The problem is that the property substitution happens before any tasks are
executed. Currently ant cannot do what you are asking. Perhaps you can tell
us how you wish to use the ppp value. There may be other mechanisms within
ant that you can use.

Conor

--
Conor MacNeill
conor@cortexebusiness.com.au
Cortex eBusiness
http://www.cortexebusiness.com.au

> -----Original Message-----
> From: Pablo Garralda [mailto:PGarralda@amtec.net]
> Sent: Wednesday, 2 August 2000 5:15
> To: ant-user@jakarta.apache.org
> Subject: setting properties from a User defined Task.
>
>
>
> Hi !!
>
> I'm trying to build a user defined Task to store a directory
> listing into a
> Property.
> Someting like this:
>
>   ...
>   <target name="Test" depends="" >
>       <dirlisting basedir="." includes="*.java" property="ppp"
> separator=" "
> />
>       <echo message="Java files: ${ppp}" />
>   </target>
>   ...
>
> This prints:
>
>   Java files: ${ppp}
>
> It don't replace ${ppp} with "ppp" value!!! What's wrong?
>
> Thanks in advance,
> 		Pablo.
>
>
>
>
>