diff --git a/WHATSNEW b/WHATSNEW index 981e75d7c..fa613464a 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -20,6 +20,9 @@ Other changes: * Ant's testcases require JUnit 3.7 or above as they now use the new assertTrue method instead of assert. +* and will now emit a warning if a task/type of + the given name already exists. + Fixed bugs: ----------- @@ -28,6 +31,8 @@ Fixed bugs: * would not close the original property file. +* will no longer override a subbuilds basedir with inheritall="true". + Changes from Ant 1.4 to Ant 1.4.1 =========================================== diff --git a/src/main/org/apache/tools/ant/taskdefs/Ant.java b/src/main/org/apache/tools/ant/taskdefs/Ant.java index ed164f89d..f6ed1e2d6 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Ant.java +++ b/src/main/org/apache/tools/ant/taskdefs/Ant.java @@ -160,6 +160,10 @@ public class Ant extends Task { Enumeration et = taskdefs.keys(); while (et.hasMoreElements()) { String taskName = (String) et.nextElement(); + if (taskName.equals("property")) { + // we have already added this taskdef in #init + continue; + } Class taskClass = (Class) taskdefs.get(taskName); newProject.addTaskDefinition(taskName, taskClass); } @@ -224,15 +228,18 @@ public class Ant extends Task { reinit(); } - if (dir == null) { + if ( (dir == null) && (inheritAll == true) ) + dir = project.getBaseDir(); + + if (dir != null) { + newProject.setBaseDir(dir); + newProject.setUserProperty("basedir" , dir.getAbsolutePath()); + } else { dir = project.getBaseDir(); } initializeProject(); - newProject.setBaseDir(dir); - newProject.setUserProperty("basedir" , dir.getAbsolutePath()); - // Override with local-defined properties Enumeration e = properties.elements(); while (e.hasMoreElements()) {