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 i开发者_开发问答s not possible, is there another way of achieving the same effect?
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.
精彩评论