How to make nant complaints when a file is not in the file set

I have an element filesetin the assembly file that is defined as:

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

When this is done (as part of the copy task), it does not complain if any of the files are missing. Although I can use failonempty="true"in an element fileset, this only happens if both files are missing .

I can achieve this by creating several sets of files with failonempty="true", each of which contains one file, but this is inconvenient. This is also a maintenance problem if there are many required files.

Is there a way to make nant complaints if any files in the file set are missing ? If this is not possible, is there another way to achieve the same effect?

+3
source share
1 answer

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 if the file is missing.

+2
source

Source: https://habr.com/ru/post/1720679/


All Articles