ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Holmqvist, IT, Posten" <christian.holmqv...@posten.se>
Subject SV: Problem with default values
Date Tue, 06 Aug 2002 14:22:41 GMT
It did the trick!

Thank you!

/Christian

> -----Ursprungligt meddelande-----
> Från: Geoff Meakin [mailto:geoffm@isocra.com]
> Skickat: den 6 augusti 2002 16:08
> Till: Ant Users List
> Ämne: RE: Problem with default values
> 
> 
> 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}/default.properties
> 
> so your property file is actually defined as:
> ${EllaRootBaseDir}/${EllaRootBaseDir}/default.properties
> 
> 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>
> <condition property="final_file" value="some-default-file">
>   <not>
>     <isset property="myfile"/>
>   </not>
> </condition>
> 
> (I may have got the syntax for isset wrong, I cant find it in my docs)
> 
> Hope this is of some help anywayz
> 
> -Geoff
> 
> 
> 
> -----Original Message-----
> From: Christian Holmqvist, IT, Posten
> [mailto:christian.holmqvist@posten.se]
> Sent: 06 August 2002 02:58 PM
> To: 'Ant Users List'
> Subject: Problem with default values
> 
> 
> Hi
> 
> 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"
> value="${EllaRootBaseDir}/default.properties"/>
>   <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:   
<mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>



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

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


Mime
View raw message