NAnt
![]() ![]() ![]() |
v0.91 |
Sets properties with system information.
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.
Property | Value |
---|---|
<prefix >.clr.version |
Common Language Runtime version number. |
<prefix >.env.* |
Environment variables (e.g., <prefix >.env.PATH). |
<prefix >.os.platform |
Operating system platform ID. |
<prefix >.os.version |
Operating system version. |
<prefix >.os |
Operating system version string. |
<prefix >.os.folder.applicationdata |
The directory that serves as a common repository for application-specific data for the current roaming user. |
<prefix >.os.folder.commonapplicationdata |
The directory that serves as a common repository for application-specific data that is used by all users. |
<prefix >.os.folder.commonprogramfiles |
The directory for components that are shared across applications. |
<prefix >.os.folder.desktopdirectory |
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. |
<prefix >.os.folder.programfiles |
The Program Files directory. |
<prefix >.os.folder.system |
The System directory. |
<prefix >.os.folder.temp |
The temporary directory. |
When the name of an environment variable is not a valid property name, the task will fail. In that case, set failonerror
to true to allow that environment variable to be skipped.
Note: we advise you to use the following functions instead:
Function | Description |
---|---|
environment::get-operating-system() | Gets a OperatingSystem object that identifies this operating system. |
environment::get-folder-path() | Gets the path to a system special folder. |
environment::get-variable() | Returns the value of a environment variable. |
path::get-temp-path() | Gets the path to the temporary directory. |
environment::get-version() | Gets the Common Language Runtime version. |
Attribute | Type | Description | Required |
---|---|---|---|
prefix | string | The string to prefix the property names with. The default is "sys.". | False |
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 if . 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 |
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" />