Search in sources :

Example 1 with CompileContextImpl

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;
}
Also used : Project(com.intellij.openapi.project.Project) ModuleCompileScope(com.intellij.compiler.impl.ModuleCompileScope) CompileScope(com.intellij.openapi.compiler.CompileScope) ArtifactCompileScope(com.intellij.packaging.impl.compiler.ArtifactCompileScope) CompilerTask(com.intellij.compiler.progress.CompilerTask) CompileContextImpl(com.intellij.compiler.impl.CompileContextImpl) Module(com.intellij.openapi.module.Module) CompileContext(com.intellij.openapi.compiler.CompileContext) ModuleCompileScope(com.intellij.compiler.impl.ModuleCompileScope)

Aggregations

CompileContextImpl (com.intellij.compiler.impl.CompileContextImpl)1 ModuleCompileScope (com.intellij.compiler.impl.ModuleCompileScope)1 CompilerTask (com.intellij.compiler.progress.CompilerTask)1 CompileContext (com.intellij.openapi.compiler.CompileContext)1 CompileScope (com.intellij.openapi.compiler.CompileScope)1 Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1 ArtifactCompileScope (com.intellij.packaging.impl.compiler.ArtifactCompileScope)1