ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r451000 - 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 Thu, 28 Sep 2006 20:03:56 GMT
Author: peterreilly
Date: Thu Sep 28 13:03:55 2006
New Revision: 451000

URL: http://svn.apache.org/viewvc?view=rev&rev=451000
Log:
Make conditionbase a Task.
?was there any reason that this was not done for ant 1.6?


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=451000&r1=450999&r2=451000
==============================================================================
--- 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 Thu Sep 28 13:03:55
2006
@@ -43,10 +43,6 @@
     private String value = "true";
     private String alternative = null;
 
-    public ConditionTask() {
-        super("condition");
-    }
-
     /**
      * The name of the property to set. Required.
      * @param p the name of the property

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=451000&r1=450999&r2=451000
==============================================================================
--- 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 Thu Sep 28 13:03:55
2006
@@ -59,10 +59,6 @@
     private long checkEveryMultiplier = 1L;
     private String timeoutProperty;
 
-    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=451000&r1=450999&r2=451000
==============================================================================
--- 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 Thu
Sep 28 13:03:55 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.ProjectComponent;
+import org.apache.tools.ant.Task;
 import org.apache.tools.ant.taskdefs.Available;
 import org.apache.tools.ant.taskdefs.Checksum;
 import org.apache.tools.ant.taskdefs.UpToDate;
@@ -35,39 +35,18 @@
  *
  * @since Ant 1.4
  */
-public abstract class ConditionBase extends ProjectComponent
+public abstract class ConditionBase extends Task
     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
@@ -85,27 +64,6 @@
      */
     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=451000&r1=450999&r2=451000
==============================================================================
--- 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 Thu Sep 28 13:03:55
2006
@@ -46,8 +46,7 @@
 
     public void testConditionTask() {
         executeTarget("testConditionTask");
-        TaskAdapter ta = (TaskAdapter) getProject().getReference("cond");
-        ConditionTask c = (ConditionTask) ta.getProxy();
+        ConditionTask c = (ConditionTask) getProject().getReference("cond");
         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