ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Riffe, Melvin" <melvin.ri...@capitalone.com>
Subject RE: property value as property name
Date Mon, 26 Aug 2002 12:38:59 GMT
for ==>     <echo message="${${webmodule.name}.dir}"/>

you can use ant-contrib's <propertycopy>:

  <propertycopy name="webmodule.dir" from="${webmodule.name}.dir" />

you should supply a name for the new property that makes sense to you.

Thanks to Erik and an example posted earlier ;-)

HTH

Mel Riffe


-----Original Message-----
From: Koegel, Michael [mailto:Michael.Koegel@partner.commerzbank.com]
Sent: Monday, August 26, 2002 8:04 AM
To: Ant Users List (E-Mail)
Subject: property value as property name


Hi,

is it possible to use a properties value as a property name?
I'd like to specify a number of WAR-Directories in a list and read
properties for each of them from a properties file und use <foreach> to
build them.

    <target name="war">
    	<taskdef name="foreach"
classname="net.sf.antcontrib.logic.ForEach"/>
    	<foreach list="${webmodule.list}" target="testForEach"
param="webmodule.name" inheritAll="true"/>
    </target>
    
    <target name="testForEach">
        <echo message="${webmodule.name}"/>
==>     <echo message="${${webmodule.name}.dir}"/>
    </target>

build.properties:

webmodule.list = App1, App2
App1.dir = abc
App1.vhost = vhost1
App2.dir = xyz
App2.vhost = vhost2

Is there a better/other way to achieve what I need to do?

--MK


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
 
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.

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


Mime
View raw message