diff --git a/WHATSNEW b/WHATSNEW
index c18589518..9e6be90bf 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -320,6 +320,12 @@ Other changes:
Previously the absence of the index was not enough to trigger the rebuild;
some other update was necessary. Bugzilla report 45098.
+ *
false
.false
. since
+ Ant 1.8.0If you set useNativeBasedir
to true, the basedir of
+ the new project will be whatever the basedir attribute of
+ the <project>
element of the new project says (or
+ the new project's directory if the there is no basedir attribute) -
+ no matter what any other attribute of this task says and no matter
+ how deeply nested into levels of
+ <ant>
invocations this task lives.
If you haven't set useNativeBasedir
or set it to
+ false, the following rules apply:
The basedir value of the new project is affected by the two
attributes dir and inheritall as well as
the <ant>
task's history. The current behaviour
diff --git a/src/main/org/apache/tools/ant/taskdefs/Ant.java b/src/main/org/apache/tools/ant/taskdefs/Ant.java
index 993170769..58e165049 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Ant.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Ant.java
@@ -113,7 +113,7 @@ public class Ant extends Task {
*
* @since Ant 1.8.0
*/
- private boolean allowNativeBasedir = false;
+ private boolean useNativeBasedir = false;
/**
* simple constructor
@@ -137,8 +137,8 @@ public class Ant extends Task {
*
* @since Ant 1.8.0
*/
- public void setAllowNativeBasedir(boolean b) {
- allowNativeBasedir = b;
+ public void setUseNativeBasedir(boolean b) {
+ useNativeBasedir = b;
}
/**
@@ -215,7 +215,7 @@ public class Ant extends Task {
}
}
// set user-defined properties
- if (allowNativeBasedir) {
+ if (useNativeBasedir) {
addAlmostAll(getProject().getUserProperties(), PropertyType.USER);
} else {
getProject().copyUserProperties(newProject);
@@ -344,7 +344,7 @@ public class Ant extends Task {
initializeProject();
if (dir != null) {
- if (!allowNativeBasedir) {
+ if (!useNativeBasedir) {
newProject.setBaseDir(dir);
if (savedDir != null) {
// has been set explicitly
@@ -494,7 +494,7 @@ public class Ant extends Task {
p.setProject(newProject);
p.execute();
}
- if (allowNativeBasedir) {
+ if (useNativeBasedir) {
addAlmostAll(getProject().getInheritedProperties(),
PropertyType.INHERITED);
} else {
diff --git a/src/main/org/apache/tools/ant/taskdefs/SubAnt.java b/src/main/org/apache/tools/ant/taskdefs/SubAnt.java
index 4f7d7ae37..358bd5dad 100644
--- a/src/main/org/apache/tools/ant/taskdefs/SubAnt.java
+++ b/src/main/org/apache/tools/ant/taskdefs/SubAnt.java
@@ -554,7 +554,7 @@ public class SubAnt extends Task {
if (directory != null) {
antTask.setDir(directory);
} else {
- antTask.setAllowNativeBasedir(true);
+ antTask.setUseNativeBasedir(true);
}
antTask.setInheritAll(inheritAll);
diff --git a/src/tests/antunit/taskdefs/subant-test.xml b/src/tests/antunit/taskdefs/subant-test.xml
index dc8b08663..bab7a266b 100644
--- a/src/tests/antunit/taskdefs/subant-test.xml
+++ b/src/tests/antunit/taskdefs/subant-test.xml
@@ -62,7 +62,7 @@