Name

condition

Synopsis

Sets a property if a condition is true. This task combines basic Boolean expressions with the available and uptodate tasks.

Attributes

property (1.4, String, Y)

The name of a property to set if the condition is true. If the condition is false, the property is not set.

value (1.4, String, N)

The value assigned to the property if the condition is true. Defaults to true.

Content

The following elements are considered to be conditions. Exactly one condition must be nested directly within this task. These, in turn, may contain other nested conditions as outlined here.

<not>

Contains exactly one nested condition, negating its result. Does not have any attributes.

<and>

Contains any number of nested conditions, evaluating to true if all nested conditions are true. Conditions are evaluated left-to-right, and evaluation stops if a condition evaluates to false. [46] Does not have any attributes.

<or>

Contains any number of nested conditions, evaluating to true if any nested condition is true. Conditions are evaluated left-to-right, and evaluation stops when a condition evaluates to true. [47] Does not have any attributes.

<available>

Identical to the available task, except its property and value attributes are ignored.

<uptodate>

Identical to the uptodate task, except its property and value attributes are ignored.

<os>

Evaluates to true if the current operating system is of a given type. This element has an optional family attribute of type String. Legal values are windows ...

Get Ant: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.