configuration.setJointCompilationOptions(compilerOptions);
jointCompilation = true;
}
if (jointCompilation) {
JavaAwareCompilationUnit unit = new JavaAwareCompilationUnit(configuration, buildClassLoaderFor());
if (javac!=null) {
final JavaCompiler compiler = new JavaCompiler() {
public void compile(List files, CompilationUnit cu) {
// forward options
if (javac.getClasspath()==null) {
javac.setClasspath(compileClasspath);
}
if (javac.getSourcepath()==null && compileSourcepath!=null) {
javac.createSourcepath().add(compileSourcepath);
}
if (javac.getEncoding()==null) {
javac.setEncoding(encoding);
}
javac.setDestdir(destDir);
Path p = javac.createSrc();
p.add(src);
Path tmpDir = new Path(getProject());
File dir = (File) cu.getConfiguration().getJointCompilationOptions().get("stubDir");
tmpDir.setLocation(dir);
p.add(tmpDir);
javac.execute();
}
};
unit.setCompilerFactory(new JavaCompilerFactory() {
public JavaCompiler createCompiler(CompilerConfiguration config) {
return compiler;
}
});
}