<if>

[This is preliminary documentation and subject to change.]

Checks the conditional attributes and executes the children if true.

If no conditions are checked, all child tasks are executed.

If more than one attribute is used, they are &&'d. The first to fail stops the check.

The order of condition evaluation is, targetexists, propertyexists, propertytrue, uptodatefile.

Note: instead of using the deprecated attributes, we advise you to use the following functions in combination with the test attribute:

Function Description
property::exists() Checks whether the specified property exists.
target::exists() Checks whether the specified target exists.

Parameters

Attribute Type Description Required
comparefile string Deprecated. The file to check against for the uptodate file. False
propertyexists string Deprecated. Used to test whether a property exists. False
propertytrue string Deprecated. Used to test whether a property is true. False
targetexists string Deprecated. Used to test whether a target exists. False
test string Used to test arbitrary boolean expression. False
uptodatefile string Deprecated. The file to compare if uptodate. 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

Nested Elements:

<comparefiles>

Deprecated. The <fileset> that contains the comparison files for the uptodatefile(s) check.

</comparefiles>

<uptodatefiles>

Deprecated. The <fileset> that contains the uptodate files for the comparefile(s) check.

</uptodatefiles>

Examples

Requirements

Assembly: NAnt.Core (0.91.3954.0)