ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Brunson <chuck.brun...@sun.com>
Subject Re: Use properties in regular expressions
Date Mon, 14 Oct 2002 15:04:54 GMT
Shawn Wilson wrote:

> Hi,
> 
> I'm using the <replaceregexp> tag and I'm wondering if I can refer to a 
> property value within the 'replace' attribute of the tag. I don't see 
> any mention in the documentation about how this might be accomplished, 
> if it can at all.
> 
> Thanks,
> -shawn
> 

Sure, here's an example:

<replaceregexp file="${testx.tomcat_base}/conf/server.xml"
       match="@port"
       replace="${testx.tomcat_port}"
       flags="g"/>

We read in the testx vals from a file in the user's homedir like
this:
testx.propsfile:     ${user.home}/testx.properties
<property file="${testx.propsfile}"/>

And then we use those to replacements like the one above. testx
is just an identifier we use for tests that require something
else running like tomcat.


-- 
					Chuck Brunson
					x56912
					719-277-6912
					charles.brunson@sun.com
					AIM: chuck9206


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