Browse Source

Control the order in which the system and build classpaths are combined

via a new property: build.sysclasspath.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268383 13f79535-47bb-0310-9956-ffa450edef68
master
Sam Ruby 24 years ago
parent
commit
ba0d3f2a3e
1 changed files with 28 additions and 8 deletions
  1. +28
    -8
      src/main/org/apache/tools/ant/taskdefs/Javac.java

+ 28
- 8
src/main/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -372,9 +372,6 @@ public class Javac extends MatchingTask {
}
}

// XXX
// we need a way to not use the current classpath.

/**
* Builds the compilation classpath.
*
@@ -391,15 +388,38 @@ public class Javac extends MatchingTask {
classpath.setLocation(destDir);
}

// add our classpath to the mix
// Compine the build classpath with the system classpath, in an
// order determined by the value of build.classpath

if (compileClasspath == null) {
classpath.addExisting(Path.systemClasspath);
} else {
String order = project.getProperty("build.sysclasspath");
if (order == null) order="first";

if (order.equals("only")) {
// only: the developer knows what (s)he is doing
classpath.addExisting(Path.systemClasspath);

if (compileClasspath != null) {
classpath.addExisting(compileClasspath);
} else if (order.equals("last")) {
// last: don't trust the developer
classpath.addExisting(compileClasspath);
classpath.addExisting(Path.systemClasspath);

} else if (order.equals("ignore")) {
// ignore: don't trust anyone
classpath.addExisting(compileClasspath);
addRuntime = true;

} else {
// first: developer could use a little help
classpath.addExisting(Path.systemClasspath);
classpath.addExisting(compileClasspath);
}
}

// add the system classpath
// optionally add the runtime classes

classpath.addExisting(Path.systemClasspath);
if (addRuntime) {
if (System.getProperty("java.vendor").toLowerCase().indexOf("microsoft") >= 0) {
// Pull in *.zip from packages directory


Loading…
Cancel
Save