From 55dcf2dee8cad363de7fd0a2d8317c857349c6bb Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 3 Aug 2001 16:38:21 +0000 Subject: [PATCH] New task . This is a first cut of the generalization of and that is on the list for Ant2. This task supports a single condition and sets a property if it holds true - conditions can be containers for other conditions in turn, giving it the opportunity to support boolean logic. Built in conditions as of now: * and (slightly modified the tasks to allow them to be used as conditions) * containers , and * New conditions (compares to Strings) and which should give easier access to os.name. More extensive documentation to follow. Take a look at Ant's build file, it uses the task to detect whether javamail is available now. I had to perform some ugly tricks to make sure that project gets passed to every object that will need it - this will be very different in the future I hope. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269456 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 22 +-- .../org/apache/tools/ant/AntClassLoader.java | 2 +- .../org/apache/tools/ant/TaskAdapter.java | 15 ++ .../apache/tools/ant/taskdefs/Available.java | 19 +- .../tools/ant/taskdefs/ConditionTask.java | 110 +++++++++++ .../apache/tools/ant/taskdefs/UpToDate.java | 20 +- .../tools/ant/taskdefs/condition/And.java | 83 ++++++++ .../ant/taskdefs/condition/Condition.java | 71 +++++++ .../ant/taskdefs/condition/ConditionBase.java | 177 ++++++++++++++++++ .../tools/ant/taskdefs/condition/Equals.java | 78 ++++++++ .../tools/ant/taskdefs/condition/Not.java | 80 ++++++++ .../tools/ant/taskdefs/condition/Or.java | 83 ++++++++ .../tools/ant/taskdefs/condition/Os.java | 90 +++++++++ .../tools/ant/taskdefs/defaults.properties | 1 + src/main/org/apache/tools/ant/types/Path.java | 11 +- 15 files changed, 836 insertions(+), 26 deletions(-) create mode 100644 src/main/org/apache/tools/ant/taskdefs/ConditionTask.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/condition/And.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/condition/Condition.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/condition/Equals.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/condition/Not.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/condition/Or.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/condition/Os.java diff --git a/build.xml b/build.xml index 4578c22ec..d3e8d818a 100644 --- a/build.xml +++ b/build.xml @@ -89,7 +89,7 @@ Check to see what optional dependencies are available =================================================================== --> - + @@ -147,22 +147,18 @@ - - - - - - + + + + + +