use of com.intellij.execution.process.OSProcessHandler in project intellij-elixir by KronicDeth.
the class ElixirXDebugProcess method runDebugTarget.
@NotNull
private OSProcessHandler runDebugTarget() throws ExecutionException {
OSProcessHandler elixirProcessHandler;
LOG.debug("Preparing to run debug target.");
ArrayList<String> elixirParams = new ArrayList<>();
elixirParams.addAll(myRunningState.setupElixirParams());
elixirParams.addAll(setUpElixirDebuggerCodePath());
List<String> mixParams = new ArrayList<>();
mixParams.addAll(Arrays.asList("intellij_elixir.debug_task", "--debugger-port", "" + myDebuggerNode.getLocalDebuggerPort(), "--"));
List<String> mixCommandArgs = getRunConfiguration().getMixArgs();
mixParams.addAll(mixCommandArgs);
if (getRunConfiguration() instanceof MixExUnitRunConfiguration && !mixCommandArgs.contains("--trace")) {
// Prevents tests from timing out while debugging
mixParams.add("--trace");
}
GeneralCommandLine commandLine = MixRunningStateUtil.commandLine(getRunConfiguration(), elixirParams, mixParams);
LOG.debug("Running debugger process. Command line (platform-independent): ");
LOG.debug(commandLine.getCommandLineString());
Process process = commandLine.createProcess();
elixirProcessHandler = new OSProcessHandler(process, commandLine.getCommandLineString());
LOG.debug("Debugger process started.");
return elixirProcessHandler;
}
use of com.intellij.execution.process.OSProcessHandler in project intellij-plugins by JetBrains.
the class KarmaDebugProgramRunner method resumeTestRunning.
private static void resumeTestRunning(@NotNull ProcessHandler processHandler) {
if (processHandler instanceof OSProcessHandler) {
// process's input stream will be closed on process termination
@SuppressWarnings({ "IOResourceOpenedButNotSafelyClosed", "ConstantConditions" }) PrintWriter writer = new PrintWriter(processHandler.getProcessInput());
writer.print("resume-test-running\n");
writer.flush();
}
}
use of com.intellij.execution.process.OSProcessHandler in project intellij-plugins by JetBrains.
the class BndTestState method startProcess.
@NotNull
@Override
protected OSProcessHandler startProcess() throws ExecutionException {
OSProcessHandler processHandler = super.startProcess();
processHandler.addProcessListener(new ProcessAdapter() {
@Override
public void processTerminated(ProcessEvent event) {
cleanup();
}
});
return processHandler;
}
use of com.intellij.execution.process.OSProcessHandler in project intellij-plugins by JetBrains.
the class BndLaunchState method startProcess.
@NotNull
@Override
protected OSProcessHandler startProcess() throws ExecutionException {
OSProcessHandler handler = super.startProcess();
MessageBusConnection connection = myProject.getMessageBus().connect();
connection.subscribe(CompilerTopics.COMPILATION_STATUS, this);
HotSwapUI hotSwapManager = HotSwapUI.getInstance(myProject);
hotSwapManager.addListener(this);
handler.addProcessListener(new ProcessAdapter() {
@Override
public void processTerminated(ProcessEvent event) {
connection.disconnect();
hotSwapManager.removeListener(BndLaunchState.this);
myLauncher.cleanup();
}
});
return handler;
}
use of com.intellij.execution.process.OSProcessHandler in project intellij-plugins by JetBrains.
the class PhoneGapExecutableChecker method check.
public static void check(Project project) {
PhoneGapSettings instance = PhoneGapSettings.getInstance();
if (StringUtil.isEmpty(instance.getExecutablePath())) {
noPhoneGap();
return;
}
String phoneGapExecutablePath = instance.getExecutablePath();
final GeneralCommandLine generalCommandLine = new GeneralCommandLine(phoneGapExecutablePath, "--version");
generalCommandLine.setWorkDirectory(project.getBasePath());
try {
final OSProcessHandler handler = new OSProcessHandler(generalCommandLine);
handler.startNotify();
generalCommandLine.createProcess();
} catch (Exception e) {
noPhoneGap();
}
}
Aggregations