ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koch Michael" <>
Subject Order of mappers in chainedmapper seems to depend on how they are defined
Date Wed, 02 Aug 2006 11:58:51 GMT

I've noticed that apparently the order in which mappers are added to the
list of a <chainedmapper> depends on whether the mappers are defined as
<mapper type="..."> or <...mapper>. Mappers defined in the first way are
executed after the other mappers even if they appear earlier in the build
file. This seems like a bug to me, or am I overseeing something? I've tested
my buildfile with Ant 1.6.5. If this a new bug, I could file a bug report.

Here is an example build.xml which demonstrates the behaviour:

<?xml version="1.0" encoding="UTF-8"?>
<project name="demo" default="test">
    <target name="test">
        <touch file="" />

        <copy todir=".">
            <fileset file="" />
               The chainedmapper renames -> -> test.baz
               Contrary to the order in the build file, the second mapper
               is executed first and the result is fed to the first mapper.
               This is because apparently "*mapper"s are added to the mapper
               chain before the "mapper type=" mappers.
               If both mappers are defined as globmapper or as mapper
               the copy task fails (as one would expect) because the first
               does not produce a filename.
                <mapper type="glob" from="*.bar" to="*.baz" />
                <globmapper from="*.foo" to="*.bar" />

Michael Koch

View raw message