Based on http://ant.apache.org/manual/Types/mapper.html
Here’s my target:
<target name="ms.copy-example">
<copy todir="${ms.custom}">
<fileset dir="${ms.example}">
<include name="build.xml" />
</fileset>
<scriptmapper language="javascript">
self.addMappedName("dir1/"+source);
self.addMappedName("dir2/"+source);
self.addMappedName("dir3/"+source);
</scriptmapper>
</copy>
</target>
I’m trying to copy one file to three places. I don’t have to use a ‘scriptmapper’ to do this, but I didn’t see any other way to do it. What’s happening, though, is that it’s only copying the file into the first directory in the list (dir1) and not the other two (dir2, dir3).
Anyone suggestions?
The
scriptmapperis working, but by default, thecopytask only copies to one (i.e. the first mapped) target.To get your example to work, add
enablemultiplemappings="true"or similar to the copy:From the docs for
copytask optionenablemultiplemappings: