From 8c8d8c5f27e49e1fc7a40cc29a1293b7e9344107 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 23 Oct 2001 12:15:46 +0000 Subject: [PATCH] Only override subbuild's basedir if inheritall has been set to false. Submitted by: Craeg K. Strong Get rid of annoying warning that has been redefined in and . git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269816 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 5 +++++ src/main/org/apache/tools/ant/taskdefs/Ant.java | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) 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()) {