Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 32385 invoked by uid 500); 20 Sep 2000 11:31:14 -0000 Delivered-To: apmail-jakarta-ant-cvs@apache.org Received: (qmail 32382 invoked by uid 1146); 20 Sep 2000 11:31:14 -0000 Date: 20 Sep 2000 11:31:14 -0000 Message-ID: <20000920113114.32381.qmail@locus.apache.org> From: bodewig@locus.apache.org To: jakarta-ant-cvs@apache.org Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Ant.java bodewig 00/09/20 04:31:13 Modified: . build.xml docs index.html src/main/org/apache/tools/ant ProjectHelper.java src/main/org/apache/tools/ant/taskdefs Ant.java Log: now copies the definitions of data types to the child project as well. Reported by: Jose Alberto Fernandez now checks it isn't calling the target it is nested into. Submitted by: Nico Seessle Revision Changes Path 1.75 +4 -0 jakarta-ant/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-ant/build.xml,v retrieving revision 1.74 retrieving revision 1.75 diff -u -r1.74 -r1.75 --- build.xml 2000/09/18 14:05:42 1.74 +++ build.xml 2000/09/20 11:31:04 1.75 @@ -324,5 +324,9 @@ + + + + 1.110 +2 -2 jakarta-ant/docs/index.html Index: index.html =================================================================== RCS file: /home/cvs/jakarta-ant/docs/index.html,v retrieving revision 1.109 retrieving revision 1.110 diff -u -r1.109 -r1.110 --- index.html 2000/09/20 11:13:57 1.109 +++ index.html 2000/09/20 11:31:09 1.110 @@ -5000,10 +5000,10 @@ registers a reference to this newly created task - at parser time. -
  • init() is called at parser time.
  • -
  • The task gets a reference to the target it belongs to via its inherited target variable.
  • + +
  • init() is called at parser time.
  • All child elements of the XML element corresponding to this task are created via this task's createXXX() methods or 1.31 +2 -1 jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java Index: ProjectHelper.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- ProjectHelper.java 2000/09/18 14:04:51 1.30 +++ ProjectHelper.java 2000/09/20 11:31:12 1.31 @@ -377,15 +377,16 @@ task.setLocation(new Location(buildFile.toString(), locator.getLineNumber(), locator.getColumnNumber())); configureId(task, attrs); - task.init(); // Top level tasks don't have associated targets if (target != null) { task.setOwningTarget(target); target.addTask(task); + task.init(); wrapper = task.getRuntimeConfigurableWrapper(); wrapper.setAttributes(attrs); } else { + task.init(); configure(task, attrs, project); task.execute(); } 1.18 +17 -1 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java Index: Ant.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- Ant.java 2000/09/18 07:54:59 1.17 +++ Ant.java 2000/09/20 11:31:13 1.18 @@ -141,9 +141,17 @@ p1.addTaskDefinition(taskName, taskClass); } + Hashtable typedefs = project.getDataTypeDefinitions(); + Enumeration e = typedefs.keys(); + while (e.hasMoreElements()) { + String typeName = (String) e.nextElement(); + Class typeClass = (Class) typedefs.get(typeName); + p1.addDataTypeDefinition(typeName, typeClass); + } + // set user-define properties Hashtable prop1 = project.getProperties(); - Enumeration e = prop1.keys(); + e = prop1.keys(); while (e.hasMoreElements()) { String arg = (String) e.nextElement(); String value = (String) prop1.get(arg); @@ -188,6 +196,14 @@ if (target == null) { target = p1.getDefaultTarget(); + } + + // Are we trying to call the target in which we are defined? + if (p1.getBaseDir().equals(project.getBaseDir()) && + p1.getProperty("ant.file").equals(project.getProperty("ant.file")) && + target.equals(this.getOwningTarget().getName())) { + + throw new BuildException("ant task calling it's own parent target"); } p1.executeTarget(target);