You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Steve Allan <st...@wrq.com> on 2003/02/11 22:51:42 UTC

How to detect missing files when copying from a list of files?

I'm having a recurring problem which I haven't been able to solve
in Ant. As an example, say I have a file manifest which contains 
all the files I expect to have in my distribution. I copy that to a 
staging directory with copy and fileset:

<copy todir = "${stage.dir}">
  <fileset dir = "${build.dir}" includesfile = "${file.lst}"/>
</copy>

The problem is that if there are files in ${file.lst} that are missing
(perhaps never built), fileset throws them out and copy never knows
anything about them. It seems like <filelist> would solve that
problem, because it would pass all the file names to <copy>, and then
<copy> would complain about the missing ones. But <copy> won't accept
a filelist. I really need the task to fail if any file in ${file.lst}
is not found in ${build.dir}. 

Is there a cookbook solution to this problem?

-- Steve __