use of com.intellij.execution.DefaultExecutionResult in project intellij-community by JetBrains.
the class AntRunProfileState method execute.
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
final RunProfile profile = myEnvironment.getRunProfile();
if (profile instanceof AntRunConfiguration) {
final AntRunConfiguration runConfig = (AntRunConfiguration) profile;
if (runConfig.getTarget() == null) {
return null;
}
final ProcessHandler processHandler = ExecutionHandler.executeRunConfiguration(runConfig, myEnvironment.getDataContext(), runConfig.getProperties(), AntBuildListener.NULL);
if (processHandler == null) {
return null;
}
return new DefaultExecutionResult(null, processHandler);
}
return null;
}
use of com.intellij.execution.DefaultExecutionResult in project intellij-community by JetBrains.
the class PythonScriptCommandLineState method execute.
@Override
public ExecutionResult execute(Executor executor, PythonProcessStarter processStarter, final CommandLinePatcher... patchers) throws ExecutionException {
if (myConfig.showCommandLineAfterwards() && !myConfig.emulateTerminal()) {
if (executor.getId() == DefaultDebugExecutor.EXECUTOR_ID) {
return super.execute(executor, processStarter, ArrayUtil.append(patchers, new CommandLinePatcher() {
@Override
public void patchCommandLine(GeneralCommandLine commandLine) {
commandLine.getParametersList().getParamsGroup(PythonCommandLineState.GROUP_DEBUGGER).addParameterAt(1, "--cmd-line");
}
}));
}
PythonScriptWithConsoleRunner runner = new PythonScriptWithConsoleRunner(myConfig.getProject(), myConfig.getSdk(), PyConsoleType.PYTHON, myConfig.getWorkingDirectory(), myConfig.getEnvs(), patchers, PyConsoleOptions.getInstance(myConfig.getProject()).getPythonConsoleSettings());
runner.setEnableAfterConnection(false);
runner.runSync();
// runner.getProcessHandler() would be null if execution error occurred
if (runner.getProcessHandler() == null) {
return null;
}
runner.getPydevConsoleCommunication().setConsoleView(runner.getConsoleView());
List<AnAction> actions = Lists.newArrayList(createActions(runner.getConsoleView(), runner.getProcessHandler()));
actions.add(new ShowVarsAction(runner.getConsoleView(), runner.getPydevConsoleCommunication()));
return new DefaultExecutionResult(runner.getConsoleView(), runner.getProcessHandler(), actions.toArray(new AnAction[actions.size()]));
} else if (myConfig.emulateTerminal()) {
setRunWithPty(true);
final ProcessHandler processHandler = startProcess(processStarter, patchers);
TerminalExecutionConsole executeConsole = new TerminalExecutionConsole(myConfig.getProject(), processHandler);
executeConsole.addMessageFilter(myConfig.getProject(), new PythonTracebackFilter(myConfig.getProject()));
executeConsole.addMessageFilter(myConfig.getProject(), new UrlFilter());
processHandler.startNotify();
return new DefaultExecutionResult(executeConsole, processHandler, AnAction.EMPTY_ARRAY);
} else {
return super.execute(executor, processStarter, patchers);
}
}
use of com.intellij.execution.DefaultExecutionResult in project intellij-plugins by JetBrains.
the class CfmlUnitRunConfiguration method getState.
@Override
public RunProfileState getState(@NotNull Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException {
return new RunProfileState() {
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
final ProcessHandler processHandler = new MyProcessHandler();
final ConsoleView console = createConsole(getProject(), processHandler, env, executor);
console.addMessageFilter(new CfmlStackTraceFilterProvider(getProject()));
// processHandler.startNotify();
runTests(processHandler);
return new DefaultExecutionResult(console, processHandler);
}
};
}
Aggregations