/**
* Creates a configured {@link JavacTask}.
*/
protected JavacTask configure(DiagnosticListener<? super JavaFileObject> errorListener) throws IOException {
JavaCompiler javac = JavacTool.create();
StandardJavaFileManager fileManager = new TabExpandingFileManager(
javac.getStandardFileManager(errorListener, locale, encoding),encoding,tabWidth);
fileManager.setLocation( StandardLocation.CLASS_PATH, classpath );
// annotation processing appears to cause the source files to be reparsed
// (even though I couldn't find exactly where it's done), which causes
// Tree symbols created by the original JavacTask.parse() call to be thrown away,
// which breaks later processing.
// So for now, don't perform annotation processing
List<String> options = Arrays.asList("-proc:none");
Iterable<? extends JavaFileObject> files = fileManager.getJavaFileObjectsFromFiles(sourceFiles);
CompilationTask task = javac.getTask(null, fileManager, errorListener, options, null, files);
return (JavacTask)task;
}