Task Class

Summary

Provides the abstract base class for tasks.
graph BT Type-->Base0["Element"] click Base0 "/api/NAnt.Core/Element" Base0-->Base1["Object"] Type-.->Interface0["IConditional"] click Interface0 "/api/NAnt.Core/IConditional" Type["Task"] class Type type-node Derived0["DeleteTask"]-->Type click Derived0 "/api/NAnt.Core.Tasks/DeleteTask" Derived1["ChooseTask"]-->Type click Derived1 "/api/NAnt.Core.Tasks/ChooseTask" Derived2["EchoTask"]-->Type click Derived2 "/api/NAnt.Core.Tasks/EchoTask" Derived3["TaskContainer"]-->Type click Derived3 "/api/NAnt.Core/TaskContainer" Derived4["SleepTask"]-->Type click Derived4 "/api/NAnt.Core.Tasks/SleepTask" Derived5["LoadFileTask"]-->Type click Derived5 "/api/NAnt.Core.Tasks/LoadFileTask" Derived6["ReadRegistryTask"]-->Type click Derived6 "/api/NAnt.Win32.Tasks/ReadRegistryTask" Derived7["RegexTask"]-->Type click Derived7 "/api/NAnt.Core.Tasks/RegexTask" Derived8["MailTask"]-->Type click Derived8 "/api/NAnt.Core.Tasks/MailTask" Derived9["AssemblyInfoTask"]-->Type click Derived9 "/api/NAnt.DotNet.Tasks/AssemblyInfoTask" Derived10["TStampTask"]-->Type click Derived10 "/api/NAnt.Core.Tasks/TStampTask" Derived11["TryCatchTask"]-->Type click Derived11 "/api/NAnt.Core.Tasks/TryCatchTask" Derived12["SetEnvTask"]-->Type click Derived12 "/api/NAnt.Core.Tasks/SetEnvTask" Derived13["ScriptTask"]-->Type click Derived13 "/api/NAnt.DotNet.Tasks/ScriptTask" Derived14["AvailableTask"]-->Type click Derived14 "/api/NAnt.Core.Tasks/AvailableTask" Derived15["XmlPeekTask"]-->Type click Derived15 "/api/NAnt.Core.Tasks/XmlPeekTask" Derived16["LoadTasksTask"]-->Type click Derived16 "/api/NAnt.Core.Tasks/LoadTasksTask" Derived17["SolutionTask"]-->Type click Derived17 "/api/NAnt.VSNet.Tasks/SolutionTask" Derived18["DescriptionTask"]-->Type click Derived18 "/api/NAnt.Core.Tasks/DescriptionTask" Derived19["GetTask"]-->Type click Derived19 "/api/NAnt.Core.Tasks/GetTask" Derived20["CopyTask"]-->Type click Derived20 "/api/NAnt.Core.Tasks/CopyTask" Derived21["TouchTask"]-->Type click Derived21 "/api/NAnt.Core.Tasks/TouchTask" Derived22["IncludeTask"]-->Type click Derived22 "/api/NAnt.Core.Tasks/IncludeTask" Derived23["NAntLogger.DummyTask"]-->Type click Derived23 "/api/NAnt.MSBuild/DummyTask" Derived24["AttribTask"]-->Type click Derived24 "/api/NAnt.Core.Tasks/AttribTask" Derived25["CallTask"]-->Type click Derived25 "/api/NAnt.Core.Tasks/CallTask" Derived26["FailTask"]-->Type click Derived26 "/api/NAnt.Core.Tasks/FailTask" Derived27["XmlPokeTask"]-->Type click Derived27 "/api/NAnt.Core.Tasks/XmlPokeTask" Derived28["PropertyTask"]-->Type click Derived28 "/api/NAnt.Core.Tasks/PropertyTask" Derived29["CvsPass"]-->Type click Derived29 "/api/NAnt.SourceControl.Tasks/CvsPass" Derived30["UpToDateTask"]-->Type click Derived30 "/api/NAnt.Core.Tasks/UpToDateTask" Derived31["ServiceControllerTask"]-->Type click Derived31 "/api/NAnt.MSNet.Tasks/ServiceControllerTask" Derived32["NUnit2Task"]-->Type click Derived32 "/api/NAnt.NUnit2.Tasks/NUnit2Task" Derived33["MkDirTask"]-->Type click Derived33 "/api/NAnt.Core.Tasks/MkDirTask" Derived34["NUnitTask"]-->Type click Derived34 "/api/NAnt.NUnit1.Tasks/NUnitTask" Derived35["NAntTask"]-->Type click Derived35 "/api/NAnt.Core.Tasks/NAntTask" Derived36["NDocTask"]-->Type click Derived36 "/api/NAnt.DotNet.Tasks/NDocTask" Derived37["SysInfoTask"]-->Type click Derived37 "/api/NAnt.Core.Tasks/SysInfoTask" Derived38["NAntSchemaTask"]-->Type click Derived38 "/api/NAnt.Core.Tasks/NAntSchemaTask" Derived39["StyleTask"]-->Type click Derived39 "/api/NAnt.Core.Tasks/StyleTask" Derived40["ExternalProgramBase"]-->Type click Derived40 "/api/NAnt.Core.Tasks/ExternalProgramBase"

Syntax

[Serializable()]
public abstract class Task : Element, IConditional

Remarks

A task is a piece of code that can be executed.

Attributes

Type Description
SerializableAttribute

Properties

Name Value Summary
CustomXmlProcessing bool
Gets a value indicating whether the element is performing additional processing using the NAnt.Core.Element.XmlNode that was used to initialize the element.
Inherited from Element
FailOnError bool
Determines if task failure stops the build, or is just reported. The default is true.
IfDefined bool
If true then the task will be executed; otherwise, skipped. The default is true.
Location Location
Gets or sets the location in the build file where the element is defined.
Inherited from Element
LogPrefix string
The prefix used when sending messages to the log.
Name string
The name of the task.
NamespaceManager XmlNamespaceManager
Gets or sets the System.Xml.XmlNamespaceManager.
Inherited from Element
Parent Object
Gets or sets the parent of the element.
Inherited from Element
Project Project
Gets or sets the NAnt.Core.Element.Project to which this element belongs.
Inherited from Element
Properties PropertyDictionary
Gets the properties local to this NAnt.Core.Element and the NAnt.Core.Element.Project.
Inherited from Element
Threshold Level
Gets or sets the log threshold for this NAnt.Core.Task. By default the threshold of a task is NAnt.Core.Level.Debug, causing no messages to be filtered in the task itself.
UnlessDefined bool
Opposite of NAnt.Core.Task.IfDefined. If false then the task will be executed; otherwise, skipped. The default is false.
Verbose bool
Determines whether the task should report detailed build log messages. The default is false.
XmlNode XmlNode
Gets or sets the XML node of the element.
Inherited from Element

Methods

Name Value Summary
CopyTo(Element) void
Copies all instance data of the NAnt.Core.Element to a given NAnt.Core.Element.
Inherited from Element
Execute() void
Executes the task unless it is skipped.
ExecuteTask() void
Executes the task.
GetAttributeConfigurationNode(FrameworkInfo, string) XmlNode
Locates the XML node for the specified attribute in either the configuration section of the extension assembly or the.project.
GetAttributeConfigurationNode(XmlNode, FrameworkInfo, string) XmlNode
Inherited from Element
GetLocation() Location
Retrieves the location in the build file where the element is defined.
Inherited from Element
Initialize() void
Initializes the task.
Initialize(XmlNode) void
Performs default initialization.
Inherited from Element
InitializeBuildElement(Element, XmlNode, Element, Type) Element
Initializes the build element.
Inherited from Element
static
InitializeElement(XmlNode) void
Derived classes should override to this method to provide extra initialization and validation not covered by the base class.
Inherited from Element
InitializeTask(XmlNode) void
Initializes the task.
InitializeTaskConfiguration() void
Initializes the configuration of the task using configuration settings retrieved from the NAnt configuration file.
InitializeXml(XmlNode, PropertyDictionary, FrameworkInfo) void
Initializes all build attributes and child elements.
Inherited from Element
IsLogEnabledFor(Level) bool
Determines whether build output is enabled for the given NAnt.Core.Level.
Log(Level, string) void
Logs a message with the given priority.
Log(Level, string, Object[]) void
Logs a formatted message with the given priority.