Browse Source

fall back to system properties for build.sysclasspath if there is no project instance

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1061822 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 14 years ago
parent
commit
e36ab22599
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      src/main/org/apache/tools/ant/types/Path.java

+ 8
- 6
src/main/org/apache/tools/ant/types/Path.java View File

@@ -27,6 +27,7 @@ import java.util.Stack;
import java.util.Vector;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.MagicNames;
import org.apache.tools.ant.PathTokenizer;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.resources.Union;
@@ -552,11 +553,11 @@ public class Path extends DataType implements Cloneable, ResourceCollection {
Path result = new Path(getProject());

String order = defValue;
if (getProject() != null) {
String o = getProject().getProperty("build.sysclasspath");
if (o != null) {
order = o;
}
String o = getProject() != null
? getProject().getProperty(MagicNames.BUILD_SYSCLASSPATH)
: System.getProperty(MagicNames.BUILD_SYSCLASSPATH);
if (o != null) {
order = o;
}
if (order.equals("only")) {
// only: the developer knows what (s)he is doing
@@ -574,7 +575,8 @@ public class Path extends DataType implements Cloneable, ResourceCollection {
} else {
// last: don't trust the developer
if (!order.equals("last")) {
log("invalid value for build.sysclasspath: " + order,
log("invalid value for " + MagicNames.BUILD_SYSCLASSPATH
+ ": " + order,
Project.MSG_WARN);
}
result.addExisting(this);


Loading…
Cancel
Save