Examples of ProcessOutput


Examples of com.intellij.execution.process.ProcessOutput

    command.setExePath(exePath);
    command.addParameter("-help");
    command.setWorkDirectory(path);

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

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

      final String outputString = output.getStderr();

      String haxeVersion = "NA";
      final Matcher matcher = VERSION_MATCHER.matcher(outputString);
      if (matcher.find()) {
        haxeVersion = matcher.group(1);
View Full Code Here

Examples of com.intellij.execution.process.ProcessOutput

  }


  private List<String> getAndroidDevices(List<String> commands) throws ExecutionException {
    List<String> result = ContainerUtil.newArrayList();
    ProcessOutput output =
      ExecUtil.execAndGetOutput(commands, myProject.getBasePath());

    if (output.getExitCode() == 0 && StringUtil.isEmpty(output.getStderr())) {
      String[] split = output.getStdout().split("\n");
      for (String s : split) {
        String device = s.trim();
        if (!StringUtil.isEmpty(device) && !device.startsWith("List of devices attached")) {
          result.add(device);
        }
View Full Code Here

Examples of com.intellij.execution.process.ProcessOutput

    if (pathError) {
      error.set(PhoneGapBundle.message("phonegap.plugins.executable.work.path.error", commandLine.getPlatformName()));
      return commandLine;
    }

    ProcessOutput output = commandLine.pluginListRaw();
    if (!StringUtil.isEmpty(output.getStderr())) {
      error.set(PhoneGapBundle.message("phonegap.plugins.executable.work.path.error", commandLine.getPlatformName()));
      return commandLine;
    }

    if (commandLine.isOld()) {
View Full Code Here

Examples of com.intellij.execution.process.ProcessOutput

          public void run(@NotNull final ProgressIndicator indicator) {
            try {
              String platform = phoneGapRunConfiguration.getPlatform();
              assert platform != null;
              ProcessOutput output = line.platformAdd(platform);
              if (output.getExitCode() != 0) {
                ExecutionHelper.showOutput(project, output, "Init PhoneGap/Cordova platform", null, true);
                result.set(false);
                targetDone.up();
                return;
              }
View Full Code Here

Examples of com.intellij.execution.process.ProcessOutput

            command.setExePath(goCommand);
            command.addParameter("version");
            command.withWorkDirectory(path);
            command.getEnvironment().put("GOROOT", path);

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

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

            data.VERSION_MAJOR = output.getStdout().replaceAll("go version", "").trim();
            return data;
        } catch (Exception e) {
            LOG.error("Exception while executing the process:", e);
            return null;
        }
View Full Code Here

Examples of com.intellij.execution.process.ProcessOutput

            command.setExePath(goCommand);
            command.addParameter("env");
            command.withWorkDirectory(path);
            command.getEnvironment().put("GOROOT", path);

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

            if (output.getExitCode() != 0) {
                LOG.error(
                        format(
                                "%s env command exited with invalid exit code: %d",
                                goCommand, output.getExitCode()));
                return null;
            }

            String outputString = output.getStdout();

            Matcher matcher;
            matcher = RE_HOSTOS_MATCHER.matcher(outputString);
            if (matcher.find()) {
                data.TARGET_OS = GoTargetOs.fromString(matcher.group(1));
View Full Code Here

Examples of com.intellij.execution.process.ProcessOutput

        sdkData.TARGET_ARCH = GoTargetArch._amd64;
        sdkData.TARGET_OS = GoTargetOs.Linux;

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

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

            String outputString = output.getStdout();

            Matcher matcher = RE_OS_MATCHER.matcher(outputString);
            if (matcher.find()) {
                sdkData.TARGET_OS = GoTargetOs.fromString(matcher.group(1));
            }
View Full Code Here

Examples of com.intellij.execution.process.ProcessOutput

        goCommandLine.addParameter("env");

        LOG.info("command: " + command);

        try {
            ProcessOutput output = new CapturingProcessHandler(
                    goCommandLine.createProcess(),
                    Charset.defaultCharset(),
                    goCommandLine.getCommandLineString()).runProcess();

            if (output.getExitCode() == 0) {
                String outputString = output.getStdout();

                LOG.info("Output:\n" + outputString);
                Matcher matcher = RE_ROOT_MATCHER.matcher(outputString);
                if (matcher.find()) {
                    LOG.info("Matched: " + matcher.group(1));
View Full Code Here

Examples of com.intellij.execution.process.ProcessOutput

        try {
            GeneralCommandLine command = new GeneralCommandLine();
            command.setExePath(path);
            command.addParameter("--version");

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

            if (output.getExitCode() != 0) {
                LOG.error("gdb exited with invalid exit code: " + output.getExitCode());
                return false;
            }

            String cmdOutput = output.getStdout();
            return cmdOutput.contains("(GDB) 7.6") || cmdOutput.contains("(GDB) 7.4");
        } catch (Exception e) {
            LOG.error("Exception while executing the process:", e);
            return false;
        }
View Full Code Here

Examples of com.intellij.execution.process.ProcessOutput

        try {
            GeneralCommandLine command = new GeneralCommandLine();
            command.setExePath(path);
            command.addParameter("--version");

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

            if (output.getExitCode() != 0) {
                LOG.error("gdb exited with invalid exit code: " + output.getExitCode());
                return false;
            }

            // TODO maybe we should warn the user that his GDB version is not the latest at time of writing (7.6.2)
            return output.getStdout().contains("GDB");
        } catch (Exception e) {
            LOG.error("Exception while executing the process:", e);
            return false;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.