Index: src/NAnt.Core/FileSet.cs
===================================================================
RCS file: /cvsroot/nant/nant/src/NAnt.Core/FileSet.cs,v
retrieving revision 1.4
diff -u -r1.4 FileSet.cs
--- src/NAnt.Core/FileSet.cs	6 Dec 2002 20:05:59 -0000	1.4
+++ src/NAnt.Core/FileSet.cs	25 Feb 2003 03:45:23 -0000
@@ -27,6 +27,15 @@
 
 namespace SourceForge.NAnt {
 
+    /// <summary>
+    /// The FileSet element.
+    /// </summary>
+    /// <remarks>
+    /// Used as a child element in various file-related tasks, including delete, copy, touch, get, atrrib, move...
+    /// </remarks>
+    /// <history>
+    /// <change date="20030224" author="Brian Deacon (bdeacon at vidya dot com">Added support for the failonempty attribute</change>
+    /// </history>
     public class FileSet : Element {
 
         // copy constructor 
@@ -61,6 +70,7 @@
 
         bool _hasScanned = false;
         bool _defaultExcludes = true;
+        bool _failOnEmpty = false;
         DirectoryScanner _scanner = new DirectoryScanner();
         StringCollection _asis = new StringCollection();
         PathScanner _pathFiles = new PathScanner();		
@@ -68,6 +78,17 @@
         public FileSet() {
         }
 
+        /// <summary>
+        /// When set to true, causes the fileset element to throw a ValidationException when no files match 
+        /// the includes and excludes criteria. Default "false".
+        /// </summary>
+        [TaskAttribute("failonempty")]
+        [BooleanValidator()]
+        public bool FailOnEmpty {
+            get { return _failOnEmpty; }
+            set { _failOnEmpty = value; }
+        }
+
         /// <summary>Indicates whether default excludes should be used or not.  Default "true".</summary>
         [TaskAttribute("defaultexcludes")]
         [BooleanValidator()]
@@ -122,11 +143,14 @@
                 foreach (string name in PathFiles.Scan()) {
                     _scanner.FileNames.Add(name);
                 }
-
             } catch (Exception e) {
                 throw new BuildException("Error creating file set.", Location, e);
             }
             _hasScanned = true;
+
+            if (FailOnEmpty && _scanner.FileNames.Count == 0) {
+                throw new ValidationException("The fileset specified is empty.", Location);        
+            }
         }
 
         protected override void InitializeElement(XmlNode elementNode)  {
