ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: Trying (and failing) to build the nightly snapshot
Date Mon, 04 Aug 2008 13:47:56 GMT
EJ Ciramella wrote:
> I think I misunderstood this particular bug.  It appears to be a problem
> with $${someprop} versus loading two property files and the first one
> containing a ${property} that is set in the second one loaded.
> 
> To be explicit, if you have two property files, a.properties and
> b.properties, in the first one loaded you have a ${property} that is set
> in b.properties, ant leaves it as ${}.
> 
> a.properties:
> 
> foo=bar
> 
> coolprop=${foo}:${from.b.properties}
> 
> 
> 
> 
> 
> b.properties:
> 
> from.b.properties=awesome
> 
> 
> 
> 
> build.xml:
> 
> <project default="go">
>     <target name="go" >
> 	<property file="a.properties" />   
>       <property file="b.properties" />
>         <echo>This is a problem: ${coolprop}</echo>
>     </target>
> </project>
> 
> You'll see this:
> 
> This is a problem: bar:${from.b.properties}

That's because property expansion takes place when the properties files 
are loaded. If you want properties from b.properties, load it before 
a.properties




-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message