<include>

Includes an external build file.

This task is used to break your build file into smaller chunks. You can load a partial build file and have it included into the build file.

Any global (project level) tasks in the included build file are executed when this task is executed. Tasks in target elements are only executed if that target is executed.
The project element attributes are ignored.
This task can only be in the global (project level) section of the build file.
This task can only include files from the file system.

Parameters

Attribute Type Description Required
buildfile string
Build file to include.
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

Include a task that fetches the project version from the GetProjectVersion.include build file.

<include buildfile="GetProjectVersion.include" />

Requirements

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