Examples of ProcessOutput


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

Examples of com.intellij.execution.process.ProcessOutput

      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

Examples of com.intellij.execution.process.ProcessOutput

      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

Examples of com.intellij.execution.process.ProcessOutput

  @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

Examples of com.intellij.execution.process.ProcessOutput

      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

Examples of com.intellij.execution.process.ProcessOutput

        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

Examples of de.flapdoodle.embed.process.config.io.ProcessOutput

    }

    public static ProcessOutput file(String logFile, String encoding) {
        FileOutputStreamProcessor file = new FileOutputStreamProcessor(logFile, encoding);

        return new ProcessOutput(
                new NamedOutputStreamProcessor("[mongod output]", file),
                new NamedOutputStreamProcessor("[mongod error]", file),
                new NamedOutputStreamProcessor("[mongod commands]", file));
    }
View Full Code Here

Examples of de.flapdoodle.embed.process.config.io.ProcessOutput

        return MongodProcessOutputConfig.getDefaultInstance(Command.MongoD);
    }

    public static ProcessOutput none() {
        NoopStreamProcessor noop = new NoopStreamProcessor();
        return new ProcessOutput(noop, noop, noop);
    }
View Full Code Here

Examples of de.flapdoodle.embed.process.config.io.ProcessOutput

                int port = RandomPortNumberGenerator.pickAvailableRandomEphemeralPortNumber();
                IStreamProcessor output = new NullProcessor();

                IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder()
                        .defaults(Command.MongoD)
                        .processOutput(new ProcessOutput(output, output, output))
                        .build();
                IMongodConfig mongodConfig = new MongodConfigBuilder()
                        .version(Version.Main.PRODUCTION)
                        .net(new Net(port, Network.localhostIsIPv6()))
                        .build();
View Full Code Here

Examples of org.epic.core.util.ProcessOutput

    public CygwinPathMapper() throws CoreException
    {
        try
        {       
            ProcessExecutor executor = new ProcessExecutor();
            ProcessOutput output =
                executor.execute(new String[] { "mount" }, "", new File("."), null);
           
            initMappings(output.stdout.replaceAll("\n", "\r\n"));
        }
        catch (InterruptedException e) { /* can't occur */ }
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.