mirror of
https://github.com/apache/ant.git
synced 2025-05-22 07:54:47 +00:00
Didn't set the basedir correctly if the attribute to project was
ommitted and the basedir was not the process's working directory. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267857 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
78b414381f
commit
1c38f4ed52
@ -204,7 +204,7 @@ public class ProjectHelper {
|
|||||||
String def = null;
|
String def = null;
|
||||||
String name = null;
|
String name = null;
|
||||||
String id = null;
|
String id = null;
|
||||||
String baseDir = new File(buildFile.getAbsolutePath()).getParent();
|
String baseDir = null;
|
||||||
|
|
||||||
for (int i = 0; i < attrs.getLength(); i++) {
|
for (int i = 0; i < attrs.getLength(); i++) {
|
||||||
String key = attrs.getName(i);
|
String key = attrs.getName(i);
|
||||||
@ -232,9 +232,13 @@ public class ProjectHelper {
|
|||||||
|
|
||||||
if (project.getProperty("basedir") != null) {
|
if (project.getProperty("basedir") != null) {
|
||||||
project.setBasedir(project.getProperty("basedir"));
|
project.setBasedir(project.getProperty("basedir"));
|
||||||
|
} else {
|
||||||
|
if (baseDir == null) {
|
||||||
|
project.setBasedir((new File(buildFile.getParent())).getAbsolutePath());
|
||||||
} else {
|
} else {
|
||||||
project.setBasedir((new File(buildFile.getParent(), baseDir)).getAbsolutePath());
|
project.setBasedir((new File(buildFile.getParent(), baseDir)).getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user