diff --git a/WHATSNEW b/WHATSNEW index c22cc7683..6d26ccefd 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -63,7 +63,8 @@ Other changes: -------------- * New tasks: ear, p4counter, record, cvspass, vsscheckin, vsscheckout, - typedef, sleep, mimemail, set of tasks for Continuus/Synergy, dependset + typedef, sleep, mimemail, set of tasks for Continuus/Synergy, dependset, + condition * Ant now uses JAXP 1.1 diff --git a/docs/manual/CoreTasks/condition.html b/docs/manual/CoreTasks/condition.html new file mode 100644 index 000000000..d28152e6f --- /dev/null +++ b/docs/manual/CoreTasks/condition.html @@ -0,0 +1,157 @@ + + + + +Ant User Manual + + + + +

Condition

+

Description

+

Sets a property if a certain condition holds true - this is a +generalization of Available and Uptodate.

+

If the condition holds true, the property value is set to true by +default; otherwise, the property is not set. You can set the value to +something other than the default by specifying the value +attribute.

+

Conditions are specified as nested elements, +you must specify exactly one condition.

+

Parameters

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
propertyThe name of the property to set.Yes
valueThe value to set the property to. Defaults to + "true".No
+

Parameters specified as nested elements

+

All conditions to test are specified as nested elements.

+ +

not

+

The <not> element expects exactly one other +condition to be nested into this element, negating the result of the +condition. It doesn't have any attributes and accepts all nested +elements of the condition task as nested elements as well.

+ +

and

+The <and> element doesn't have any attributes and +accepts an arbitrary number of conditions as nested elements - all +nested elements of the condition task are supported. This condition +is true if all of its contained conditions are, conditions will be +evaluated in the order they have been specified in the build file.

+

The <and> condition has the same shortcut +semantics as the Java && operator, as soon as one of the +nested conditions is false, no other condition will be evaluated.

+ +

or

+The <or> element doesn't have any attributes and +accepts an arbitrary number of conditions as nested elements - all +nested elements of the condition task are supported. This condition +is true if at least one of its contained conditions is, conditions +will be evaluated in the order they have been specified in the build +file.

The <or> condition has the same +shortcut semantics as the Java || operator, as soon as one of the +nested conditions is true, no other condition will be evaluated.

+ +

available

+

This condition is identical to the Available task, all attributes and nested +elements of that task are supported, the property and value attributes +are redundant and will be ignored.

+ +

uptodate

+

This condition is identical to the Uptodate task, all attributes and nested +elements of that task are supported, the property and value attributes +are redundant and will be ignored.

+ +

os

+

Test whether the current operating system is of a given type.

+ + + + + + + + + + + +
AttributeDescriptionRequired
familyThe name of the operating system family to expect.No
+

Supported values for the family attribute are: +

+ +

equals

+

Tests whether the two given Strings are identical

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
arg1First string to test.Yes
arg2Second string to test.Yes
+ +

Examples

+
+  <condition property="javamail.complete">
+    <and>
+      <available classname="javax.activation.DataHandler" />
+      <available classname="javax.mail.Transport" />
+    </and>
+  </condition>
+
+

sets the property javamail.complete if both the +JavaBeans Activation Framework and JavaMail are available in the +classpath.

+ +
+  <condition property="isMacOsButNotMacOsX">
+    <and>
+      <os family="mac" />
+      <not>
+        <os family="unix" />
+      </not>
+    </and>
+  </condition>
+
+

sets the property isMacOsButNotMacOsX if the current +operating system is MacOS, but not MacOS X - which Ant considers to be +in the Unix family as well.

+ +
+

Copyright © 2001 Apache Software +Foundation. All rights Reserved.

+ + + + diff --git a/docs/manual/coretasklist.html b/docs/manual/coretasklist.html index dac4b35e8..674b63fe4 100644 --- a/docs/manual/coretasklist.html +++ b/docs/manual/coretasklist.html @@ -26,6 +26,7 @@ Apply/ExecOn
Available
Chmod
+Condition
Copy
Copydir
Copyfile