rubys 01/01/05 06:26:28
Modified: src/main/org/apache/tools/ant AntClassLoader.java
src/main/org/apache/tools/ant/taskdefs Javac.java
Javadoc.java
src/main/org/apache/tools/ant/types CommandlineJava.java
Path.java
Log:
Address anomolies where classpath is now being interpreted differently by
different tasks due to my change to javac and the introduction of
${build.sysclasspath}
Revision Changes Path
1.12 +4 -2
jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java
Index: AntClassLoader.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- AntClassLoader.java 2001/01/03 14:18:26 1.11
+++ AntClassLoader.java 2001/01/05 14:26:24 1.12
@@ -105,11 +105,13 @@
* Create a classloader for the given project using the classpath given.
*
* @param project the project to ehich this classloader is to belong.
- * @param classpath the classpath to use to load the classes.
+ * @param classpath the classpath to use to load the classes. This
+ * is combined with the system classpath in a manner
+ * determined by the value of ${build.sysclasspath}
*/
public AntClassLoader(Project project, Path classpath) {
this.project = project;
- this.classpath = classpath;
+ this.classpath = classpath.concatSystemClasspath();
// JDK > 1.1 should add these by default, but some VMs don't
addSystemPackageRoot("java");
1.62 +1 -22
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
Index: Javac.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- Javac.java 2001/01/04 10:08:59 1.61
+++ Javac.java 2001/01/05 14:26:25 1.62
@@ -420,28 +420,7 @@
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);
-
- } 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);
- }
+ classpath.addExisting(compileClasspath.concatSystemClasspath());
}
// optionally add the runtime classes
1.39 +2 -0
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
Index: Javadoc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- Javadoc.java 2001/01/03 14:18:30 1.38
+++ Javadoc.java 2001/01/05 14:26:26 1.39
@@ -571,6 +571,8 @@
// ------------------------------------------------ general javadoc arguments
if (classpath == null)
classpath = Path.systemClasspath;
+ else
+ classpath = classpath.concatSystemClasspath();
if (!javadoc1) {
toExecute.createArgument().setValue("-classpath");
1.8 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/types/CommandlineJava.java
Index: CommandlineJava.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/CommandlineJava.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CommandlineJava.java 2001/01/03 14:18:46 1.7
+++ CommandlineJava.java 2001/01/05 14:26:27 1.8
@@ -190,7 +190,7 @@
}
if (classpath != null && classpath.size() > 0) {
result[pos++] = "-classpath";
- result[pos++] = classpath.toString();
+ result[pos++] = classpath.concatSystemClasspath().toString();
}
System.arraycopy(javaCommand.getCommandline(), 0,
result, pos, javaCommand.size());
1.12 +34 -0 jakarta-ant/src/main/org/apache/tools/ant/types/Path.java
Index: Path.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Path.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Path.java 2001/01/03 14:18:46 1.11
+++ Path.java 2001/01/05 14:26:27 1.12
@@ -466,4 +466,38 @@
}
}
+ /**
+ * Concatenates the system class path in the order specified
+ * by the ${build.sysclasspath} property.
+ */
+ public Path concatSystemClasspath() {
+
+ Path result = new Path(project);
+
+ String order = project.getProperty("build.sysclasspath");
+ if (order == null) order="first";
+
+ if (order.equals("only")) {
+ // only: the developer knows what (s)he is doing
+ result.addExisting(Path.systemClasspath);
+
+ } else if (order.equals("last")) {
+ // last: don't trust the developer
+ result.addExisting(this);
+ result.addExisting(Path.systemClasspath);
+
+ } else if (order.equals("ignore")) {
+ // ignore: don't trust anyone
+ result.addExisting(this);
+
+ } else {
+ // first: developer could use a little help
+ result.addExisting(Path.systemClasspath);
+ result.addExisting(this);
+ }
+
+ return result;
+
+ }
+
}