当前位置: 首页>>代码示例>>Java>>正文


Java ParametersList.addParametersString方法代码示例

本文整理汇总了Java中com.intellij.execution.configurations.ParametersList.addParametersString方法的典型用法代码示例。如果您正苦于以下问题:Java ParametersList.addParametersString方法的具体用法?Java ParametersList.addParametersString怎么用?Java ParametersList.addParametersString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.execution.configurations.ParametersList的用法示例。


在下文中一共展示了ParametersList.addParametersString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPropertiesFromMavenOpts

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
public static Map<String, String> getPropertiesFromMavenOpts() {
  Map<String, String> res = ourPropertiesFromMvnOpts;
  if (res == null) {
    String mavenOpts = System.getenv("MAVEN_OPTS");
    if (mavenOpts != null) {
      ParametersList mavenOptsList = new ParametersList();
      mavenOptsList.addParametersString(mavenOpts);
      res = mavenOptsList.getProperties();
    }
    else {
      res = Collections.emptyMap();
    }

    ourPropertiesFromMvnOpts = res;
  }

  return res;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MavenUtil.java

示例2: configureProgramParameters

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private static void configureProgramParameters(ParametersList parameters, PitestConfiguration configuration) {
    if (configuration.isVerboseLogging()) {
        parameters.add("--verbose");
    }
    String targetClasses = configuration.getTargetClasses();
    checkTargetClasses(targetClasses);
    parameters.add("--targetClasses", targetClasses);
    parameters.add("--targetTests", configuration.getTargetTests());
    String excludedClasses = configuration.getExcludedClasses();
    if (StringUtils.isNotBlank(excludedClasses)) {
        parameters.add("--excludedClasses", excludedClasses);
    }
    String reportDir = configuration.getReportDir();
    parameters.add("--reportDir", reportDir);
    parameters.add("--sourceDirs", configuration.getSourceDirs());
    parameters.add("--outputFormats", "HTML,XML");
    String history = Utils.concatenatePath(reportDir, "/history.pit");
    parameters.add("--historyInputLocation", history);
    parameters.add("--historyOutputLocation", history);
    parameters.add("--timestampedReports=false");
    parameters.addParametersString(configuration.getManualParameters());
}
 
开发者ID:artspb,项目名称:idea-pitest,代码行数:23,代码来源:JavaParametersConfigurator.java

示例3: runHlint

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
/**
 * Runs hlintProg with parameters if hlintProg can be executed.
 */
@NotNull
private static Either<ExecError, String> runHlint(HaskellToolsConsole toolConsole,
                                                  @NotNull String workingDirectory,
                                                  @NotNull String hlintProg,
                                                  @NotNull String hlintFlags,
                                                  @NotNull String... params) {
    GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setWorkDirectory(workingDirectory);
    commandLine.setExePath(hlintProg);
    ParametersList parametersList = commandLine.getParametersList();
    // Required so that hlint won't report a non-zero exit status for lint issues.
    // Otherwise, ExecUtil.readCommandLine will return an error.
    parametersList.add("--no-exit-code");
    parametersList.addParametersString(hlintFlags);
    parametersList.addAll(params);
    toolConsole.writeInput(ToolKey.HLINT_KEY, "Using working directory: " + workingDirectory);
    toolConsole.writeInput(ToolKey.HLINT_KEY, commandLine.getCommandLineString());
    return ExecUtil.readCommandLine(commandLine);
}
 
开发者ID:carymrobbins,项目名称:intellij-haskforce,代码行数:23,代码来源:HLint.java

示例4: spawnProcess

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private void spawnProcess() throws GhcModiError {
    GeneralCommandLine commandLine = new GeneralCommandLine(
        GhcModUtil.changedPathIfStack(module.getProject(), path)
    );
    GhcModUtil.updateEnvironment(module.getProject(), commandLine.getEnvironment());
    ParametersList parametersList = commandLine.getParametersList();
    parametersList.addParametersString(
        GhcModUtil.changedFlagsIfStack(module.getProject(), path, flags)
    );
    // setWorkDirectory is deprecated but is needed to work with IntelliJ 13 which does not have withWorkDirectory.
    commandLine.setWorkDirectory(workingDirectory);
    // Make sure we can actually see the errors.
    commandLine.setRedirectErrorStream(true);
    toolConsole.writeInput(ToolKey.GHC_MODI_KEY, "Using working directory: " + workingDirectory);
    toolConsole.writeInput(ToolKey.GHC_MODI_KEY, "Starting ghc-modi process: " + commandLine.getCommandLineString());
    try {
        process = commandLine.createProcess();
    } catch (ExecutionException e) {
        toolConsole.writeError(ToolKey.GHC_MODI_KEY, "Failed to initialize process");
        throw new InitError(e.toString());
    }
    input = new BufferedReader(new InputStreamReader(process.getInputStream()));
    output = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));
}
 
开发者ID:carymrobbins,项目名称:intellij-haskforce,代码行数:25,代码来源:GhcModi.java

示例5: checkTokenizer

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private static void checkTokenizer(String paramString, String... expected) {
  ParametersList params = new ParametersList();
  params.addParametersString(paramString);
  assertEquals(asList(expected), params.getList());

  List<String> lines = ParametersListUtil.parse(paramString, true);
  assertEquals(paramString, StringUtil.join(lines, " "));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ParametersListTest.java

示例6: exec

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
@Nullable
public static String exec(@NotNull Project project, @NotNull String workingDirectory, @NotNull String ghcModPath,
                          @NotNull String command, @NotNull String ghcModFlags, String... params) {
    if (!validateGhcVersion(project, ghcModPath, ghcModFlags)) return null;
    GeneralCommandLine commandLine = new GeneralCommandLine(ghcModPath);
    GhcModUtil.updateEnvironment(project, commandLine.getEnvironment());
    ParametersList parametersList = commandLine.getParametersList();
    parametersList.addParametersString(ghcModFlags);
    parametersList.add(command);
    parametersList.addAll(params);
    // setWorkDirectory is deprecated but is needed to work with IntelliJ 13 which does not have withWorkDirectory.
    commandLine.setWorkDirectory(workingDirectory);
    // Make sure we can actually see the errors.
    commandLine.setRedirectErrorStream(true);
    HaskellToolsConsole toolConsole = HaskellToolsConsole.get(project);
    toolConsole.writeInput(ToolKey.GHC_MOD_KEY, "Using working directory: " + workingDirectory);
    toolConsole.writeInput(ToolKey.GHC_MOD_KEY, commandLine.getCommandLineString());
    Either<ExecUtil.ExecError, String> result = ExecUtil.readCommandLine(commandLine);
    if (result.isLeft()) {
        //noinspection ThrowableResultOfMethodCallIgnored
        ExecUtil.ExecError e = EitherUtil.unsafeGetLeft(result);
        toolConsole.writeError(ToolKey.GHC_MOD_KEY, e.getMessage());
        NotificationUtil.displayToolsNotification(
            NotificationType.ERROR, project, "ghc-mod", e.getMessage()
        );
        return null;
    }
    String out = EitherUtil.unsafeGetRight(result);
    toolConsole.writeOutput(ToolKey.GHC_MOD_KEY, out);
    return out;
}
 
开发者ID:carymrobbins,项目名称:intellij-haskforce,代码行数:32,代码来源:GhcMod.java

示例7: startProcess

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
@NotNull
@Override
protected OSProcessHandler startProcess() throws ExecutionException {
    ExecutionEnvironment env = getEnvironment();
    GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setWorkDirectory(env.getProject().getBasePath());
    // TODO: This should probably be a bit more generic than relying on `cabal test`.
    final String cabalPath = HaskellBuildSettings.getInstance(myConfig.getProject()).getCabalPath();
    commandLine.setExePath(cabalPath);
    ParametersList parametersList = commandLine.getParametersList();
    parametersList.add("test");
    parametersList.addParametersString(myConfig.programArguments);
    return new OSProcessHandler(commandLine);
}
 
开发者ID:carymrobbins,项目名称:intellij-haskforce,代码行数:15,代码来源:HaskellTestCommandLineState.java

示例8: startProcess

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
@NotNull
@Override
protected OSProcessHandler startProcess() throws ExecutionException {
    ExecutionEnvironment env = getEnvironment();
    GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setWorkDirectory(env.getProject().getBasePath());
    // TODO: This should probably be a bit more generic than relying on `cabal run`.
    final HaskellBuildSettings buildSettings = HaskellBuildSettings.getInstance(myConfig.getProject());
    commandLine.setExePath(buildSettings.getCabalPath());
    ParametersList parametersList = commandLine.getParametersList();
    parametersList.add("run");
    parametersList.add("--with-ghc=" + buildSettings.getGhcPath());
    parametersList.addParametersString(myConfig.programArguments);
    return new OSProcessHandler(commandLine);
}
 
开发者ID:carymrobbins,项目名称:intellij-haskforce,代码行数:16,代码来源:HaskellApplicationCommandLineState.java

示例9: createJavaParameters

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
@Override
protected final JavaParameters createJavaParameters() throws ExecutionException {
    JavaParameters javaParameters = new JavaParameters();

    for(RunConfigurationExtension ext: Extensions.getExtensions(RunConfigurationExtension.EP_NAME)) {
        ext.updateJavaParameters(configuration, javaParameters, getRunnerSettings());
    }

    // @TODO What is the classpath entry constant class?
    javaParameters.configureByModule(module, 3);

    javaParameters.setMainClass(configuration.getRunSettings().getSketchClass());

    ParametersList programParameters = javaParameters.getProgramParametersList();

    int display = configuration.getRunSettings().getDisplay();
    programParameters.addParametersString(CliArg.DISPLAY.text() + ARG_VAL_SEP + display);

    String windowColorHex = configuration.getRunSettings().getWindowBackgroundColor();

    if (windowColorHex != null && ! windowColorHex.isEmpty()) {
        programParameters.addParametersString(CliArg.WINDOW_COLOR.text() + ARG_VAL_SEP + windowColorHex);
    }

    String stopButtonColorHex = configuration.getRunSettings().getStopButtonColor();

    if (stopButtonColorHex != null && ! stopButtonColorHex.isEmpty()) {
        programParameters.addParametersString(CliArg.STOP_BUTTON_COLOR.text() + ARG_VAL_SEP + stopButtonColorHex);
    }

    DisplayLocation sketchLocation = DisplayLocation.toEnum(configuration.getRunSettings().getLocation());

    // Processing Core automatically aligns sketch at the center of the screen, incorporating sketch size.
    if (sketchLocation != DisplayLocation.CENTER) {
        GraphicsDevice[] screens = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();

        GraphicsDevice screen;
        if (display >= screens.length) {
            logger.warn("The display with index " + display + " is no longer connected.");
            screen = screens[0];
        } else {
            screen = screens[display];
        }

        Point sketchLocationPoint = sketchLocation.getLocation(screen);

        programParameters.addParametersString(CliArg.SKETCH_SCREEN_LOCATION.text() + ARG_VAL_SEP +
                ((int) sketchLocationPoint.getX()) + "," + ((int) sketchLocationPoint.getY()));
    }

    String sketchOutputPath = configuration.getRunSettings().getSketchOutputPath();
    if (sketchOutputPath != null && !sketchOutputPath.isEmpty()) {
        programParameters.addParametersString(CliArg.SKETCH_OUTPUT_PATH.text() + ARG_VAL_SEP + sketchOutputPath);
    }

    if (configuration.getRunSettings().isHideStopButton()) {
        programParameters.add(CliArg.HIDE_STOP_BUTTON.text());
    }

    if (configuration.getRunSettings().isFullscreen()) {
        programParameters.addParametersString(CliArg.PRESENTATION_MODE.text());
    }

    programParameters.add(configuration.getRunSettings().getSketchClass());
    programParameters.addParametersString(configuration.getRunSettings().getSketchArguments());

    javaParameters.getVMParametersList().addParametersString(configuration.getRunSettings().getJvmArguments());

    return javaParameters;
}
 
开发者ID:mistodev,项目名称:processing-idea,代码行数:71,代码来源:ProcessingCommandLineState.java

示例10: configure

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
public Process configure() throws IOException, ExecutionException {
    GeneralCommandLine commandLine = getCommandLine("configure");
    ParametersList parametersList = commandLine.getParametersList();
    parametersList.addParametersString(myBuildOptions.myCabalFlags);
    return commandLine.createProcess();
}
 
开发者ID:carymrobbins,项目名称:intellij-haskforce,代码行数:7,代码来源:CabalJspInterface.java

示例11: getAnnotationProcessorOptions

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
public Map<String, String> getAnnotationProcessorOptions() {
  Element compilerConfig = getCompilerConfig();

  if (compilerConfig == null) return Collections.emptyMap();

  Map<String, String> res = null;

  String compilerArgument = compilerConfig.getChildText("compilerArgument");
  if (!StringUtil.isEmptyOrSpaces(compilerArgument)) {
    ParametersList parametersList = new ParametersList();
    parametersList.addParametersString(compilerArgument);

    for (String param : parametersList.getParameters()) {
      if (param.startsWith("-A")) {
        int idx = param.indexOf('=', 3);
        if (idx >= 0) {
          if (res == null) {
            res = new LinkedHashMap<String, String>();
          }

          res.put(param.substring(2, idx), param.substring(idx + 1));
        }
      }
    }
  }

  Element compilerArguments = compilerConfig.getChild("compilerArguments");
  if (compilerArguments != null) {
    for (Element e : (Collection<Element>)compilerArguments.getChildren()){
      String name = e.getName();
      if (name.startsWith("-")) {
        name = name.substring(1);
      }

      if (name.length() > 1 && name.charAt(0) == 'A') {
        if (res == null) {
          res = new LinkedHashMap<String, String>();
        }

        res.put(name.substring(1), e.getTextTrim());
      }
    }
  }

  if (res == null) return Collections.emptyMap();

  return res;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:49,代码来源:MavenProject.java

示例12: addVMParameters

import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
public static void addVMParameters(ParametersList parametersList, String mavenHome, MavenRunnerSettings runnerSettings) {
  parametersList.addParametersString(System.getenv(MAVEN_OPTS));

  parametersList.addParametersString(runnerSettings.getVmOptions());

  parametersList.addProperty("maven.home", mavenHome);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:MavenExternalParameters.java


注:本文中的com.intellij.execution.configurations.ParametersList.addParametersString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。