ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Meakin" <>
Subject RE: Problem with default values
Date Tue, 06 Aug 2002 14:07:39 GMT
Well Im not sure what you're trying to do, but this is what I'd expect to
get from your code

your property file is defined as ${EllaRootBaseDir}/${my_prop_file}

but my_prop_file is defined as ${EllaRootBaseDir}/

so your property file is actually defined as:

which will explain the duplication.

you probably want to have a look at <condition> and <isset> for defaults:

i.e. suppose you pass -Dmyfile=some-file-on-your-HD

then you can set a default file if myfile fails the <isset> condition

something like:
<condition property="final_file" value="${myfile}">
  <isset property="myfile"/>
<condition property="final_file" value="some-default-file">
    <isset property="myfile"/>

(I may have got the syntax for isset wrong, I cant find it in my docs)

Hope this is of some help anywayz


-----Original Message-----
From: Christian Holmqvist, IT, Posten
Sent: 06 August 2002 02:58 PM
To: 'Ant Users List'
Subject: Problem with default values


I have a small problem...

I want to be able to change some values in a property file and use the name
of the file as input parameter to the ant script. But when no input
parameter is submitted I want default values to be used, also they in a
property file.

I been trying to do something like this:
  <property name="EllaRootBaseDir" value="${basedir}/.."/>
  <property name="my_prop_file"
  <property file="${EllaRootBaseDir}/${my_prop_file}"/>

But this don't work since the last property task gets totally strange
values.... (something liked d:\something\d:something\ )

Can someone help me?

/Christian Holmqvist

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message