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 Fri, 16 Oct 2009 04:20:23 GMT
On 2009-10-12, Francis GALIEGUE <fge@one2team.com> wrote:

> On Mon, Oct 12, 2009 at 07:00, Stefan Bodewig <bodewig@apache.org> wrote:
>> 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.


> Err, so what? A regex isn't supposed to match its whole input!

Not in general, but what I described is how the regex mapper works and
how it is documented to work.  The target file name is constructed from
the to pattern exclusively.  Any not-matched part of the file name or
any part not explicitly added to the target file name via group
references will be ignored.

This may not be what you expected, but it is how the mapper works.

Stefan

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


Mime
View raw message