<funcdef>

Creates a custom function containing NAnt tasks.

Define a function by specifying a name, a namespace and a list of function parameters. A custom function is created that runs each of the tasks in the <do/> parameter replacing function parameters before execution.

A special parameter __$return__ must be set during the <do/> block that is the return value of the function. Default type of this is 'string', but 'int' and 'bool' functions can also be written by setting a attribute returnType on the funcdef.

Function parameters are referenced in the <do/> section using the syntax __parameter name__. They are all required, and are given to the function in the same order as they are in the funcparams list. The type of a parameter defaults to 'string', but 'int' and 'bool' parameters can also be done by setting the 'type' attribute on the funcparam.

Parameters

Attribute Type Description Required
name string The name for the custom function True
namespace string The namespace for the custom function True
returnType string The return type for the function (defaults to string) False
failonerror bool False
if bool False
unless bool False
verbose bool False

Nested Elements:

<funcparams>

A list of FuncParam (attribute) parameters.
<funcparam>

Describes a func parameter to a custom scripted function

Parameters

AttributeTypeDescriptionRequired
namestring The parameter name. True
typestring The parameter type (defaults to string) False
</funcparam>

</funcparams>

<do>

The tasks to script

</do>

Examples

Requirements

Assembly: broloco.NAntTasks (1.2.0.0)