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:
Stefan Bodewig 2000-07-31 14:20:11 +00:00
parent 78b414381f
commit 1c38f4ed52

View File

@ -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());
} }
}
} }