throw new BuildException(ERROR_NOT_A_DIR + outputDir, getLocation());
}
if (verify) {
log("Verify has been turned on.", Project.MSG_VERBOSE);
}
RmicAdapter adapter =
nestedAdapter != null ? nestedAdapter :
RmicAdapterFactory.getRmic(getCompiler(), this,
createCompilerClasspath());
// now we need to populate the compiler adapter
adapter.setRmic(this);
Path classpath = adapter.getClasspath();
loader = getProject().createClassLoader(classpath);
// scan base dirs to build up compile lists only if a
// specific classname is not given
if (classname == null) {
DirectoryScanner ds = this.getDirectoryScanner(baseDir);
String[] files = ds.getIncludedFiles();
scanDir(baseDir, files, adapter.getMapper());
} else {
// otherwise perform a timestamp comparison - at least
String path = classname.replace('.', File.separatorChar)
+ ".class";
File f = new File(baseDir, path);
if (f.isFile()) {
scanDir(baseDir, new String[] {path}, adapter.getMapper());
} else {
// Does not exist, so checking whether it is up to
// date makes no sense. Compilation will fail
// later anyway, but tests expect a certain
// output.
compileList.add(classname);
}
}
int fileCount = compileList.size();
if (fileCount > 0) {
log("RMI Compiling " + fileCount + " class"
+ (fileCount > 1 ? "es" : "") + " to "
+ outputDir, Project.MSG_INFO);
if (listFiles) {
for (int i = 0; i < fileCount; i++) {
log(compileList.get(i).toString());
}
}
// finally, lets execute the compiler!!
if (!adapter.execute()) {
throw new BuildException(ERROR_RMIC_FAILED, getLocation());
}
}
/*
* Move the generated source file to the base directory. If