Index: AvailableTask.cs
===================================================================
RCS file: /cvsroot/nant/nant/src/NAnt.Core/Tasks/AvailableTask.cs,v
retrieving revision 1.4
diff -u -r1.4 AvailableTask.cs
--- AvailableTask.cs	5 Mar 2003 16:32:26 -0000	1.4
+++ AvailableTask.cs	6 Mar 2003 08:29:43 -0000
@@ -27,8 +27,14 @@
 namespace SourceForge.NAnt.Tasks {
 
     /// <summary>
-    /// Sets the given property to <c>true</c> if the requested resource is available 
-    /// at runtime, and <c>false</c> if the resource is not available.</summary>
+    /// Checks if a resource is available at runtime.
+    /// </summary>
+    /// <remarks>
+    ///   <para>
+    ///   The specified property is set to <c>true</c> if the requested resource is 
+    ///   available at runtime, and <c>false</c> if the resource is not available.
+    ///   </para> 
+    /// </remarks>
     /// <example>
     ///   <para>
     ///   Sets the <c>myfile.present</c> property to <c>true</c> if the file is 
@@ -42,20 +48,31 @@
     ///   <para>
     ///   Sets the <c>build.dir.present</c> property to <c>true</c> if the directory 
     ///   is available on the filesystem and <c>false</c> if the directory is not
-    ///   available..
+    ///   available.
     ///   </para>
     ///   <code>
     ///     <![CDATA[
     /// <available type="Directory" resource="build" property="build.dir.present" />
     ///     ]]>
     ///   </code>
+    ///   <para>
+    ///   Sets the <c>mono-0.21.framework.present</c> property to <c>true</c> if the 
+    ///   Mono 0.21 framework is available on the current system and <c>false</c> if the 
+    ///   framework is not.
+    ///   </para>
+    ///   <code>
+    ///     <![CDATA[
+    /// <available type="Framework" resource="mono-0.21" property="mono-0.21.framework.present" />
+    ///     ]]>
+    ///   </code>
     /// </example>
     [TaskName("available")]
     public class AvailableTask : Task {
 
         public enum ResourceType : int {
             File = 1,
-            Directory = 2
+            Directory = 2,
+			Framework = 3
         }
 
         #region Public Instance Properties
@@ -64,7 +81,7 @@
         [TaskAttribute("resource", Required=true)]
         public string Resource          { get { return _resource; } set {_resource = value; } }
 
-        /// <summary>The type of resource which must be present - either <c>File</c> or <c>Directory</c>.</summary>
+        /// <summary>The type of resource which must be present - either <c>File</c>, <c>Directory</c> or <c>Framework</c>.</summary>
         [TaskAttribute("type", Required=true)]
         public ResourceType Type { 
             get { return _resourceType; }
@@ -116,6 +133,9 @@
                 case ResourceType.Directory:
                     resourceAvailable = CheckDirectory();
                     break;
+                case ResourceType.Framework:
+                    resourceAvailable = CheckFramework();
+                    break;
                 default:
                     throw new BuildException(string.Format(CultureInfo.InvariantCulture, "No resource check is implemented for {0}", Type));
             }
@@ -138,7 +158,7 @@
             if (fileInfo.Exists) {
                 fileAvailable = true;
             } else {
-                Log.WriteIf(Verbose, "Unable to find " + Type + " " + Resource);
+                Log.WriteLineIf(Verbose, LogPrefix + "Unable to find " + Type + " " + Resource);
                 fileAvailable = false;
             }
             return fileAvailable;
@@ -156,10 +176,27 @@
             if (dirInfo.Exists) {
                 directoryAvailable = true;
             } else {
-                Log.WriteIf(Verbose, "Unable to find " + Type + " " + Resource);
+                Log.WriteLineIf(Verbose, LogPrefix + "Unable to find " + Type + " " + Resource);
                 directoryAvailable = false;
             }       
             return directoryAvailable;
+        }
+
+        /// <summary>
+        /// Checks if the framework specified in the <see cref="Resource" /> property is 
+        /// available on the current system.
+        /// </summary>
+        /// <returns><c>true</c> when the framework is available, <c>false</c> otherwise.</returns>
+        private bool CheckFramework() {
+            bool frameworkAvailable = false;
+
+            if (Project.FrameworkInfoTable.Contains(Resource)) {
+                frameworkAvailable = true;
+            } else {
+                Log.WriteLineIf(Verbose, LogPrefix + "Unable to find " + Type + " " + Resource);
+                frameworkAvailable = false;
+            }
+            return frameworkAvailable;
         }
 
         #endregion Private Instance Methods
