ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Qustion about property prefix...
Date Tue, 02 May 2006 20:17:14 GMT
Looks like you've got prefix backwards.  When you set
env to localhost and load this file, you should end up
with property settings:

localhost.localhost.host=localhost
localhost.qa.host=qatest.domain.com

Ordinarily you would probably set up
localhost.properties and qa.properties files, and use
your env property to trigger which file to load:

localhost.properties:
host=localhost

qa.properties:
host=qatest.domain.com

Alternatively, you could copy the property after
loading them (without prefixes).  See
http://ant.apache.org/faq.html#propertyvalue-as-name-for-property

HTH,
Matt

--- Trent Ohannessian <tohann@gmail.com> wrote:

> Hello.  I'm trying to use the <property> task with a
> prefix.  Here is the
> code I'm using:
> 
> ------------------------------------------
>     <property file="./webtest.properties"
> prefix="${env}" />
>     <echo message="host: ${host}" />
> ------------------------------------------
> 
> And here is the properties file I'm trying to load:
> 
> ------------------------------------------
> localhost.host=localhost
> qa.host=qatest.domain.com
> 
> localhost.port=8080
> qa.port=80
> ------------------------------------------
> 
> When I use the prefix property option, none of the
> properties are read and
> they are not usable in the Ant script.  What I'm
> trying to do is pass in a
> property on the command line and then use the
> correct set of properties
> based on server.  I can see the localhost getting
> passed into the Ant script
> correctly, but it doesn't work even if I hardcode
> localhost into prefix="".
>   Is this the right way to go about doing this?
> 
> Thanks!
> Trent
> 
> --
> Learn from the mistakes of others. You can't live
> long enough to make them
> all yourself.
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message