ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simeon Fitch <meta...@yahoo.com>
Subject Small mod to Project & Task (proposed)
Date Fri, 24 Nov 2000 18:50:48 GMT
I'd like to make the following small mod below to Project.java and
Task.java, and wanted to pass it by the group before checking it in. The
first is opening up access to the topoSort() method so that the GUI can get
the list of tasks that will be executed before the build is run. The second
mod gives me access to the set of Tasks defined inside a Target (I assume
this one was just an API omission).

Thanks,

sim

Index: Project.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.44
diff -u -r1.44 Project.java
--- Project.java	2000/10/10 16:27:22	1.44
+++ Project.java	2000/11/24 18:45:53
@@ -835,7 +835,7 @@
      * @exception BuildException if there is a cyclic dependency among the
      * Targets, or if a Target does not exist.
      */
-    private final Vector topoSort(String root, Hashtable targets)
+    public final Vector topoSort(String root, Hashtable targets)
         throws BuildException {
         Vector ret = new Vector();
         Hashtable state = new Hashtable();
Index: Target.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Target.java,v
retrieving revision 1.12
diff -u -r1.12 Target.java
--- Target.java	2000/09/18 15:38:38	1.12
+++ Target.java	2000/11/24 18:45:54
@@ -102,6 +102,17 @@
         tasks.addElement(task);
     }
 
+	/** 
+	 * Get the current set of tasks to be executed by this target.
+	 * 
+     * @return The current set of tasks.
+	 */
+    public Task[] getTasks() {
+        Task[] retval = new Task[tasks.size()];
+        tasks.copyInto(retval);
+        return retval;
+    }
+
     public void addDependency(String dependency) {
         dependencies.addElement(dependency);
     }


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

Mime
View raw message