You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "thapelo.kekana" <th...@tsctech.com> on 2011/06/15 16:03:32 UTC
Ant properties
---------- 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
Re: Ant properties
Posted by wolfgang haefelinger <wh...@gmail.com>.
Also ab damit in unsere Sammlung der "Klassiker" und wie man diese mit
Flaka angeht .. !
On Wed, Jun 15, 2011 at 4:03 PM, thapelo.kekana
<th...@tsctech.com> wrote:
> ---------- 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
>
>
--
Wolfgang Häfelinger
häfelinger IT - Applied Information Technology
http://www.haefelinger.it
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org