From 36fa373b0915a40623f655b4259c01b2e16ced35 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 30 Oct 2001 07:07:28 +0000 Subject: [PATCH] initialize the new project first so that loggers have been configured before we fiddle with its properties. Don't carry over user properties for basedir and ant.file from the second to the third call in a chain of invokes ... git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269837 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Ant.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Ant.java b/src/main/org/apache/tools/ant/taskdefs/Ant.java index a2b18d3ac..341c639b8 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Ant.java +++ b/src/main/org/apache/tools/ant/taskdefs/Ant.java @@ -202,6 +202,11 @@ public class Ant extends Task { e = prop1.keys(); while (e.hasMoreElements()) { String arg = (String) e.nextElement(); + if ("basedir".equals(arg) || "ant.file".equals(arg)) { + // basedir and ant.file get special treatment in execute() + continue; + } + String value = (String) prop1.get(arg); if (inheritAll == true){ newProject.setProperty(arg, value); @@ -238,8 +243,11 @@ public class Ant extends Task { reinit(); } - if ( (dir == null) && (inheritAll == true) ) + if ( (dir == null) && (inheritAll == true) ) { dir = project.getBaseDir(); + } + + initializeProject(); if (dir != null) { newProject.setBaseDir(dir); @@ -248,8 +256,6 @@ public class Ant extends Task { dir = project.getBaseDir(); } - initializeProject(); - // Override with local-defined properties Enumeration e = properties.elements(); while (e.hasMoreElements()) {