use of com.intellij.openapi.compiler.CompileStatusNotification in project intellij-community by JetBrains.
the class AppEngineUploader method compileAndUpload.
private void compileAndUpload() {
final Runnable startUploading = () -> ApplicationManager.getApplication().invokeLater(() -> startUploadingProcess());
final CompilerManager compilerManager = CompilerManager.getInstance(myProject);
final CompileScope moduleScope = compilerManager.createModuleCompileScope(myAppEngineFacet.getModule(), true);
final CompileScope compileScope = ArtifactCompileScope.createScopeWithArtifacts(moduleScope, Collections.singletonList(myArtifact));
ApplicationManager.getApplication().invokeLater(() -> compilerManager.make(compileScope, new CompileStatusNotification() {
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
if (!aborted && errors == 0) {
startUploading.run();
}
}
}));
}
use of com.intellij.openapi.compiler.CompileStatusNotification in project intellij-community by JetBrains.
the class ShowSerializedXmlAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final PsiClass psiClass = getPsiClass(e);
if (psiClass == null)
return;
final VirtualFile virtualFile = psiClass.getContainingFile().getVirtualFile();
final Module module = ModuleUtilCore.findModuleForPsiElement(psiClass);
if (module == null || virtualFile == null)
return;
final String className = ClassUtil.getJVMClassName(psiClass);
final Project project = getEventProject(e);
CompilerManager.getInstance(project).make(new FileSetCompileScope(Collections.singletonList(virtualFile), new Module[] { module }), new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
if (aborted || errors > 0)
return;
generateAndShowXml(module, className);
}
});
}
use of com.intellij.openapi.compiler.CompileStatusNotification in project intellij-community by JetBrains.
the class BaseClassesAnalysisAction method compileAndAnalyze.
private void compileAndAnalyze(@NotNull Project project, @NotNull AnalysisScope scope) {
if (project.isDisposed()) {
return;
}
final CompilerManager compilerManager = CompilerManager.getInstance(project);
compilerManager.make(compilerManager.createProjectCompileScope(project), new CompileStatusNotification() {
@Override
public void finished(final boolean aborted, final int errors, final int warnings, final CompileContext compileContext) {
if (aborted || errors != 0)
return;
ApplicationManager.getApplication().invokeLater(() -> doAnalyze(project, scope));
}
});
}
use of com.intellij.openapi.compiler.CompileStatusNotification in project azure-tools-for-java by Microsoft.
the class IDEHelperImpl method buildArtifact.
private static ListenableFuture<Boolean> buildArtifact(@NotNull Project project, @NotNull final Artifact artifact, boolean rebuild) {
final SettableFuture<Boolean> future = SettableFuture.create();
Set<Artifact> artifacts = new LinkedHashSet<Artifact>(1);
artifacts.add(artifact);
CompileScope scope = ArtifactCompileScope.createArtifactsScope(project, artifacts, rebuild);
ArtifactsWorkspaceSettings.getInstance(project).setArtifactsToBuild(artifacts);
CompilerManager.getInstance(project).make(scope, new CompileStatusNotification() {
@Override
public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
future.set(!aborted && errors == 0);
}
});
return future;
}
Aggregations