property

Description

A property works in much the same way as a traditional variable. Properties set in the main project area (outside of a task) can be accessed anywhere, but otherwise they are local to the task.

Properties values can contain expressions, but they are not evaluated until the property is accessed.

Parameters

Table 6. Parameters

Attribute Type Description Required
name string The name of the property. true
value string The value of the property. true
if bool If true, the task will be executed, otherwise it will be skipped. The default is true. false
unless bool The opposite of if. If false, the task will be executed, otherwise it will be skipped. The default is false. false

Examples

Example 8.  Setting and displaying a property

This example Will output hello to the console.

<property name="my-property" value="hello" /> <echo message="${ my-property }" />>