tags:

views:

116

answers:

1

I have a fileset element in a build file that is defined as:

<fileset id="fileset" basedir=".">
    <include name="test.txt"/>
    <include name="missing.txt"/>
</fileset>

When this runs (as part of a copy task), it does not complain if any of the files are missing. Whilst I can use failonempty="true" in the fileset element, this only fails if both files are missing.

I can achieve this by making multiple filesets with failonempty="true" set, each one containing a single file, but this feels clunky. This is also a maintenance problem if there are lots of required files.

Is there any way of making nant complain if any of the files in the fileset are missing? If this is not possible, is there another way of achieving the same effect?

+2  A: 

Add attribute asis="true":

<fileset id="fileset" basedir=".">
  <include name="test.txt" asis="true" />
  <include name="missing.txt" asis="true" />
</fileset>

NAnt will complain then in case the file is missing.

The Chairman
I had already seen and tried that and it didn't work. Not sure what I was doing wrong as I tried it again and it now works.
adrianbanks