ant-user mailing list archives

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

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="test.foo" />

        <copy todir=".">
            <fileset file="test.foo" />
            <!--
               The chainedmapper renames test.foo -> test.bar -> 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
type="glob",
               the copy task fails (as one would expect) because the first
mapper
               does not produce a filename.
             -->
            <chainedmapper>
                <mapper type="glob" from="*.bar" to="*.baz" />
                <globmapper from="*.foo" to="*.bar" />
            </chainedmapper>
        </copy>
    </target>
</project>

Regards,
Michael Koch

Mime
View raw message