use of com.intellij.compiler.impl.CompileContextImpl in project android by JetBrains.
the class AndroidCompileUtil method doGenerate.
public static boolean doGenerate(AndroidFacet facet, final AndroidAutogeneratorMode mode) {
assert !ApplicationManager.getApplication().isDispatchThread();
final CompileContext[] contextWrapper = new CompileContext[1];
final Module module = facet.getModule();
final Project project = module.getProject();
ApplicationManager.getApplication().runReadAction(new Runnable() {
@Override
public void run() {
if (project.isDisposed())
return;
CompilerTask task = new CompilerTask(project, "Android auto-generation", true, false, true, true);
CompileScope scope = new ModuleCompileScope(module, false);
contextWrapper[0] = new CompileContextImpl(project, task, scope, false, false);
}
});
CompileContext context = contextWrapper[0];
if (context == null) {
return false;
}
generate(facet, mode, context, false);
return context.getMessages(CompilerMessageCategory.ERROR).length == 0;
}
Aggregations