You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by mm <mm...@seznam.cz> on 2003/05/06 17:54:51 UTC

load property from refid

Hello,

I'm trying to load properties from more property files with this:

<path id="properties.path">
    <fileset dir="somewhere">
        <include name="**/*.properties"/>
    </fileset>
</path>
<property refid="properties.path">

Documentation says:
      refid Reference to an object defined elsewhere. Only yields reasonable
results for references to PATH like structures or properties.


Ant says:
You must specify file, resource or environment when not using the name
attribute

What am I doing wrong?
Thanks for your help
Mirek Mocek


Re: load property from refid

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 6 May 2003, mm <mm...@seznam.cz> wrote:

> I'm trying to load properties from more property files with this:

There is no way to do that with a single <property> task, sorry.

You'll either have to use multiple <property> tasks or revert to
<script> or writing a task to do what you want.

Stefan

Re: load property from refid

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 7 May 2003, Jens Skripczynski <sk...@myrealbox.com>
wrote:

> so your code needs to look like:
> <property name="xxx" refid="properties.path">
> 
> this should make ant happy, but what the refid actually specifies i
> don't know.

Technically: it sets the property xxx to 
(whatever properties.path points to).toString().

In case of references to path constructs this will set the property to
a string representation of the <path> suitable as a path like
environment variable on the OS you are using (i.e. all
files/directories in the path separated by colon and using forward
slashes on Unix - semicolon backslashes on Windows).

Stefan

Re: load property from refid

Posted by Jens Skripczynski <sk...@myrealbox.com>.
Hi,

you mean you have files:
file1.properties
file2.properties
file3.properties 

and want to load all files with something like: 
  <property file="*.properties"> ?

As far as I understand the manual you need to supply some
name for the Property set:
"One of these (value|location|refid) when using the name attribute".

so your code needs to look like:
<property name="xxx" refid="properties.path">

this should make ant happy, but what the refid actually specifies i don't know.


mm:
> I'm trying to load properties from more property files with this:
> 
> <path id="properties.path">
>     <fileset dir="somewhere">
>         <include name="**/*.properties"/>
>     </fileset>
> </path>
> <property refid="properties.path">

> Documentation says:
>       refid Reference to an object defined elsewhere. Only yields reasonable
> results for references to PATH like structures or properties.
> 
> Ant says:
> You must specify file, resource or environment when not using the name
> attribute
> 
> What am I doing wrong?
> Thanks for your help
> Mirek Mocek

Ciao

Jens Skripczynski
-- 
E-Mail: skripi-lists(at)myrealbox(dot)com

Life is what happens to you while you're busy making other plans.
                                   -- John Lennon