OSProcessHandler handler = new OSProcessHandler( generalCommandLine.createProcess(), generalCommandLine.getPreparedCommandLine(Platform.current())
final OSProcessHandler handler = new OSProcessHandler(commandLine); handler.addProcessListener(new ProcessAdapter() { @Override
@NotNull @Override protected ProcessHandler startProcess() throws ExecutionException { try { final GeneralCommandLine dubCommandLine = getExecutableCommandLine(config); return new OSProcessHandler(dubCommandLine.createProcess(), dubCommandLine.getCommandLineString()); } catch (final ExecutionException e) { final String message = e.getMessage(); final Project project = config.getProject(); final boolean isEmpty = message.equals("DUB executable is not specified"); final boolean notCorrect = message.startsWith("Cannot run program"); if (isEmpty || notCorrect) { Notifications.Bus.notify( new Notification("DUB run configuration", "DUB settings", "DUB executable is " + (isEmpty ? "not specified" : "not specified correctly") + "<br/><a href='configureDLanguageTools'>Configure</a> executable", NotificationType.ERROR, new DToolsNotificationListener(project)), project); } throw e; } }
@NotNull @Override public ProcessHandler startProcess() throws ExecutionException { try { final GeneralCommandLine appCommandLine = getExecutableCommandLine(config); return new OSProcessHandler(appCommandLine.createProcess(), appCommandLine.getCommandLineString()); } catch (final NoValidDlangSdkFound e) { throw new ExecutionException("No valid DMD SDK found!"); } catch (final ModuleNotFoundException e) { throw new ExecutionException("Run configuration has no module selected."); } catch (final ExecutionException e) { final String message = e.getMessage(); final boolean isEmpty = message.equals("Executable is not specified"); final boolean notCorrect = message.startsWith("Cannot run program"); if (isEmpty || notCorrect) { Notifications.Bus.notify( new Notification("D App run configuration", "D App settings", "D application executable path is " + (isEmpty ? "empty" : "not specified correctly") + "<br/><a href='configure'>Configure</a> output folder", NotificationType.ERROR), config.getProject()); } throw e; } }
@NotNull @Override protected ProcessHandler startProcess() throws ExecutionException { try { final GeneralCommandLine cmd = getDmdCommandLine(config); final OSProcessHandler handler = new OSProcessHandler(cmd.createProcess(), cmd.getCommandLineString()); handler.addProcessListener(this); return handler; } catch (final NoValidDlangSdkFound e) { throw new ExecutionException("No valid DMD SDK found!"); } catch (final NoSourcesException e) { throw new ExecutionException("No D Language source files found in directory: " + e.getSourcesRoot()); } catch (final ModuleNotFoundException e) { throw new ExecutionException("Run configuration has no module selected."); } catch (final ExecutionException e) { final String message = e.getMessage(); final boolean isEmpty = message.equals("Executable is not specified"); final boolean notCorrect = message.startsWith("Cannot run program"); if (isEmpty || notCorrect) { Notifications.Bus.notify( new Notification("DMD run configuration", "DMD settings", "DMD executable path is " + (isEmpty ? "empty" : "not specified correctly") + "<br/><a href='configure'>Configure</a>", NotificationType.ERROR), config.getProject()); } throw e; } }
final DubProcessListener listener = new DubProcessListener(); final OSProcessHandler process = new OSProcessHandler(cmd.createProcess(), dubCommand); process.addProcessListener(listener); process.startNotify();
final OSProcessHandler process = new OSProcessHandler(cmd.createProcess(), cmd.getCommandLineString()); final DubInitListener listener = new DubInitListener(); process.addProcessListener(listener);
final OSProcessHandler process = new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString()); process.addProcessListener(new ProcessAdapter() { @Override
@NotNull private String processFile(final PsiFile file, final String dubPath) { final GeneralCommandLine cmd = new GeneralCommandLine() .withWorkDirectory(file.getProject().getBasePath()) .withExePath(dubPath) .withEnvironment("DFLAGS", "-o-") .withParameters("build", "--combined", "-q"); try { final String dubCommand = cmd.getCommandLineString(); final DubProcessListener listener = new DubProcessListener(); final OSProcessHandler process = new OSProcessHandler(cmd.createProcess(), dubCommand); process.addProcessListener(listener); process.startNotify(); process.waitFor(); return listener.getOutput(); } catch (final ExecutionException e) { LOG.warn("There was a problem running 'dub build --combined -q'", e); } return ""; }
final OSProcessHandler process = new OSProcessHandler(cmd.createProcess(), cmd.getCommandLineString()); process.addProcessListener(new ProcessAdapter() { @Override
final OSProcessHandler handler = new OSProcessHandler(commandLine.createProcess(), commandLineString); handler.addProcessListener(new CapturingProcessAdapter() { @Override
final OSProcessHandler process = new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());