Package com.intellij.execution.process

Examples of com.intellij.execution.process.ProcessOutput


  public static ProcessOutput getProcessOutput(int timeout,
                                               @NotNull String workDir,
                                               @NotNull String exePath,
                                               @NotNull String... arguments) throws ExecutionException {
    if (!new File(workDir).isDirectory() || !new File(exePath).canExecute()) {
      return new ProcessOutput();
    }

    GeneralCommandLine cmd = new GeneralCommandLine();
    cmd.setWorkDirectory(workDir);
    cmd.setExePath(exePath);
View Full Code Here


      if (tryToProcessAsStandardLibraryDir(sdkModificator, stdLibDir)) return;
    }

    try {
      String exePath = JpsErlangSdkType.getByteCodeCompilerExecutable(sdkHome).getAbsolutePath();
      ProcessOutput processOutput = ErlangSystemUtil.getProcessOutput(sdkHome, exePath, "-where");
      if (processOutput.getExitCode() == 0) {
        String stdout = processOutput.getStdout().trim();
        if (!stdout.isEmpty()) {
          if (SystemInfo.isWindows && stdout.startsWith("/")) {
            for (File root : File.listRoots()) {
              File stdLibDir = new File(root, stdout);
              if (tryToProcessAsStandardLibraryDir(sdkModificator, stdLibDir)) return;
View Full Code Here

      commandLine.setExePath(erlc);

//      System.out.println(commandLine.getCommandLineString());

      ProcessOutput output = null;
      try {
        output = new CapturingProcessHandler(commandLine.createProcess(), Charset.defaultCharset(), commandLine.getCommandLineString()).runProcess();
      } catch (ExecutionException e) {
        context.addMessage(CompilerMessageCategory.ERROR, "process throw exception: " + e.getMessage(), null, -1, -1);
      }

      if (output != null) {
        fillContext(module, context, output.getStdoutLines());
      }
    }
  }
View Full Code Here

  @Nullable
  @Override
  public State doAnnotate(State state) {
    if (state == null) return null;

    ProcessOutput output = null;
    try {
      String[] params = StringUtil.isEmptyOrSpaces(state.myCurrentPltPath) ? new String[]{state.myFilePath} : new String[]{"--plt", state.myCurrentPltPath, state.myFilePath};
      output = ErlangSystemUtil.getProcessOutput(state.myWorkingDir, state.myDialyzerPath, params);
    } catch (ExecutionException e) {
      LOG.debug(e);
    }
    if (output != null) {
      if (output.getStderrLines().isEmpty()) {
        for (String line : output.getStdoutLines()) {
          LOG.debug(line);
          if (line.startsWith("dialyzer: ")) {
            NOTIFICATION_GROUP.createNotification(line, NotificationType.WARNING).notify(null); // todo: get a project
            return state;
          }
View Full Code Here

      GeneralCommandLine command = new GeneralCommandLine();
      command.setExePath(rustc.getAbsolutePath());
      command.addParameter("--version");
      command.setWorkDirectory(rustc.getParent());

      ProcessOutput output = new CapturingProcessHandler(
          command.createProcess(),
          Charset.defaultCharset(),
          command.getCommandLineString()).runProcess();

      if (output.getExitCode() != 0) {
        LOG.error(
                    "rustc exited with invalid exit code: " +
                    output.getExitCode() + "\n" +
                    output.getStdout()
                );
        return null;
      }

      String[] lines = output.getStdout().split("\n");
      if (lines.length > 2 || lines.length == 0) {
        LOG.error("invalid rustc output: expected 1 or 2 lines, got " + lines.length);
        return null;
      }
      String[] line1 = lines[0].split(" ");
View Full Code Here

        GeneralCommandLine commandLine = new GeneralCommandLine();
        commandLine.setExePath(mongoShellPath);
        commandLine.addParameter("--version");
        CapturingProcessHandler handler = new CapturingProcessHandler(commandLine.createProcess(), CharsetToolkit.getDefaultSystemCharset());
        ProcessOutput result = handler.runProcess(15 * 1000);
        return result.getExitCode() == 0;
    }
View Full Code Here

TOP

Related Classes of com.intellij.execution.process.ProcessOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.