ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "thapelo.kekana" <thapelo.kek...@tsctech.com>
Subject Ant properties
Date Wed, 15 Jun 2011 14:03:32 GMT
---------- Forwarded Message -----------


Hi,

I have a issue retrieving a value for a dynamically created property.
Below I'm trying generate property 'dngesb' dynamically and then
retrieve value for it from property file.
Ant file:

<project name="test" default="testdb" basedir=".">

	<property file="test.properties" />

	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
		<classpath>
			<pathelement
location="${basedir}/lib/ant-contrib-1.0b3.jar" />
		</classpath>
	</taskdef>

	<target name="testdb">
		<var name="dbname" value="${environment}${country}esb"/>
		<echo>parameter dbname =  ${dbname}</echo>
		<echo>value of dbname = ${${dbname}}</echo>
	</target>
</project>

Property file:

environment=d
country=ng
dngesb=NALLESB
dnaesb=AALLESB
dafresb=FALLESB

Output:
testdb:
     [echo] parameter dbname =  dngesb
     [echo] value of dbname = ${${dbname}}


Thapelo Kekana
TSC Technologies (Pty) Ltd 
(o) +27(11) 431 1667 
(c) +27(71) 397 0647 
Email: thapelo.kekana@tsctech.com 
http://www.tsctech.com


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


Mime
View raw message