You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Lasher, James L" <ji...@hp.com> on 2005/10/19 21:22:59 UTC

indirect property evaluation

Hello all,

I have the following property file that I want to load in my project:

db.system=solid

# ------------------- for Solid ----------------
testfw.solid.system=Solid

testfw.dbvar.system=testfw.${db.system}.system
testfw.db.system=${testfw.dbvar.system}


In my build.xml file, after loading the properties file, I would like
the result of:

	<echo message="testfw.db.system = ${testfw.db.system}"/>

To be:
	testfw.db.system = Solid

Instead of:
	Testfw.db.system = testfw.solid.system

Is it possible to do this "double" evaluation?

Thanks in advance,
-jim-

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


Re: indirect property evaluation

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
A simple <scriptdef> can do that.

- Alexey.

Lasher, James L wrote:
> Hello all,
>
> I have the following property file that I want to load in my project:
>
> db.system=solid
>
> # ------------------- for Solid ----------------
> testfw.solid.system=Solid
>
> testfw.dbvar.system=testfw.${db.system}.system
> testfw.db.system=${testfw.dbvar.system}
>
>
> In my build.xml file, after loading the properties file, I would like
> the result of:
>
> 	<echo message="testfw.db.system = ${testfw.db.system}"/>
>
> To be:
> 	testfw.db.system = Solid
>
> Instead of:
> 	Testfw.db.system = testfw.solid.system
>
> Is it possible to do this "double" evaluation?
>
> Thanks in advance,
> -jim-
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>   

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


Re: indirect property evaluation

Posted by Juergen Hermann <jh...@web.de>.
On Wed, 19 Oct 2005 12:59:47 -0700 (PDT), Matt Benson wrote:

>This should "just work," in a properties file,
>according the the <property> manual page.  If not you
>should file a bug report.

Nothing in the docs indicates that evaluation happens as long as no futher 
replacement is possible, and that nested vars are expanded first. In practise, 
things just work as in buildfiles, where "double" eval isn't done either.


Ciao, Jürgen



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


Re: indirect property evaluation

Posted by Matt Benson <gu...@yahoo.com>.
--- "Lasher, James L" <ji...@hp.com> wrote:
[SNIP]
> I have the following property file that I want to
> load in my project:
> 
> db.system=solid
> 
> # ------------------- for Solid ----------------
> testfw.solid.system=Solid
> 
> testfw.dbvar.system=testfw.${db.system}.system
> testfw.db.system=${testfw.dbvar.system}
> 
> 
> In my build.xml file, after loading the properties
> file, I would like
> the result of:
> 
> 	<echo message="testfw.db.system =
> ${testfw.db.system}"/>
> 
> To be:
> 	testfw.db.system = Solid
> 
> Instead of:
> 	Testfw.db.system = testfw.solid.system
> 
> Is it possible to do this "double" evaluation?

This should "just work," in a properties file,
according the the <property> manual page.  If not you
should file a bug report.

Thanks,
Matt

> 
> Thanks in advance,
> -jim-



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

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