Integrate Nant sources into the mcs code base to simplify the build.
[mono.git] / mcs / nant / src / Tasks / FailTask.cs
diff --git a/mcs/nant/src/Tasks/FailTask.cs b/mcs/nant/src/Tasks/FailTask.cs
new file mode 100755 (executable)
index 0000000..2e6b716
--- /dev/null
@@ -0,0 +1,38 @@
+// NAnt - A .NET build tool\r
+// Copyright (C) 2001 Gerry Shaw\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+//\r
+// Gerry Shaw (gerry_shaw@yahoo.com)\r
+\r
+namespace SourceForge.NAnt {\r
+\r
+    using System;\r
+\r
+    [TaskName("fail")]\r
+    public class FailTask : Task {\r
+\r
+        [TaskAttribute("message")]\r
+        string _message = null;\r
+\r
+        protected override void ExecuteTask() {\r
+            string message = _message;\r
+            if (message == null) {\r
+                message = "No message";\r
+            }\r
+            throw new BuildException(message);\r
+        }\r
+    }\r
+}\r