Package com.intellij.execution.configurations

Examples of com.intellij.execution.configurations.GeneralCommandLine


  @NotNull
  @Override
  protected ProcessHandler startProcess() throws ExecutionException {
    Project project = myConfig.getProject();
    Module module = myConfig.getConfigurationModule().getModule();
    GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setExePath(ErlangConsoleUtil.getErlPath(project, module));
    String consoleArgs = myConfig.getConsoleArgs();
    commandLine.addParameters(StringUtil.split(consoleArgs, " "));
    commandLine.addParameters(ErlangConsoleUtil.getCodePath(project, module, false));
    commandLine.setWorkDirectory(ErlangConsoleUtil.getWorkingDirPath(project, myConfig.getWorkingDirPath()));
    OSProcessHandler handler = new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
    ProcessTerminatedListener.attach(handler);
    return handler;
  }
View Full Code Here


    return state;
  }

  private void runDebugTarget() throws ExecutionException {
    ErlangRunningState runningState = createRunningState();
    GeneralCommandLine commandLine = new GeneralCommandLine();
    runningState.setExePath(commandLine);
    runningState.setWorkDirectory(commandLine);
    setUpErlangDebuggerCodePath(commandLine);
    runningState.setCodePath(commandLine);
    commandLine.addParameters("-sname", "test_node" + System.currentTimeMillis());
    commandLine.addParameters("-run", "debugnode", "main", myDebuggerNode.getName(), myDebuggerNode.getMessageBoxName());
    runningState.setErlangFlags(commandLine);
    runningState.setNoShellMode(commandLine);
    runningState.setStopErlang(commandLine);
    Process process = commandLine.createProcess();
    myErlangProcessHandler = new OSProcessHandler(process, commandLine.getCommandLineString());
    getSession().getConsoleView().attachToProcess(myErlangProcessHandler);
    myErlangProcessHandler.startNotify();
    if (runningState instanceof ErlangRemoteDebugRunningState) {
      ErlangRemoteDebugRunConfiguration runConfiguration = (ErlangRemoteDebugRunConfiguration) getRunConfiguration();
      if (StringUtil.isEmptyOrSpaces(runConfiguration.getErlangNode())) {
View Full Code Here

  }

  @NotNull
  @Override
  protected ProcessHandler startProcess() throws ExecutionException {
    GeneralCommandLine commandLine = getCommand();
    return new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
  }
View Full Code Here

    GeneralCommandLine commandLine = getCommand();
    return new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
  }

  private GeneralCommandLine getCommand() throws ExecutionException {
    GeneralCommandLine commandLine = new GeneralCommandLine();
    setExePath(commandLine);
    setWorkDirectory(commandLine);
    setCodePath(commandLine);
    setEntryPoint(commandLine);
    setStopErlang(commandLine);
View Full Code Here

        port = randomServerPort();

        languageConsole = new JavaREPLLanguageConsole(project, consoleTitle, JavaLanguage.INSTANCE, new JavaREPLClient("localhost", port));
        languageConsoleView = new JavaREPLLanguageConsoleView(languageConsole);

        GeneralCommandLine commandLine = createCommandLine(module, workingDir);
        processHandler = new ColoredProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString()) {
            @Override
            protected void textAvailable(String text, Key attributes) {
                languageConsole.setPrompt("java> ");
                JavaREPLLanguageConsole.printToConsole(languageConsole, StringUtil.convertLineSeparators(text).replace("java> ", ""), ConsoleViewContentType.NORMAL_OUTPUT, null);
            }
View Full Code Here

        }

        params.setMainClass(REPL_MAIN_CLASS);
        params.setWorkingDirectory(new File(workingDir));

        final GeneralCommandLine line = CommandLineBuilder.createFromJavaParameters(params, project, true);

        assert params.getJdk() != null;

        Map<String, String> envParams = new HashMap<String, String>();
        envParams.putAll(System.getenv());
        line.setEnvParams(envParams);
        line.addParameter("--port=" + port);

        return line;
    }
View Full Code Here

    }

    params.setMainClass(getMainReplClass(module));
    params.setWorkingDirectory(new File(workingDir));

    final GeneralCommandLine line = CommandLineBuilder.createFromJavaParameters(params, PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext()), true);

    final Sdk sdk = params.getJdk();
    assert sdk != null;
    final SdkType type = (SdkType) sdk.getSdkType();
    final String executablePath = ((JavaSdkType) type).getVMExecutablePath(sdk);

    final ArrayList<String> cmd = new ArrayList<String>();
    cmd.add(executablePath);
    cmd.addAll(getJvmClojureOptions(module));
    cmd.addAll(line.getParametersList().getList());
    cmd.addAll(getReplClojureOptions(module));
    if (!sdkConfigured) {
      ClojureConfigUtil.warningDefaultClojureJar(module);
    }
    return cmd;
View Full Code Here

    }

    params.setMainClass(getMainReplClass(module));
    params.setWorkingDirectory(new File(workingDir));

    final GeneralCommandLine line = CommandLineBuilder.createFromJavaParameters(params, PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext()), true);

    final Sdk sdk = params.getJdk();
    assert sdk != null;
    final SdkType type = (SdkType) sdk.getSdkType();
    final String executablePath = ((JavaSdkType) type).getVMExecutablePath(sdk);

    //final ArrayList<String> cmd = new ArrayList<String>();
    //cmd.add(executablePath);

    // cmd.addAll(line.getParametersList().getList());
//        line.getParametersList().addAll();

    Map<String, String> envParams = new HashMap<String, String>();
    envParams.putAll(System.getenv());
    line.setEnvParams(envParams);

    if (!sdkConfigured) {
      ClojureConfigUtil.warningDefaultClojureJar(module);
    }
    return line;
View Full Code Here

    return Arrays.asList(opts.split("\\s+"));
  }

  protected Process createProcess(CommandLineArgumentsProvider provider) throws ExecutionException {

    final GeneralCommandLine cmdline = createCommandLine(myModule, getWorkingDir());

    Process process = null;
    try {
      process = cmdline.createProcess();
    } catch (Exception e) {
      ExecutionHelper.showErrors(getProject(), Arrays.<Exception>asList(e), REPL_TITLE, null);
    }

    return process;
View Full Code Here


      params.setMainClass(ClojureUtils.CLOJURE_MAIN);
      params.setWorkingDirectory(path);

      final GeneralCommandLine line = CommandLineBuilder.createFromJavaParameters(params, PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext()), true);

      final Sdk sdk = params.getJdk();
      assert sdk != null;
      final SdkType type = (SdkType) sdk.getSdkType();
      final String executablePath = ((JavaSdkType) type).getVMExecutablePath(sdk);

      final ArrayList<String> env = new ArrayList<String>();
      final ArrayList<String> cmd = new ArrayList<String>();
      cmd.add(executablePath);
      cmd.addAll(line.getParametersList().getList());

      if (!sdkConfigured) {
        ClojureConfigUtil.warningDefaultClojureJar(myModule);
      }
View Full Code Here

TOP

Related Classes of com.intellij.execution.configurations.GeneralCommandLine

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.