String[] resources = new String[] {targetResource};
JavaCompiler javaCompiler = (new JavaCompilerFactory()).createCompiler(options.getCompiler().substring(4));
FileResourceReader reader = new FileResourceReader(ctxt.getOptions().getScratchDir());
FileResourceStore store = new FileResourceStore(ctxt.getOptions().getScratchDir());
JavaCompilerSettings settings = javaCompiler.createDefaultSettings();
if (settings == null) {
settings = new JavaCompilerSettings();
}
settings.setDeprecations(false);
if (ctxt.getOptions().getJavaEncoding() != null) {
settings.setSourceEncoding(ctxt.getOptions().getJavaEncoding());
}
if (ctxt.getOptions().getClassDebugInfo()) {
// No support
}
// Source JVM
if (ctxt.getOptions().getCompilerSourceVM() != null) {
settings.setSourceVersion(ctxt.getOptions().getCompilerSourceVM());
} else {
// Default to 1.5
settings.setSourceVersion("1.5");
}
// Target JVM
if (ctxt.getOptions().getCompilerTargetVM() != null) {
settings.setTargetVersion(ctxt.getOptions().getCompilerTargetVM());
} else {
// Default to 1.5
settings.setTargetVersion("1.5");
}
CompilationResult result = javaCompiler.compile(resources, reader, store, classLoader, settings);
ArrayList<JavacErrorDetail> problemList = new ArrayList<JavacErrorDetail>();