} else {
cmd.createArgument().setValue(Util.EMPTY_STRING);
}
}
Path classpath = new Path(this.project);
/*
* Eclipse compiler doesn't support -extdirs.
* It is emulated using the classpath. We add extdirs entries after the
* bootclasspath.
*/
if (this.extdirs != null) {
cmd.createArgument().setValue("-extdirs"); //$NON-NLS-1$
cmd.createArgument().setPath(this.extdirs);
}
/*
* The java runtime is already handled, so we simply want to retrieve the
* ant runtime and the compile classpath.
*/
classpath.append(getCompileClasspath());
// For -sourcepath, use the "sourcepath" value if present.
// Otherwise default to the "srcdir" value.
Path sourcepath = null;
// retrieve the method getSourcepath() using reflect
// This is done to improve the compatibility to ant 1.5
Method getSourcepathMethod = null;
try {
getSourcepathMethod = javacClass.getMethod("getSourcepath", null); //$NON-NLS-1$
} catch(NoSuchMethodException e) {
// if not found, then we cannot use this method (ant 1.5)
}
Path compileSourcePath = null;
if (getSourcepathMethod != null) {
try {
compileSourcePath = (Path) getSourcepathMethod.invoke(this.attributes, null);
} catch (IllegalAccessException e) {
// should never happen