<available>

Obsolete. Use functions instead.
Checks if a resource is available at runtime.

The specified property is set to true if the requested resource is available at runtime, and false if the resource is not available.

we advise you to use the following functions instead:
DescriptionDetermines whether the specified file exists.Determines whether the given path refers to an existing directory on disk.Checks whether the specified framework exists..Checks whether the SDK for the specified framework is installed.
Function
NAnt.Core.Functions.FileFunctions.Exists(System.String)
NAnt.Core.Functions.DirectoryFunctions.Exists(System.String)
NAnt.Core.Functions.FrameworkFunctions.Exists(System.String)
NAnt.Core.Functions.FrameworkFunctions.SdkExists(System.String)

Parameters

Attribute Type Description Required
property string
The property that must be set if the resource is available.
True
resource string
The resource which must be available.
True
type
The type of resource which must be present.
True
failonerror bool
Determines if task failure stops the build, or is just reported. The default is true.
False
if bool
If true then the task will be executed; otherwise, skipped. The default is true.
False
unless bool
Opposite of NAnt.Core.Task.IfDefined. If false then the task will be executed; otherwise, skipped. The default is false.
False
verbose bool
Determines whether the task should report detailed build log messages. The default is false.
False

Examples

Sets the myfile.present property to true if the file is available on the filesystem and false if the file is not available.

<available type="File" resource="myfile.txt" property="myfile.present" />

Sets the build.dir.present property to true if the directory is available on the file system and false if the directory is not available.

<available type="Directory" resource="build" property="build.dir.present" />

Sets the mono-0.21.framework.present property to true if the Mono 0.21 framework is available on the current system and false if the framework is not available.

<available type="Framework" resource="mono-0.21" property="mono-0.21.framework.present" />

Sets the net-1.1.frameworksdk.present property to true if the .NET 1.1 Framework SDK is available on the current system and false if the SDK is not available.

<available type="FrameworkSDK" resource="net-1.1" property="net-1.1.frameworksdk.present" />

Requirements

Assembly
NAnt.Core.dll
Namespace
NAnt.Core.Tasks