本文整理汇总了Java中com.intellij.execution.configurations.ParametersList.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java ParametersList.addAll方法的具体用法?Java ParametersList.addAll怎么用?Java ParametersList.addAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.configurations.ParametersList
的用法示例。
在下文中一共展示了ParametersList.addAll方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCommandLine
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private GeneralCommandLine getCommandLine(String command, String... args) throws IOException, ExecutionException {
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setWorkDirectory(myCabalFile.getParentFile().getCanonicalPath());
commandLine.setExePath(myBuildOptions.myCabalPath);
ParametersList parametersList = commandLine.getParametersList();
parametersList.add("--with-ghc=" + myBuildOptions.myGhcPath);
parametersList.add(command);
if (command.equals("install") || command.equals("configure")) {
if (myBuildOptions.myEnableTests) {
parametersList.add("--enable-tests");
}
if (!myBuildOptions.myProfilingBuild) {
parametersList.add("--disable-library-profiling");
}
}
parametersList.addAll(args);
commandLine.setRedirectErrorStream(true);
return commandLine;
}
示例2: 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);
}
示例3: getFileCommandLine
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
@Override
protected SimpleProgramCommandLine getFileCommandLine(@NotNull final PowerShellInfo info,
@NotNull final Map<String, String> env,
@NotNull final String workDir,
@NotNull final List<String> args) throws RunBuildException {
final ParametersList parametersList = new ParametersList();
parametersList.add(info.getExecutablePath());
parametersList.addAll(args);
return executeWithWrapper(env, workDir, parametersList.getParametersString());
}
示例4: generateCommand
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
@NotNull
private String generateCommand(@NotNull final PowerShellInfo info) throws RunBuildException {
final ParametersList parametersList = new ParametersList();
final Map<String, String> runnerParameters = getRunnerParameters();
final File scriptFile = myScriptGenerator.generateScript(runnerParameters, getCheckoutDirectory(), getBuildTempDirectory());
// if we have script entered in runner params it will be dumped to temp file. This file must be removed after build finishes
if (ScriptGenerator.shouldRemoveGeneratedScript(runnerParameters)) {
myFilesToRemove.add(scriptFile);
}
parametersList.add(info.getExecutablePath());
parametersList.addAll(myCmdProvider.provideCommandLine(info, runnerParameters, scriptFile, useExecutionPolicy(info)));
return parametersList.getParametersString();
}
示例5: joiningParams
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
@Test
public void joiningParams() {
String[] parameters = {"simpleParam", "param with spaces", "withQuote=\"", "param=\"complex quoted\""};
ParametersList parametersList = new ParametersList();
parametersList.addAll(parameters);
String joined = parametersList.getParametersString();
assertEquals("simpleParam \"param with spaces\" withQuote=\\\" \"param=\\\"complex quoted\\\"\"", joined);
checkTokenizer(joined, parameters);
}
示例6: addToParametersList
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
public void addToParametersList(@NotNull ParametersList list) {
if (myEnv != null) {
list.add(myEnv);
}
list.addAll(myProperties);
if (myCommand != null) {
list.add(myCommand);
}
list.addAll(myArgs);
}
示例7: expandBuildFlags
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
/** Expands any macros in the passed build flags. */
public static List<String> expandBuildFlags(List<String> flags) {
if (!macroExpandBuildFlags.getValue()) {
return flags;
}
// This built-in IntelliJ class will do macro expansion using
// both your enviroment and your Settings > Behavior > Path Variables
ParametersList parametersList = new ParametersList();
parametersList.addAll(flags);
return parametersList.getList();
}
示例8: 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;
}