本文整理汇总了Java中com.intellij.execution.configurations.ParametersList类的典型用法代码示例。如果您正苦于以下问题:Java ParametersList类的具体用法?Java ParametersList怎么用?Java ParametersList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParametersList类属于com.intellij.execution.configurations包,在下文中一共展示了ParametersList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCommandLineProxy
import com.intellij.execution.configurations.ParametersList; //导入依赖的package包/类
public ProcessProxy createCommandLineProxy(final JavaCommandLine javaCmdLine) throws ExecutionException {
ProcessProxyImpl proxy = null;
final JavaParameters javaParameters = javaCmdLine.getJavaParameters();
String mainClass = javaParameters.getMainClass();
if (ProcessProxyImpl.useLauncher() && mainClass != null) {
try {
proxy = new ProcessProxyImpl();
JavaSdkUtil.addRtJar(javaParameters.getClassPath());
final ParametersList vmParametersList = javaParameters.getVMParametersList();
vmParametersList.defineProperty(ProcessProxyImpl.PROPERTY_PORT_NUMBER, String.valueOf(proxy.getPortNumber()));
vmParametersList.defineProperty(ProcessProxyImpl.PROPERTY_BINPATH, PathManager.getBinPath());
javaParameters.getProgramParametersList().prepend(mainClass);
javaParameters.setMainClass(ProcessProxyImpl.LAUNCH_MAIN_CLASS);
}
catch (ProcessProxyImpl.NoMoreSocketsException e) {
proxy = null;
}
}
return proxy;
}
示例2: paramsGroupSubGroups
import com.intellij.execution.configurations.ParametersList; //导入依赖的package包/类
@Test
public void paramsGroupSubGroups() {
ParametersList params = new ParametersList();
ParamsGroup group1 = params.addParamsGroup("id1");
group1.addParameter("group1_param1");
group1.addParameter("group1_param2");
ParamsGroup group2 = params.addParamsGroup("id2");
group2.addParameter("group2_param1");
ParamsGroup group1_1 = group1.getParametersList().addParamsGroup("id1_1");
group1_1.addParameter("group1_1_param1");
ParamsGroup group1_2 = group1.getParametersList().addParamsGroup("id1_2");
group1_2.addParameter("group1_2_param1");
assertEquals(asList("group1_param1", "group1_param2", "group1_1_param1", "group1_2_param1", "group2_param1"), params.getList());
assertEquals(asList("group1_param1", "group1_param2", "group1_1_param1", "group1_2_param1", "group2_param1"), params.getList());
assertEquals("group1_param1 group1_param2 group1_1_param1 group1_2_param1 group2_param1", params.getParametersString().trim());
}
示例3: passForkMode
import com.intellij.execution.configurations.ParametersList; //导入依赖的package包/类
protected void passForkMode(String forkMode, File tempFile, JavaParameters parameters) throws ExecutionException {
final ParametersList parametersList = parameters.getProgramParametersList();
final List<String> params = parametersList.getParameters();
int paramIdx = params.size() - 1;
for (int i = 0; i < params.size(); i++) {
String param = params.get(i);
if ("-temp".equals(param)) {
paramIdx = i;
break;
}
}
parametersList.addAt(paramIdx, "@@@" + tempFile.getAbsolutePath());
if (getForkSocket() != null) {
parametersList.addAt(paramIdx, ForkedDebuggerHelper.DEBUG_SOCKET + getForkSocket().getLocalPort());
}
}
示例4: 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;
}
示例5: addMavenParameters
import com.intellij.execution.configurations.ParametersList; //导入依赖的package包/类
private static void addMavenParameters(ParametersList parametersList,
String mavenHome,
MavenGeneralSettings coreSettings,
MavenRunnerSettings runnerSettings,
MavenRunnerParameters parameters) {
encodeCoreAndRunnerSettings(coreSettings, mavenHome, parametersList);
if (runnerSettings.isSkipTests()) {
parametersList.addProperty("skipTests", "true");
}
for (Map.Entry<String, String> entry : runnerSettings.getMavenProperties().entrySet()) {
if (entry.getKey().length() > 0) {
parametersList.addProperty(entry.getKey(), entry.getValue());
}
}
for (String goal : parameters.getGoals()) {
parametersList.add(goal);
}
addOption(parametersList, "P", encodeProfiles(parameters.getProfilesMap()));
}
示例6: getData
import com.intellij.execution.configurations.ParametersList; //导入依赖的package包/类
protected void getData(final MavenRunnerParameters data) {
workingDirComponent.getComponent().setText(data.getWorkingDirPath());
goalsComponent.getComponent().setText(ParametersList.join(data.getGoals()));
myResolveToWorkspaceCheckBox.setSelected(data.isResolveToWorkspace());
ParametersList parametersList = new ParametersList();
for (Map.Entry<String, Boolean> entry : data.getProfilesMap().entrySet()) {
String profileName = entry.getKey();
if (!entry.getValue()) {
profileName = '-' + profileName;
}
parametersList.add(profileName);
}
profilesComponent.getComponent().setText(parametersList.getParametersString());
}
示例7: getCommandLine
import com.intellij.execution.configurations.ParametersList; //导入依赖的package包/类
public JavaParameters getCommandLine() {
if (myDone) return myCommandLine;
ParametersList programParameters = myCommandLine.getProgramParametersList();
for (final String property : myExpandedProperties) {
if (property != null) {
programParameters.add(property);
}
}
programParameters.add("-buildfile", myBuildFilePath);
for (final String target : myTargets) {
if (target != null) {
programParameters.add(target);
}
}
myDone = true;
return myCommandLine;
}
示例8: getCommand
import com.intellij.execution.configurations.ParametersList; //导入依赖的package包/类
MvcCommand getCommand() {
String cmd;
if (myCreateAddon.isSelected()) {
cmd = "create-addon";
}
else if (myCreateApp.isSelected()) {
cmd = "create-app";
}
else if (myCreateArchetype.isSelected()) {
cmd = "create-archetype";
}
else if (myCreatePlugin.isSelected()) {
cmd = "create-plugin";
}
else {
throw new AssertionError("No selection");
}
String text = myOptionField.getText();
if (text == null) text = "";
return new MvcCommand(cmd, ParametersList.parse(text));
}
示例9: 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());
}
示例10: patchParameters
import com.intellij.execution.configurations.ParametersList; //导入依赖的package包/类
@Override
public void patchParameters(
@NotNull JavaParameters parameters, String originalOutputDir, @NotNull GwtFacet gwtFacet) {
final ParametersList programParameters = parameters.getProgramParametersList();
programParameters.add("-server");
programParameters.add("com.google.appengine.tools.development.gwt.AppEngineLauncher");
final CloudSdkService sdkService = CloudSdkService.getInstance();
sdkService.patchJavaParametersForDevServer(parameters.getVMParametersList());
// actually these jars are added by AppEngine dev server automatically. But they need to be
// added to classpath before gwt-dev.jar, because otherwise wrong jsp compiler version will be
// used (see IDEA-63068)
if (sdkService.getLibraries() != null) {
for (File jar :
ArrayUtil.mergeArrays(sdkService.getLibraries(), sdkService.getJspLibraries())) {
parameters.getClassPath().addFirst(FileUtil.toSystemIndependentName(jar.getAbsolutePath()));
}
}
if (sdkService.getToolsApiJarFile() != null) {
parameters.getClassPath().add(sdkService.getToolsApiJarFile());
}
}
示例11: patchJavaParametersForDevServer
import com.intellij.execution.configurations.ParametersList; //导入依赖的package包/类
@Override
public void patchJavaParametersForDevServer(@NotNull ParametersList vmParameters) {
if (getJavaToolsBasePath() != null) {
File agentPath =
getJavaToolsBasePath().resolve(Paths.get("lib", "agent", "appengine-agent.jar")).toFile();
if (agentPath.exists()) {
vmParameters.add("-javaagent:" + agentPath.getAbsolutePath());
}
File patchPath =
getJavaToolsBasePath()
.resolve(Paths.get("lib", "override", "appengine-dev-jdk-overrides.jar"))
.toFile();
if (patchPath.exists()) {
vmParameters.add("-Xbootclasspath/p:" + patchPath.getAbsolutePath());
}
}
}
示例12: 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;
}
示例13: 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);
}
示例14: 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()));
}
示例15: createCommandLineProxy
import com.intellij.execution.configurations.ParametersList; //导入依赖的package包/类
public ProcessProxy createCommandLineProxy(final JavaCommandLine javaCmdLine) throws ExecutionException {
ProcessProxyImpl proxy = null;
if (ProcessProxyImpl.useLauncher()) {
try {
proxy = new ProcessProxyImpl();
final JavaParameters javaParameters = javaCmdLine.getJavaParameters();
JavaSdkUtil.addRtJar(javaParameters.getClassPath());
final ParametersList vmParametersList = javaParameters.getVMParametersList();
vmParametersList.defineProperty(ProcessProxyImpl.PROPERTY_PORT_NUMBER, String.valueOf(proxy.getPortNumber()));
vmParametersList.defineProperty(ProcessProxyImpl.PROPERTY_BINPATH, PathManager.getBinPath());
javaParameters.getProgramParametersList().prepend(javaParameters.getMainClass());
javaParameters.setMainClass(ProcessProxyImpl.LAUNCH_MAIN_CLASS);
}
catch (ProcessProxyImpl.NoMoreSocketsException e) {
proxy = null;
}
}
return proxy;
}