ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r451444 - in /ant/core/trunk/src: main/org/apache/tools/ant/taskdefs/ main/org/apache/tools/ant/taskdefs/condition/ tests/junit/org/apache/tools/ant/
Date Fri, 29 Sep 2006 21:16:20 GMT
Author: peterreilly
Date: Fri Sep 29 14:16:20 2006
New Revision: 451444

URL: http://svn.apache.org/viewvc?view=rev&rev=451444
Log:
revert making ConditionBase a Task after discussion on dev@apache.org

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ConditionTask.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/LocationTest.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ConditionTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ConditionTask.java?view=diff&rev=451444&r1=451443&r2=451444
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ConditionTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ConditionTask.java Fri Sep 29 14:16:20
2006
@@ -44,6 +44,13 @@
     private String alternative = null;
 
     /**
+     * Constructor, names this task "condition".
+     */
+    public ConditionTask() {
+        super("condition");
+    }
+
+    /**
      * The name of the property to set. Required.
      * @param p the name of the property
      * @since Ant 1.4

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java?view=diff&rev=451444&r1=451443&r2=451444
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java Fri Sep 29 14:16:20
2006
@@ -60,6 +60,13 @@
     private String timeoutProperty;
 
     /**
+     * Constructor, names this task "waitfor".
+     */
+    public WaitFor() {
+        super("waitfor");
+    }
+
+    /**
      * Set the maximum length of time to wait.
      * @param time a <code>long</code> value
      */

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java?view=diff&rev=451444&r1=451443&r2=451444
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java Fri
Sep 29 14:16:20 2006
@@ -23,7 +23,7 @@
 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,18 +35,39 @@
  *
  * @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.
      *
      * @return the number of conditions in the container
@@ -64,6 +85,27 @@
      */
     protected final Enumeration getConditions() {
         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;
     }
 
     /**

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/LocationTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/LocationTest.java?view=diff&rev=451444&r1=451443&r2=451444
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/LocationTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/LocationTest.java Fri Sep 29 14:16:20
2006
@@ -46,7 +46,8 @@
 
     public void testConditionTask() {
         executeTarget("testConditionTask");
-        ConditionTask c = (ConditionTask) getProject().getReference("cond");
+        TaskAdapter ta = (TaskAdapter) getProject().getReference("cond");
+        ConditionTask c = (ConditionTask) ta.getProxy();
         assertFalse(c.getLocation() == Location.UNKNOWN_LOCATION);
         assertFalse(c.getLocation().getLineNumber() == 0);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message