if (!out.mkdirs()) {
Assert.fail("Creation of " + out.getPath() + " failed");
}
String classPath = SimpleCompiler.getClassPath((URLClassLoader) getClass().getClassLoader());
JavaCompiler compiler = new EclipseCompiler();
List<String> options = new ArrayList<String>();
options.add("-s");
options.add("target/out-eclipse");
options.add("-proc:only");
options.add("-processor");
options.add(QuerydslAnnotationProcessor.class.getName());
options.add("-Aquerydsl.entityAccessors=true");
options.add("-cp");
options.add(classPath);
options.add("-source");
options.add("1.6");
options.add("-verbose");
options.addAll(classes);
int compilationResult = compiler.run(null, System.out, System.err, options.toArray(new String[options.size()]));
if (compilationResult == 0) {
System.out.println("Compilation is successful");
} else {
Assert.fail("Compilation Failed");
}