|
|
@@ -23,7 +23,7 @@ import java.util.Vector; |
|
|
|
import org.apache.tools.ant.Project; |
|
|
|
import org.apache.tools.ant.DynamicElement; |
|
|
|
import org.apache.tools.ant.ComponentHelper; |
|
|
|
import org.apache.tools.ant.Task; |
|
|
|
import org.apache.tools.ant.ProjectComponent; |
|
|
|
import org.apache.tools.ant.taskdefs.Available; |
|
|
|
import org.apache.tools.ant.taskdefs.Checksum; |
|
|
|
import org.apache.tools.ant.taskdefs.UpToDate; |
|
|
@@ -35,17 +35,38 @@ import org.apache.tools.ant.taskdefs.UpToDate; |
|
|
|
* |
|
|
|
* @since Ant 1.4 |
|
|
|
*/ |
|
|
|
public abstract class ConditionBase extends Task |
|
|
|
public abstract class ConditionBase extends ProjectComponent |
|
|
|
implements DynamicElement { |
|
|
|
|
|
|
|
private static final String CONDITION_ANTLIB |
|
|
|
= "antlib:org.apache.tools.ant.types.conditions:"; |
|
|
|
|
|
|
|
/** |
|
|
|
* name of the component |
|
|
|
*/ |
|
|
|
private String taskName="condition"; |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
*/ |
|
|
|
private Vector conditions = new Vector(); |
|
|
|
|
|
|
|
/** |
|
|
|
* Simple constructor. |
|
|
|
*/ |
|
|
|
protected ConditionBase() { |
|
|
|
taskName = "component"; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Constructor that takes the name of the task in the task name. |
|
|
|
* @param taskName |
|
|
|
* @since Ant 1.7 |
|
|
|
*/ |
|
|
|
protected ConditionBase(String taskName) { |
|
|
|
this.taskName = taskName; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Count the conditions. |
|
|
|
* |
|
|
@@ -66,6 +87,27 @@ public abstract class ConditionBase extends Task |
|
|
|
return conditions.elements(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Sets the name to use in logging messages. |
|
|
|
* |
|
|
|
* @param name The name to use in logging messages. |
|
|
|
* Should not be <code>null</code>. |
|
|
|
* @since Ant 1.7 |
|
|
|
*/ |
|
|
|
public void setTaskName(String name) { |
|
|
|
this.taskName = name; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Returns the name to use in logging messages. |
|
|
|
* |
|
|
|
* @return the name to use in logging messages. |
|
|
|
* @since Ant 1.7 |
|
|
|
*/ |
|
|
|
public String getTaskName() { |
|
|
|
return taskName; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Add an <available> condition. |
|
|
|
* @param a an available condition |
|
|
|