Browse Source

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 <ant> invokes <ant> ...


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269837 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
36fa373b09
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      src/main/org/apache/tools/ant/taskdefs/Ant.java

+ 9
- 3
src/main/org/apache/tools/ant/taskdefs/Ant.java View File

@@ -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()) {


Loading…
Cancel
Save