Examples of GeneralCommandLine


Examples of com.intellij.execution.configurations.GeneralCommandLine

      throw new RuntimeException(e.getMessage(), e);
    }
  }

  private ProcessOutput executeAndGetOut(String[] command) throws ExecutionException {
    final GeneralCommandLine commandLine = new GeneralCommandLine(command);
    commandLine.withWorkDirectory(myWorkDir);
    commandLine.setPassParentEnvironment(true);
    Process process = commandLine.createProcess();
    OSProcessHandler processHandler = new ColoredProcessHandler(process, commandLine.getCommandLineString(), Charsets.UTF_8);
    final ProcessOutput output = new ProcessOutput();
    processHandler.addProcessListener(new ProcessAdapter() {
      @Override
      public void onTextAvailable(ProcessEvent event, Key outputType) {
        if (outputType == ProcessOutputTypes.STDERR) {
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

    this.project = project;
  }

  @Override
  public void run() {
    final GeneralCommandLine generalCommandLine = new GeneralCommandLine(PhoneGapSettings.NODEJS_PATH, "--version");
    generalCommandLine.setWorkDirectory(project.getBasePath());
    try {
      OSProcessHandler handler = new OSProcessHandler(generalCommandLine);
      handler.startNotify();
      generalCommandLine.createProcess();
    }
    catch (Exception e) {
      // Node not working
      // Output Notify
      String groupeDisplayId = "PhoneGap notification";
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  private OSProcessHandler createProcessHandler(List<String> commands) throws ExecutionException {
    return createProcessHandler(ArrayUtil.toStringArray(commands));
  }

  private OSProcessHandler createProcessHandler(String... commands) throws ExecutionException {
    GeneralCommandLine commandLine = new GeneralCommandLine(commands);
    commandLine.withWorkDirectory(myWorkDir);
    return KillableColoredProcessHandler.create(commandLine);
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  }

  @Override
  public void run() {
    //System.out.println("AndroidSDk detector");
    final GeneralCommandLine generalCommandLine = new GeneralCommandLine(PhoneGapSettings.ANDROID_SDK, "--version");
    generalCommandLine.setWorkDirectory(project.getBasePath());
    try {
      OSProcessHandler handler = new OSProcessHandler(generalCommandLine);
      handler.startNotify();
      generalCommandLine.createProcess();
    } catch (Exception e) {
      // AndroidSDK not working
      // Output Notify
      String groupeDisplayId = "PhoneGap notification";
      String notificationTitle = "PhoneGap Plugin";
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  public void registerStreamEventHandler(@NotNull StreamEventHandler handler) {
    myHandlers.put(handler.getEventType(), handler);
  }

  private KillableColoredProcessHandler startServer(@NotNull KarmaServerSettings serverSettings) throws IOException {
    GeneralCommandLine commandLine = new GeneralCommandLine();
    KarmaRunSettings runSettings = serverSettings.getRunSettings();
    commandLine.setPassParentEnvironment(runSettings.isPassParentEnvVars());
    commandLine.getEnvironment().putAll(runSettings.getEnvVars());
    commandLine.setWorkDirectory(serverSettings.getConfigurationFile().getParentFile());
    commandLine.setExePath(serverSettings.getNodeInterpreterPath());
    File serverFile = myKarmaJsSourcesLocator.getServerAppFile();
    //commandLine.addParameter("--debug-brk=34598");
    commandLine.addParameter(serverFile.getAbsolutePath());
    commandLine.addParameter("--karmaPackageDir=" + myKarmaJsSourcesLocator.getKarmaPackageDir().getAbsolutePath());
    commandLine.addParameter("--configFile=" + serverSettings.getConfigurationFilePath());
    String browsers = serverSettings.getRunSettings().getBrowsers();
    if (!browsers.isEmpty()) {
      commandLine.addParameter("--browsers=" + browsers);
    }
    if (myCoveragePeer != null) {
      commandLine.addParameter("--coverageTempDir=" + myCoveragePeer.getCoverageTempDir());
    }

    final Process process;
    try {
      process = commandLine.createProcess();
    }
    catch (ExecutionException e) {
      throw new IOException("Can not start Karma server: " + commandLine.getCommandLineString(), e);
    }
    LOG.info("Karma server " + System.identityHashCode(process) + " started successfully: "
             + commandLine.getCommandLineString());
    KillableColoredProcessHandler processHandler = new KillableColoredProcessHandler(
      process,
      commandLine.getCommandLineString(),
      CharsetToolkit.UTF8_CHARSET
    );

    processHandler.addProcessListener(new ProcessAdapter() {
      @Override
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  }

  @NotNull
  private OSProcessHandler createOSProcessHandler(@NotNull KarmaServer server,
                                                  @NotNull File clientAppFile) throws ExecutionException {
    GeneralCommandLine commandLine = createCommandLine(server.getServerPort(), server.getKarmaConfig(), clientAppFile);
    Process process = commandLine.createProcess();
    OSProcessHandler processHandler = new KillableColoredProcessHandler(process, commandLine.getCommandLineString());
    server.getRestarter().onRunnerExecutionStarted(processHandler);
    ProcessTerminatedListener.attach(processHandler);
    mySmtConsoleView.attachToProcess(processHandler);
    return processHandler;
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  @NotNull
  private GeneralCommandLine createCommandLine(int serverPort,
                                               @Nullable KarmaConfig config,
                                               @NotNull File clientAppFile) {
    GeneralCommandLine commandLine = new GeneralCommandLine();
    File configFile = new File(myRunSettings.getConfigPath());
    // looks like it should work with any working directory
    commandLine.setWorkDirectory(configFile.getParentFile());
    commandLine.setExePath(myNodeInterpreterPath);
    //commandLine.addParameter("--debug-brk=5858");
    commandLine.addParameter(clientAppFile.getAbsolutePath());
    commandLine.addParameter("--karmaPackageDir=" + myKarmaServer.getKarmaJsSourcesLocator().getKarmaPackageDir());
    commandLine.addParameter("--serverPort=" + serverPort);
    if (config != null) {
      commandLine.addParameter("--urlRoot=" + config.getUrlRoot());
    }
    if (isDebug()) {
      commandLine.addParameter("--debug=true");
    }
    return commandLine;
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

    return myLifeCycleManager.isServerStopped();
  }

  @NotNull
  private static OSProcessHandler start(@NotNull JstdServerSettings settings, int id) throws IOException {
    GeneralCommandLine commandLine = createCommandLine(settings);
    OSProcessHandler processHandler;
    try {
      processHandler = new KillableColoredProcessHandler(commandLine);
    }
    catch (ExecutionException e) {
      throw new IOException("Cannot start " + formatName(id, null) + ".\nCommand: " + commandLine.getCommandLineString(), e);
    }
    LOG.info(formatName(id, processHandler.getProcess()) + " started successfully: " + commandLine.getCommandLineString());
    ProcessTerminatedListener.attach(processHandler);
    processHandler.setShouldDestroyProcessRecursively(true);
    return processHandler;
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

    }
    return name;
  }

  private static GeneralCommandLine createCommandLine(@NotNull JstdServerSettings settings) {
    GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setExePath(System.getProperty("java.home") + File.separator + "bin" + File.separator + "java");
    Charset charset = Charsets.UTF_8;
    commandLine.setCharset(charset);
    commandLine.addParameter("-Dfile.encoding=" + charset.name());
    //commandLine.addParameter("-Xdebug");
    //commandLine.addParameter("-Xrunjdwp:transport=dt_socket,address=5000,server=y,suspend=y");

    File file = new File(PathUtil.getJarPathForClass(JsTestDriverServer.class));
    commandLine.setWorkDirectory(file.getParentFile());

    commandLine.addParameter("-cp");
    commandLine.addParameter(getClasspath());

    commandLine.addParameter("com.google.jstestdriver.idea.server.JstdServerMain");

    commandLine.addParameter("--port");
    commandLine.addParameter(String.valueOf(settings.getPort()));

    commandLine.addParameter("--runnerMode");
    commandLine.addParameter(settings.getRunnerMode().name());

    commandLine.addParameter("--browserTimeout");
    commandLine.addParameter(String.valueOf(settings.getBrowserTimeoutMillis()));

    return commandLine;
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  }

  @NotNull
  private KillableColoredProcessHandler createOSProcessHandler(@NotNull String serverUrl) throws ExecutionException {
    Map<TestRunner.ParameterKey, String> params = createParameterMap(serverUrl);
    GeneralCommandLine commandLine = createCommandLine(params);
    KillableColoredProcessHandler processHandler = KillableColoredProcessHandler.create(commandLine);
    ProcessTerminatedListener.attach(processHandler);
    return processHandler;
  }
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.