You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Hagen, Christian" <ch...@init-ka.de> on 2004/02/13 17:06:25 UTC

Using property in regexp mapper

Hi,

I have the following problem (ANT 1.6.0, Windows 2000) with copy using a
mapper:

I have a property file, which is loaded first:

prod.A.target = targetA
prod.B.target = targetB
prod.C.target = targetC


The copying should do the following:

src/prod/A/config/configA.xml  -->
target/${prod.A.target}/config/configA.xml
src/prod/B/config/configB.xml  -->
target/${prod.B.target}/config/configB.xml


I tried to copy it with a mapper:

<copy preservelastmodified="true" verbose="true" todir="target">
  <fileset dir="src"/>
  <mapper type="regexp" from="prod/(.*)/config/(.*)"
to="${prod.\1.target}/config/\2"/>
</copy>


It does not work telling me: "Property ${prod.\1.target} has not been
set".

Does this mean the property is resolved before inserting the regexp
group?
Does anybody know another way to do the copying?



Thanks in advance.

Chris

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


Re: Using property in regexp mapper

Posted by Matt Benson <gu...@yahoo.com>.
--- "Hagen, Christian" <ch...@init-ka.de> wrote:
> It does not work telling me: "Property
> ${prod.\1.target} has not been
> set".
> 
> Does this mean the property is resolved before
> inserting the regexp
> group?

Yes.

> Does anybody know another way to do the copying?
> 

Try using some of the custom tasks provided by
ant-contrib; probably <for> and <propertycopy> or
<propertyregex>.

-Matt


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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