use of com.intellij.openapi.compiler.CompileContext in project intellij-community by JetBrains.
the class PrepareToDeployAction method doPrepare.
public void doPrepare(final List<Module> pluginModules, final Project project) {
final List<String> errorMessages = new ArrayList<>();
final List<String> successMessages = new ArrayList<>();
final CompilerManager compilerManager = CompilerManager.getInstance(project);
compilerManager.make(compilerManager.createModulesCompileScope(pluginModules.toArray(new Module[pluginModules.size()]), true), new CompileStatusNotification() {
public void finished(final boolean aborted, final int errors, final int warnings, final CompileContext compileContext) {
if (aborted || errors != 0)
return;
ApplicationManager.getApplication().invokeLater(() -> {
for (Module aModule : pluginModules) {
if (!doPrepare(aModule, errorMessages, successMessages)) {
return;
}
}
if (!errorMessages.isEmpty()) {
Messages.showErrorDialog(errorMessages.iterator().next(), DevKitBundle.message("error.occurred"));
} else if (!successMessages.isEmpty()) {
StringBuilder messageBuf = new StringBuilder();
for (String message : successMessages) {
if (messageBuf.length() != 0) {
messageBuf.append('\n');
}
messageBuf.append(message);
}
final String title = pluginModules.size() == 1 ? DevKitBundle.message("success.deployment.message", pluginModules.get(0).getName()) : DevKitBundle.message("success.deployment.message.all");
NOTIFICATION_GROUP.createNotification(title, messageBuf.toString(), NotificationType.INFORMATION, null).notify(project);
}
}, project.getDisposed());
}
});
}
use of com.intellij.openapi.compiler.CompileContext 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.CompileContext in project intellij-plugins by JetBrains.
the class AirPackageAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
final Project project = e.getProject();
if (project == null)
return;
final AirPackageDialog dialog = new AirPackageDialog(project);
if (!dialog.showAndGet()) {
return;
}
final Collection<Pair<Module, FlexBuildConfiguration>> modulesAndBCs = dialog.getSelectedBCs();
final Set<Module> modules = new THashSet<>();
for (Pair<Module, FlexBuildConfiguration> bc : modulesAndBCs) {
modules.add(bc.first);
}
final CompilerManager compilerManager = CompilerManager.getInstance(project);
final CompileScope compileScope = compilerManager.createModulesCompileScope(modules.toArray(new Module[modules.size()]), false);
FlexResourceBuildTargetScopeProvider.setBCsToCompileForPackaging(compileScope, modulesAndBCs);
compilerManager.make(compileScope, new CompileStatusNotification() {
public void finished(final boolean aborted, final int errors, final int warnings, final CompileContext compileContext) {
if (!aborted && errors == 0) {
createPackages(project, modulesAndBCs, dialog.getPasswords());
}
}
});
}
use of com.intellij.openapi.compiler.CompileContext in project android by JetBrains.
the class IdeFrameFixture method invokeProjectMakeUsingJps.
@NotNull
public CompileContext invokeProjectMakeUsingJps() {
Project project = getProject();
AndroidGradleBuildConfiguration buildConfiguration = AndroidGradleBuildConfiguration.getInstance(project);
buildConfiguration.USE_EXPERIMENTAL_FASTER_BUILD = false;
AtomicReference<CompileContext> contextRef = new AtomicReference<>();
CompilerManager compilerManager = CompilerManager.getInstance(project);
Disposable disposable = new NoOpDisposable();
compilerManager.addCompilationStatusListener(new CompilationStatusListener() {
@Override
public void compilationFinished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
contextRef.set(compileContext);
}
}, disposable);
try {
selectProjectMakeAction();
Wait.seconds(10).expecting("Build (" + COMPILE_JAVA + ") for project " + quote(project.getName()) + " to finish'").until(() -> contextRef.get() != null);
return contextRef.get();
} finally {
Disposer.dispose(disposable);
}
}
use of com.intellij.openapi.compiler.CompileContext in project intellij-community by JetBrains.
the class ClassFilesIndexFeaturesHolder method projectOpened.
@Override
public final void projectOpened() {
for (final ClassFilesIndexFeature feature : ClassFilesIndexFeature.values()) {
final RegistryValue registryValue = feature.getRegistryValue();
registryValue.addListener(new RegistryValueListener.Adapter() {
@Override
public void afterValueChanged(final RegistryValue rawValue) {
if (!rawValue.asBoolean() && myEnabledFeatures.containsKey(feature)) {
disposeFeature(feature);
}
}
}, myProject);
}
final CompilerManager compilerManager = CompilerManager.getInstance(myProject);
compilerManager.addBeforeTask(new CompileTask() {
@Override
public boolean execute(final CompileContext context) {
close();
return true;
}
});
}
Aggregations