use of com.intellij.execution.process.ProcessHandler in project buck by facebook.
the class TestExecutionState method execute.
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
final ProcessHandler processHandler = runBuildCommand(executor);
final TestConsoleProperties properties = new BuckTestConsoleProperties(processHandler, mProject, mConfiguration, "Buck test", executor);
final ConsoleView console = SMTestRunnerConnectionUtil.createAndAttachConsole("buck test", processHandler, properties);
return new DefaultExecutionResult(console, processHandler, AnAction.EMPTY_ARRAY);
}
use of com.intellij.execution.process.ProcessHandler in project intellij-community by JetBrains.
the class CompileQrcAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
VirtualFile[] vFiles = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
assert vFiles != null;
Module module = e.getData(LangDataKeys.MODULE);
String path = QtFileType.findQtTool(module, "pyrcc4");
if (path == null) {
path = QtFileType.findQtTool(module, "pyside-rcc");
}
if (path == null) {
Messages.showErrorDialog(project, "Could not find pyrcc4 or pyside-rcc for selected Python interpreter", "Compile .qrc file");
return;
}
CompileQrcDialog dialog = new CompileQrcDialog(project, vFiles);
dialog.show();
if (dialog.getExitCode() != DialogWrapper.OK_EXIT_CODE) {
return;
}
GeneralCommandLine cmdLine = new GeneralCommandLine(path, "-o", dialog.getOutputPath());
for (VirtualFile vFile : vFiles) {
cmdLine.addParameter(vFile.getPath());
}
try {
ProcessHandler process = new OSProcessHandler(cmdLine);
ProcessTerminatedListener.attach(process);
new RunContentExecutor(project, process).withTitle("Compile .qrc").run();
} catch (ExecutionException ex) {
Messages.showErrorDialog(project, "Error running " + path + ": " + ex.getMessage(), "Compile .qrc file");
}
}
use of com.intellij.execution.process.ProcessHandler in project intellij-community by JetBrains.
the class RestCommandLineState method doCreateProcess.
protected ProcessHandler doCreateProcess(GeneralCommandLine commandLine) throws ExecutionException {
final Runnable afterTask = getAfterTask();
ProcessHandler processHandler = PythonProcessRunner.createProcess(commandLine, false);
if (afterTask != null) {
processHandler.addProcessListener(new ProcessAdapter() {
public void processTerminated(ProcessEvent event) {
SwingUtilities.invokeLater(afterTask);
}
});
}
return processHandler;
}
use of com.intellij.execution.process.ProcessHandler in project intellij-community by JetBrains.
the class SphinxBaseCommand method execute.
public void execute(@NotNull final Module module) {
final Project project = module.getProject();
try {
if (!setWorkDir(module))
return;
final ProcessHandler process = createProcess(module);
new RunContentExecutor(project, process).withFilter(new PythonTracebackFilter(project)).withTitle("reStructuredText").withRerun(() -> execute(module)).withAfterCompletion(getAfterTask(module)).run();
} catch (ExecutionException e) {
Messages.showErrorDialog(e.getMessage(), "ReStructuredText Error");
}
}
use of com.intellij.execution.process.ProcessHandler in project intellij-community by JetBrains.
the class PyCCCommandLineState method doCreateProcess.
@Override
protected ProcessHandler doCreateProcess(GeneralCommandLine commandLine) throws ExecutionException {
ProcessHandler handler = super.doCreateProcess(commandLine);
handler.addProcessListener(new ProcessAdapter() {
@Override
public void processTerminated(ProcessEvent event) {
ApplicationManager.getApplication().invokeLater(() -> EduUtils.deleteWindowDescriptions(myTask, myTaskDir));
}
});
return handler;
}
Aggregations