use of com.intellij.execution.process.ProcessHandler in project android by JetBrains.
the class ProcessHandlerConsolePrinter method print.
private void print(@NotNull String text, @NotNull Key outputType) {
@NotNull final ProcessHandler processHandler;
synchronized (myLock) {
if (myProcessHandler == null) {
myStoredMessages.add(new Message(text, outputType));
return;
} else {
processHandler = myProcessHandler;
}
}
// and opens up the (remote) possibility of deadlock.
assert !Thread.holdsLock(myLock);
processHandler.notifyTextAvailable(text + '\n', outputType);
}
use of com.intellij.execution.process.ProcessHandler in project Intellij-Plugin by getgauge.
the class GaugeCommandLineState method execute.
@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
if (GaugeVersion.isGreaterOrEqual(GaugeRunConfiguration.TEST_RUNNER_SUPPORT_VERSION, false) && GaugeSettingsService.getSettings().useIntelliJTestRunner()) {
ProcessHandler handler = startProcess();
GaugeConsoleProperties properties = new GaugeConsoleProperties(config, "Gauge", executor, handler);
ConsoleView console = SMTestRunnerConnectionUtil.createAndAttachConsole("Gauge", handler, properties);
DefaultExecutionResult result = new DefaultExecutionResult(console, handler, createActions(console, handler));
if (ActionManager.getInstance().getAction("RerunFailedTests") != null) {
AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(console);
if (action != null) {
action.setModelProvider(((SMTRunnerConsoleView) console)::getResultsViewer);
result.setRestartActions(action);
}
}
return result;
}
return super.execute(executor, runner);
}
use of com.intellij.execution.process.ProcessHandler in project intellij-plugins by JetBrains.
the class KarmaRunProfileState method executeWithServer.
@NotNull
public ExecutionResult executeWithServer(@NotNull Executor executor, @NotNull KarmaServer server) throws ExecutionException {
server.getWatcher().flush();
KarmaExecutionSession session = new KarmaExecutionSession(myProject, myRunConfiguration, executor, server, myRunSettings, myExecutionType);
SMTRunnerConsoleView smtRunnerConsoleView = session.getSmtConsoleView();
ProcessHandler processHandler = session.getProcessHandler();
// TODO make smtRunnerConsoleView instance of LanguageConsoleView to make it more usage for debugging
DefaultExecutionResult executionResult = new DefaultExecutionResult(smtRunnerConsoleView, processHandler);
executionResult.setRestartActions(new ToggleAutoTestAction());
return executionResult;
}
use of com.intellij.execution.process.ProcessHandler in project intellij-leiningen-plugin by derkork.
the class LeiningenRunConfigurationType method runConfiguration.
public static void runConfiguration(Project project, LeiningenRunnerParameters params, DataContext context) {
RunnerAndConfigurationSettings configSettings = createRunnerAndConfigurationSettings(params, project);
ProgramRunner runner = RunnerRegistry.getInstance().findRunnerById(DefaultRunExecutor.EXECUTOR_ID);
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
ExecutionEnvironment env = new ExecutionEnvironment(executor, runner, configSettings, project);
try {
runner.execute(env, new ProgramRunner.Callback() {
public void processStarted(RunContentDescriptor runContentDescriptor) {
final ProcessHandler runContentDescriptorProcessHandler = runContentDescriptor.getProcessHandler();
if (runContentDescriptorProcessHandler != null) {
runContentDescriptorProcessHandler.addProcessListener(new ProcessAdapter() {
@Override
public void processTerminated(ProcessEvent event) {
LocalFileSystem.getInstance().refreshWithoutFileWatcher(true);
}
});
}
}
});
} catch (ExecutionException e) {
}
}
use of com.intellij.execution.process.ProcessHandler in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoTestRunningState method execute.
@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
ProcessHandler processHandler = startProcess();
TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(myConfiguration.getProject());
setConsoleBuilder(consoleBuilder);
GoTestConsoleProperties consoleProperties = new GoTestConsoleProperties(myConfiguration, executor);
String frameworkName = myConfiguration.getTestFramework().getName();
ConsoleView consoleView = SMTestRunnerConnectionUtil.createAndAttachConsole(frameworkName, processHandler, consoleProperties);
consoleView.addMessageFilter(new GoConsoleFilter(myConfiguration.getProject(), myModule, myConfiguration.getWorkingDirectoryUrl()));
ProcessTerminatedListener.attach(processHandler);
DefaultExecutionResult executionResult = new DefaultExecutionResult(consoleView, processHandler);
AbstractRerunFailedTestsAction rerunFailedTestsAction = consoleProperties.createRerunFailedTestsAction(consoleView);
if (rerunFailedTestsAction != null) {
rerunFailedTestsAction.setModelProvider(((SMTRunnerConsoleView) consoleView)::getResultsViewer);
executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
} else {
executionResult.setRestartActions(new ToggleAutoTestAction());
}
return executionResult;
}
Aggregations