Examples of GeneralCommandLine


Examples of com.intellij.execution.configurations.GeneralCommandLine

                        String mainFile = parameters.getMainFile();
                        if (mainFile == null) {
                            throw new CantRunException("Main module is not specified");
                        }

                        GeneralCommandLine commandLine = new GeneralCommandLine();
                        commandLine.setExePath(exePath);
                        commandLine.setCharset(HaskellFileType.HASKELL_CHARSET);

                        Map<String, String> env = parameters.getEnv();
                        if (env != null) {
                            commandLine.getEnvironment().putAll(env);
                            commandLine.setPassParentEnvironment(parameters.isPassParentEnvs());
                        }

                        commandLine.setWorkDirectory(parameters.getWorkingDirectory());

                        List<String> options = new ArrayList<String>();
                        options.add("-i" + GHCUtil.rootsAsString(configuration.getModule(), false));
                        //GHCUtil.getGhcOptions(null, options); // todo!!!
                        commandLine.addParameters(options);
                        commandLine.addParameter(mainFile); // todo
                        commandLine.addParameters(parameters.getProgramParametersList().getParameters());
                        // todo: set other parameters/rt flags

                        return commandLine;
                    } catch (CantRunException e) {
                        throw new RuntimeException(e);
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

        }
    }

    private HaskellConsoleProcessHandler initAndRun(String... statements2execute) throws ExecutionException {
        // Create Server process
        GeneralCommandLine cmdline = createCommandLine(module, workingDir);
        Process process = cmdline.createProcess();
        // !!! do not change order!!!
        consoleView = createConsoleView();
        String commandLine = cmdline.getCommandLineString();
        processHandler = new HaskellConsoleProcessHandler(process, commandLine, getLanguageConsole());
        executeHandler = new HaskellConsoleExecuteActionHandler(processHandler, project, false);
        getLanguageConsole().setExecuteHandler(executeHandler);

        // Init a console view
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

        if (sdk == null || !(sdk.getSdkType() instanceof HaskellSdkType) || sdk.getHomePath() == null) {
            throw new CantRunException("Invalid SDK Home path set. Please set your SDK path correctly.");
        } else {
            homePath = sdk.getHomeDirectory();
        }
        GeneralCommandLine line = new GeneralCommandLine();
        line.setExePath(GHCUtil.getCommandPath(homePath, "ghci"));
        line.setWorkDirectory(workingDir);
        SdkAdditionalData sdkAdditionalData = sdk.getSdkAdditionalData();
        if (sdkAdditionalData instanceof HaskellSdkAdditionalData) {
            HaskellSdkAdditionalData data = (HaskellSdkAdditionalData) sdkAdditionalData;
            CommandLineTokenizer tokenizer = new CommandLineTokenizer(data.getGhcOptions());
            while (tokenizer.hasMoreTokens()) {
                line.addParameter(tokenizer.nextToken());
            }
        }
        return line;
    }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

      System.arraycopy(command, 1, arguments, 0, command.length - 1);
    } else {
      arguments = new String[0];
    }

    final GeneralCommandLine cmdLine = createAndSetupCmdLine(workingDir, command[0], arguments);
    try {
      process = cmdLine.createProcess();
    } catch (Exception e) {
      LOG.error(e.getMessage(), e);
    }
    return process;
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

   * @return process builder
   */
  public static GeneralCommandLine createAndSetupCmdLine(@Nullable final String workingDir,
                                                         @NotNull final String executablePath,
                                                         @NotNull final String... arguments) {
    final GeneralCommandLine cmdLine = new GeneralCommandLine();

    cmdLine.setExePath(toSystemDependentName(executablePath));
    if (workingDir != null) {
      cmdLine.setWorkDirectory(toSystemDependentName(workingDir));
    }
    cmdLine.addParameters(arguments);

    return cmdLine;
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

                              : getOutputFilePath(module, settings);
      return super.doExecute(project, new CommandLineState(env) {
        @NotNull
        @Override
        protected ProcessHandler startProcess() throws ExecutionException {
          final GeneralCommandLine commandLine = new GeneralCommandLine();
          commandLine.setWorkDirectory(PathUtil.getParentPath(module.getModuleFilePath()));
          commandLine.setExePath(configuration.getCustomExecutablePath());
          commandLine.addParameter(filePath);

          final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(module.getProject());
          setConsoleBuilder(consoleBuilder);

          return new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
        }
      }, contentToReuse, env);
    }

    if (configuration.isCustomFileToLaunch()) {
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  protected ProcessHandler startProcess() throws ExecutionException {
    final HaxeModuleSettings settings = HaxeModuleSettings.getInstance(module);
    final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
    assert sdk != null;

    GeneralCommandLine commandLine = getCommandForNeko(sdk, settings);

    return new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  private GeneralCommandLine getCommandForNeko(Sdk sdk, HaxeModuleSettings settings) throws ExecutionException {
    final HaxeSdkData sdkData = sdk.getSdkAdditionalData() instanceof HaxeSdkData ? (HaxeSdkData)sdk.getSdkAdditionalData() : null;
    if (sdkData == null) {
      throw new ExecutionException(HaxeCommonBundle.message("invalid.haxe.sdk"));
    }
    final GeneralCommandLine commandLine = new GeneralCommandLine();

    commandLine.setWorkDirectory(PathUtil.getParentPath(module.getModuleFilePath()));
    final String haxelibPath = sdkData.getHaxelibPath();
    if (haxelibPath == null || haxelibPath.isEmpty()) {
      throw new ExecutionException(HaxeCommonBundle.message("no.haxelib.for.sdk", sdk.getName()));
    }
    commandLine.setExePath(haxelibPath);
    commandLine.addParameter("run");
    commandLine.addParameter("nme");
    commandLine.addParameter(myRunInTest ? "test" : "run");
    commandLine.addParameter(settings.getNmmlPath());
    for (String flag : settings.getNmeTarget().getFlags()) {
      commandLine.addParameter(flag);
    }
    if (myDebug) {
      commandLine.addParameter("-debug");
      commandLine.addParameter("-Ddebug");
    }

    final StringTokenizer flagsTokenizer = new StringTokenizer(settings.getNmeFlags());
    while (flagsTokenizer.hasMoreTokens()) {
      commandLine.addParameter(flagsTokenizer.nextToken());
    }

    final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(module.getProject());
    setConsoleBuilder(consoleBuilder);
    return commandLine;
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  protected ProcessHandler startProcess() throws ExecutionException {
    final HaxeModuleSettings settings = HaxeModuleSettings.getInstance(module);
    final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
    assert sdk != null;

    GeneralCommandLine commandLine = getCommandForNeko(sdk, settings);

    return new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  private GeneralCommandLine getCommandForNeko(Sdk sdk, HaxeModuleSettings settings) throws ExecutionException {
    final HaxeSdkData sdkData = sdk.getSdkAdditionalData() instanceof HaxeSdkData ? (HaxeSdkData)sdk.getSdkAdditionalData() : null;
    if (sdkData == null) {
      throw new ExecutionException(HaxeCommonBundle.message("invalid.haxe.sdk"));
    }
    final GeneralCommandLine commandLine = new GeneralCommandLine();

    commandLine.setWorkDirectory(PathUtil.getParentPath(module.getModuleFilePath()));
    final String haxelibPath = sdkData.getHaxelibPath();
    if (haxelibPath == null || haxelibPath.isEmpty()) {
      throw new ExecutionException(HaxeCommonBundle.message("no.haxelib.for.sdk", sdk.getName()));
    }
    commandLine.setExePath(haxelibPath);
    commandLine.addParameter("run");
    commandLine.addParameter("lime");
    commandLine.addParameter(myRunInTest ? "test" : "run");

    if(!StringUtil.isEmpty(settings.getOpenFLXmlPath())) {
      commandLine.addParameter(settings.getOpenFLXmlPath());
    }

    for (String flag : settings.getOpenFLTarget().getFlags()) {
      commandLine.addParameter(flag);
    }

    commandLine.addParameter("-verbose");

    if (myDebug) {
      commandLine.addParameter("-Ddebug");
      commandLine.addParameter("-debug");

      if (settings.getOpenFLTarget() == OpenFLTarget.FLASH) {
        commandLine.addParameter("-Dfdb");
      }
    }

    final StringTokenizer flagsTokenizer = new StringTokenizer(settings.getOpenFLFlags());
    while (flagsTokenizer.hasMoreTokens()) {
      commandLine.addParameter(flagsTokenizer.nextToken());
    }

    final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(module.getProject());
    setConsoleBuilder(consoleBuilder);
    return commandLine;
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.