ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Murray" <brian.c.mur...@vanderbilt.edu>
Subject Please clarify a point about properties
Date Tue, 02 Apr 2002 15:53:58 GMT
I'm trying to set up a precedence for setting properties as follows:
command-line-->environment-->file. 
In searching the archives for some information about setting properties
I saw the following statement which didn't seem accurate to me:

>> I would like to define default properties in a
>> property file and then "override" them from the
>> environment. I have found two mechanisms for
>> accomplishing this. The first is to use the
>> <condition> clause, the second is to use "if"
>> and "unless" attributes on targets that do <property>
>> tasks.
>>
> <property environment="env"/>
> <property name="my.desired.prop" value="${env.WHATEVER}"/>
> <property file="default.properties"/>
>
> then define my.desired.prop in default.properties.  It will be
"overridden"
> (which is a weird term, when its actually being set first instead of
being
> overwritten).


Now I'm fuzzy on the whole property thing, but it seems like
  <property name="my.desired.prop" value="${env.WHATEVER}"/>
Would set "my.desired.prop" to the STRING "${env.WHATEVER}" if WHATEVER
was not a defined environment variable.  Therefore, any attempt to set
"my.desired.prop" in the "default.properties" file would fail because
"my.desired.prop" would already be set.  

Am I off base?

Brian Murray
Vanderbilt University

Brian Murray
Vanderbilt University


--
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