SysInfoTask Class

Summary

Sets properties with system information.
Assembly
NAnt.Core.dll
Namespace
NAnt.Core.Tasks
Interfaces
Base Types
graph BT Type-->Base0["Task"] click Base0 "/api/NAnt.Core/Task" Base0-->Base1["Element"] click Base1 "/api/NAnt.Core/Element" Base1-->Base2["Object"] Type-.->Interface0["IConditional"] click Interface0 "/api/NAnt.Core/IConditional" Type["SysInfoTask"] class Type type-node

Syntax

[TaskName("sysinfo")]
public class SysInfoTask : Task, IConditional

Examples

Register the properties with the default property prefix.

<sysinfo />

Register the properties without a prefix.

<sysinfo prefix="" />

Register properties and display a summary.

<sysinfo verbose="true" />

Remarks

Sets a number of properties with information about the system environment. The intent of this task is for nightly build logs to have a record of system information so that the build was performed on.

ValueCommon Language Runtime version number.Environment variables (e.g., <>.env.PATH). Note that on x64 machines, variable's names containing "(x86)" will contain ".x86" instead (e.g., <>.env.ProgramFiles.x86).Operating system platform ID.Operating system version.Operating system version string.The directory that serves as a common repository for application-specific data for the current roaming user.The directory that serves as a common repository for application-specific data that is used by all users.The directory for components that are shared across applications.The directory used to physically store file objects on the desktop. Do not confuse this directory with the desktop folder itself, which is a virtual folder.The Program Files directory.The System directory.The temporary directory.
Property
<NAnt.Core.Tasks.SysInfoTask.Prefix>.clr.version
<NAnt.Core.Tasks.SysInfoTask.Prefix>.env.*
<NAnt.Core.Tasks.SysInfoTask.Prefix>.os.platform
<NAnt.Core.Tasks.SysInfoTask.Prefix>.os.version
<NAnt.Core.Tasks.SysInfoTask.Prefix>.os
<NAnt.Core.Tasks.SysInfoTask.Prefix>.os.folder.applicationdata
<NAnt.Core.Tasks.SysInfoTask.Prefix>.os.folder.commonapplicationdata
<NAnt.Core.Tasks.SysInfoTask.Prefix>.os.folder.commonprogramfiles
<NAnt.Core.Tasks.SysInfoTask.Prefix>.os.folder.desktopdirectory
<NAnt.Core.Tasks.SysInfoTask.Prefix>.os.folder.programfiles
<NAnt.Core.Tasks.SysInfoTask.Prefix>.os.folder.system
<NAnt.Core.Tasks.SysInfoTask.Prefix>.os.folder.temp

When the name of an environment variable contains characters that are not allowed in a property name, the task will use a property name where each of such characters is replaced with an underscore (_).

Moreover when the name of an environment variable ends with the string "(x86)" the name of the property that is defined by this task will end with ".x86" instead.

For example the environment variable "ProgramFiles(x86)" will become "sys.env.ProgramFiles.x86" but an environment variable named "Program(x86)Files" would become "sys.env.Program_x86_Files".

we advise you to use the following functions instead:
DescriptionGets a object that identifies this operating system.Gets the path to a system special folder.Returns the value of a environment variable.Gets the path to the temporary directory.Gets the Common Language Runtime version.
Function
NAnt.Core.Functions.EnvironmentFunctions.GetOperatingSystem
NAnt.Core.Functions.EnvironmentFunctions.GetFolderPath(System.Environment.SpecialFolder)
NAnt.Core.Functions.EnvironmentFunctions.GetVariable(System.String)
NAnt.Core.Functions.PathFunctions.GetTempPath
NAnt.Core.Functions.EnvironmentFunctions.GetVersion

Attributes

Type Description
TaskNameAttribute Indicates that class should be treated as a task.

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.
Inherited from Task
IfDefined bool
If true then the task will be executed; otherwise, skipped. The default is true.
Inherited from Task
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.
Inherited from Task
Name string
The name of the task.
Inherited from 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
Prefix string
The string to prefix the property names with. The default is "sys.".
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.
Inherited from Task
UnlessDefined bool
Opposite of NAnt.Core.Task.IfDefined. If false then the task will be executed; otherwise, skipped. The default is false.
Inherited from Task
Verbose bool
Determines whether the task should report detailed build log messages. The default is false.
Inherited from Task
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.
Inherited from Task
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.
Inherited from Task
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.
Inherited from 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.
Inherited from Task
InitializeTaskConfiguration() void
Initializes the configuration of the task using configuration settings retrieved from the NAnt configuration file.
Inherited from Task
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.
Inherited from Task
Log(Level, string) void
Logs a message with the given priority.
Inherited from Task
Log(Level, string, Object[]) void
Logs a formatted message with the given priority.
Inherited from Task