ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kees van Dieren" <>
Subject Fileset, mapper, copy and duplicate files: which is selected?
Date Thu, 11 Jan 2007 09:30:07 GMT
Hi all,
We use Filesets and regex mappers to select files for copying. How does Ant
decide, which file to take in case of duplicates? I hoped that this was on
modification date, however, this seems to be not always true, in most cases
it does but in some, it does not (unpredicable in which).
Example of what we do (very much simplified)
 <fileset dir="../" id="module-fileset"  >
        <include name="module1/war/file1.html**"/>
        <include name="module1/war/file2.html**"/>
        <include name="module2/war/file1.html**"/>
        <include name="module2/war/file3.html**"/>
This fileset is generated, dependant of module existance for this project.
Regular expression mapper:
 <mapper id="module-war-mapper"  type="regexp" from="^[a-z|\-]+/war/(.*)"
to="\1" />
We copy the files the folowing way:
  <copy todir="${build.war.dir}">
   <fileset refid="module-fileset" />
   <mapper refid="module-war-mapper" />
The result of this copy action, is that in ${build.war.dir}, three files
What we need to reach, is that if module2 is not in the fileset, file1 from
module1 is taken; however, when module2 exists, file1.html from module2 must
be taken.
The file1.html in module 1 is never modified (it's just a dummy file), so
file1.html in module2 is always newer (last modified timestamp is later).
How can we make sure that, if module2 exists, it picks up the file1.html
from module2?
Thanks in advance!
Best regards,

Kees van Dieren
Masterlands IT Solutions

Mobile: +31 (0)6-30413841
MSN / Google Talk:  <>


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message