ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ditrick, Gregory" <gregory.ditr...@fmr.com>
Subject RE: Concatenating a string to a property
Date Fri, 16 Mar 2007 16:06:40 GMT
Mike,

I use antcontrib tasks to do this.  The tasks <propertycopy>,
<propertyregex> and <propertyselect> are very useful to do this.

http://ant-contrib.sourceforge.net/

Put it in it own namespace.  I generally do this:

<project basedir="." default="init" name="SCM" xmlns:ac="sf.antcontrib">
......
    <taskdef resource="net/sf/antcontrib/antlib.xml"
uri="sf.antcontrib"/>
......
     <ac:propertycopy name="port.number"
 
from="remote.jboss.jndi.port.${remote.jboss.server}"
			    override="true" />


Hope this helps.

GregD
859-386-8309


-----Original Message-----
From: Mike Stewart [mailto:MStewart@mgtplc.com] 
Sent: Friday, March 16, 2007 11:56 AM
To: user@ant.apache.org
Subject: Concatenating a string to a property


Hi,

I am trying to get a value from a property that is defined in the
build.properties file - 

remote.jboss.jndi.port.server1=17031
remote.jboss.server=server1

The remote.jboss.server varies depending on which client is being
built, I tried the definition below but it is performing text
substitution.

<property name="port.number"
value="remote.jboss.jndi.port.${remote.jboss.server}" />
<echo message="the port number is ${port.number}        
${remote.jboss.jndi.port.server1}" />


When run via Ant the output is 

the port number is remote.jboss.jndi.port.b4usony         17031

Any ideas on how to get the value?

Mike S.

---------------------------------------------------------------------
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


Mime
View raw message