开发者

How to make nant complain when a file is missing from a fileset

开发者 https://www.devze.com 2022-12-08 21:36 出处:网络
I have a fileset element in a build file that is defined as: <fileset id=\"fileset\" basedir=\".\">

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消