ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gle...@ca.ibm.com
Subject Re: [PATCH] Inheriting custom tasks in subprojects
Date Tue, 11 Jul 2000 18:57:39 GMT




Seems our internet email gateway didn't like Unix line endings.  For the
_last_ time, here is the proposed patch to provide inherited taskdef
support.

Index: jakarta-ant/src/main/org/apache/tools/ant/Project.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.28
diff -u -r1.28 Project.java
--- jakarta-ant/src/main/org/apache/tools/ant/Project.java
2000/07/09 03:48:11        1.28
+++ jakarta-ant/src/main/org/apache/tools/ant/Project.java
2000/07/11 17:09:21
@@ -214,6 +214,10 @@
     public Hashtable getUserProperties() {
         return userProperties;
     }
+
+    public Hashtable getTaskDefs() {
+        return taskClassDefinitions;
+    }

     public void setDefaultTarget(String defaultTarget) {
         this.defaultTarget = defaultTarget;
Index: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v

retrieving revision 1.9
diff -u -r1.9 Ant.java
--- jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
2000/07/11 11:14:48        1.9
+++ jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
2000/07/11 17:09:21
@@ -105,6 +105,14 @@
         }

         p1.init();
+
+        Hashtable taskdefs = project.getTaskDefs();
+        Enumeration et = taskdefs.keys();
+        while (et.hasMoreElements()) {();askDefs();fs/Ant.java
+          String taskName = (String) et.nextElement();
+          Class taskClass = (Class) taskdefs.get(taskName);
+          p1.addTaskDefinition(taskName, taskClass);
+        }

         // set user-define properties
         Hashtable prop1 = project.getProperties();

Glenn McAllister
TID - Software Developer - VisualAge for Java
IBM Toronto Lab, (416) 448-3805
"An approximate answer to the right question is better than the
right answer to the wrong question." - John W. Tukey



Mime
View raw message