ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: regexp-type <mapper> doesn't work as expected/(advertised?)
Date Mon, 12 Oct 2009 05:00:33 GMT
On 2009-10-09, Francis GALIEGUE <fge@one2team.com> wrote:

> <project name="testme" default="doit" basedir=".">

>         <target name="check">
>                 <uptodate property="noneed">
>                         <srcfiles dir="." includes="t.xml"/>
>                         <mapper type="regexp" from="xml$" to="txt"/>
>                 </uptodate>
>         </target>

means map anything that ends with "xml" to "txt" - no prefix here.

> Say that t.txt doesn't exist. The first time the file is run, then it
> is created. So far, so good, that's what is expected.

> run ant -v, here's what I see in the output:

> ---
> check:
>  [uptodate] t.xml added as txt doesn't exist.
> ----

Note it says "txt", not "t.txt".

You want

  <mapper type="regexp" from="(.*)xml$" to="\1txt"/>

or even just

  <mapper type="glob" from="*.xml" to="*.txt"/>

Stefan

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


Mime
View raw message