本文整理汇总了Java中com.intellij.execution.configurations.SimpleJavaParameters类的典型用法代码示例。如果您正苦于以下问题:Java SimpleJavaParameters类的具体用法?Java SimpleJavaParameters怎么用?Java SimpleJavaParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimpleJavaParameters类属于com.intellij.execution.configurations包,在下文中一共展示了SimpleJavaParameters类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: configureConfiguration
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
public static void configureConfiguration(SimpleJavaParameters parameters, CommonJavaRunConfigurationParameters configuration) {
ProgramParametersUtil.configureConfiguration(parameters, configuration);
Project project = configuration.getProject();
Module module = ProgramParametersUtil.getModule(configuration);
String alternativeJrePath = configuration.getAlternativeJrePath();
if (alternativeJrePath != null) {
configuration.setAlternativeJrePath(ProgramParametersUtil.expandPath(alternativeJrePath, null, project));
}
String vmParameters = configuration.getVMParameters();
if (vmParameters != null) {
vmParameters = ProgramParametersUtil.expandPath(vmParameters, module, project);
for (Map.Entry<String, String> each : parameters.getEnv().entrySet()) {
vmParameters = StringUtil.replace(vmParameters, "$" + each.getKey() + "$", each.getValue(), false); //replace env usages
}
}
parameters.getVMParametersList().addParametersString(vmParameters);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:JavaParametersUtil.java
示例2: runJython
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
public static ProcessOutput runJython(String workDir, String pythonPath, String... args) throws ExecutionException {
final SimpleJavaSdkType sdkType = new SimpleJavaSdkType();
final Sdk ideaJdk = sdkType.createJdk("tmp", SystemProperties.getJavaHome());
SimpleJavaParameters parameters = new SimpleJavaParameters();
parameters.setJdk(ideaJdk);
parameters.setMainClass("org.python.util.jython");
File jythonJar = new File(PythonHelpersLocator.getPythonCommunityPath(), "lib/jython.jar");
parameters.getClassPath().add(jythonJar.getPath());
parameters.getProgramParametersList().add("-Dpython.path=" + pythonPath + File.pathSeparator + workDir);
parameters.getProgramParametersList().addAll(args);
parameters.setWorkingDirectory(workDir);
final GeneralCommandLine commandLine = JdkUtil.setupJVMCommandLine(sdkType.getVMExecutablePath(ideaJdk), parameters, false);
final CapturingProcessHandler processHandler = new CapturingProcessHandler(commandLine.createProcess());
return processHandler.runProcess();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:JythonUnitTestUtil.java
示例3: enhanceRemoteProcessing
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
@Override
public void enhanceRemoteProcessing(@NotNull SimpleJavaParameters parameters) throws ExecutionException {
final Set<String> additionalEntries = ContainerUtilRt.newHashSet();
for (GradleProjectResolverExtension extension : RESOLVER_EXTENSIONS.getValue()) {
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(extension.getClass()));
for (Class aClass : extension.getExtraProjectModelClasses()) {
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(aClass));
}
extension.enhanceRemoteProcessing(parameters);
}
final PathsList classPath = parameters.getClassPath();
for (String entry : additionalEntries) {
classPath.add(entry);
}
parameters.getVMParametersList().addProperty(
ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY, GradleConstants.SYSTEM_ID.getId());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:GradleManager.java
示例4: appendCoverageArgument
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
public void appendCoverageArgument(RunConfigurationBase configuration, final SimpleJavaParameters javaParameters) {
final CoverageRunner runner = getCoverageRunner();
try {
if (runner != null && runner instanceof JavaCoverageRunner) {
final String path = getCoverageFilePath();
assert path != null; // cannot be null here if runner != null
String sourceMapPath = null;
if (myCoverageProvider.isSourceMapNeeded(configuration)) {
sourceMapPath = getSourceMapPath(path);
}
((JavaCoverageRunner)runner).appendCoverageArgument(new File(path).getCanonicalPath(),
getPatterns(),
javaParameters,
isTrackPerTestCoverage() && !isSampling(),
isSampling(),
sourceMapPath);
}
}
catch (IOException e) {
LOG.info(e);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:JavaCoverageEnabledConfiguration.java
示例5: configureConfiguration
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
public static void configureConfiguration(SimpleJavaParameters parameters, CommonJavaRunConfigurationParameters configuration) {
ProgramParametersUtil.configureConfiguration(parameters, configuration);
Project project = configuration.getProject();
Module module = ProgramParametersUtil.getModule(configuration);
String vmParameters = configuration.getVMParameters();
if (vmParameters != null) {
vmParameters = ProgramParametersUtil.expandPath(vmParameters, module, project);
if (parameters.getEnv() != null) {
for (Map.Entry<String, String> each : parameters.getEnv().entrySet()) {
vmParameters = StringUtil.replace(vmParameters, "$" + each.getKey() + "$", each.getValue(), false); //replace env usages
}
}
}
parameters.getVMParametersList().addParametersString(vmParameters);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:JavaParametersUtil.java
示例6: configureConfiguration
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
private void configureConfiguration(SimpleJavaParameters parameters, XQueryRunConfiguration configuration) {
ProgramParametersUtil.configureConfiguration(parameters, configuration);
Project project = configuration.getProject();
Module module = getModule(configuration);
;
String alternativeJrePath = configuration.getAlternativeJrePath();
if (alternativeJrePath != null) {
configuration.setAlternativeJrePath(expandPath(alternativeJrePath, null, project));
}
String vmParameters = configuration.getVMParameters();
if (vmParameters != null) {
vmParameters = expandPath(vmParameters, module, project);
for (Map.Entry<String, String> each : parameters.getEnv().entrySet()) {
vmParameters = StringUtil.replace(vmParameters, "$" + each.getKey() + "$", each.getValue(), false);
}
}
parameters.getVMParametersList().addParametersString(vmParameters);
}
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:24,代码来源:XQueryRunProfileState.java
示例7: appendParamsEncodingClasspath
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
private static void appendParamsEncodingClasspath(SimpleJavaParameters javaParameters,
GeneralCommandLine commandLine,
ParametersList parametersList) {
commandLine.addParameters(parametersList.getList());
appendEncoding(javaParameters, commandLine, parametersList);
if (!parametersList.hasParameter("-classpath") && !parametersList.hasParameter("-cp") && !javaParameters.getClassPath().getPathList().isEmpty()){
commandLine.addParameter("-classpath");
commandLine.addParameter(javaParameters.getClassPath().getPathsString());
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JdkUtil.java
示例8: enhanceRemoteProcessing
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
@Override
public void enhanceRemoteProcessing(@NotNull SimpleJavaParameters parameters) {
List<String> classPath = Lists.newArrayList();
// Android module jars
addIfNotNull(getJarPathForClass(getClass()), classPath);
// Android sdklib jar
addIfNotNull(getJarPathForClass(FullRevision.class), classPath);
// Android common jar
addIfNotNull(getJarPathForClass(AndroidGradleSettings.class), classPath);
// Android gradle model jar
addIfNotNull(getJarPathForClass(AndroidProject.class), classPath);
parameters.getClassPath().addAll(classPath);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AndroidGradleProjectResolver.java
示例9: appendCoverageArgument
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
@Override
public void appendCoverageArgument(String sessionDataFilePath,
@Nullable String[] patterns,
SimpleJavaParameters parameters,
boolean collectLineInfo,
boolean isSampling) {
appendCoverageArgument(sessionDataFilePath, patterns, parameters, collectLineInfo, isSampling, null);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:IDEACoverageRunner.java
示例10: appendCoverageArgument
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
public void appendCoverageArgument(final String sessionDataFilePath, final String[] patterns, final SimpleJavaParameters javaParameters,
final boolean collectLineInfo, final boolean isSampling) {
StringBuffer argument = new StringBuffer("-javaagent:");
final String agentPath = PathUtil.getJarPathForClass(org.jacoco.agent.rt.RT.class);
final String parentPath = handleSpacesInPath(agentPath);
argument.append(parentPath).append(File.separator).append(new File(agentPath).getName());
argument.append("=");
argument.append("destfile=").append(sessionDataFilePath);
argument.append(",append=false");
javaParameters.getVMParametersList().add(argument.toString());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JaCoCoCoverageRunner.java
示例11: appendParamsEncodingClasspath
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
private static void appendParamsEncodingClasspath(SimpleJavaParameters javaParameters,
GeneralCommandLine commandLine,
ParametersList parametersList) {
commandLine.addParameters(parametersList.getList());
appendEncoding(javaParameters, commandLine, parametersList);
if (!parametersList.hasParameter("-classpath") && !parametersList.hasParameter("-cp")){
commandLine.addParameter("-classpath");
commandLine.addParameter(javaParameters.getClassPath().getPathsString());
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:JdkUtil.java
示例12: configureModule
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
private void configureModule(final RunConfigurationModule runConfigurationModule,
final SimpleJavaParameters parameters,
@Nullable String jreHome) throws CantRunException {
Module module = runConfigurationModule.getModule();
if (module == null) {
throw CantRunException.noModuleConfigured(runConfigurationModule.getModuleName());
}
configureByModule(parameters, module, createModuleJdk(module, jreHome));
}
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:10,代码来源:XQueryRunProfileState.java
示例13: configureByModule
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
private void configureByModule(SimpleJavaParameters parameters, final Module module, final Sdk jdk) throws CantRunException {
if (jdk == null) {
throw CantRunException.noJdkConfigured();
}
parameters.setJdk(jdk);
setDefaultCharset(parameters, module.getProject());
configureEnumerator(OrderEnumerator.orderEntries(module).runtimeOnly().recursively(), jdk).collectPaths(parameters.getClassPath());
}
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:9,代码来源:XQueryRunProfileState.java
示例14: prepareRunnerParameters
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
private SimpleJavaParameters prepareRunnerParameters() throws CantRunException {
final SimpleJavaParameters parameters = new SimpleJavaParameters();
parameters.setMainClass(configuration.getRunClass());
boolean isDebugging = getEnvironment().getExecutor().getId().equals(DefaultDebugExecutor.EXECUTOR_ID);
parameters.getProgramParametersList().prepend(getSerializedConfig(configuration, isDebugging, port).getAbsolutePath());
parameters.getClassPath().addFirst(new XQueryRunnerClasspathEntryGenerator().generateRunnerClasspathEntries(configuration));
return parameters;
}
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:9,代码来源:XQueryRunProfileState.java
示例15: setupJVMCommandLine
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
public static GeneralCommandLine setupJVMCommandLine(final String exePath,
final SimpleJavaParameters javaParameters,
final boolean forceDynamicClasspath) {
final GeneralCommandLine commandLine = new GeneralCommandLine(exePath);
final ParametersList vmParametersList = javaParameters.getVMParametersList();
commandLine.withEnvironment(javaParameters.getEnv());
commandLine.withParentEnvironmentType(javaParameters.isPassParentEnvs() ? ParentEnvironmentType.CONSOLE : ParentEnvironmentType.NONE);
final Class commandLineWrapper;
if ((commandLineWrapper = getCommandLineWrapperClass()) != null) {
if (forceDynamicClasspath && !vmParametersList.hasParameter("-classpath") && !vmParametersList.hasParameter("-cp")) {
if (isClassPathJarEnabled(javaParameters, PathUtil.getJarPathForClass(ClassPath.class))) {
appendJarClasspathParams(javaParameters, commandLine, vmParametersList, commandLineWrapper);
}
else {
appendOldCommandLineWrapper(javaParameters, commandLine, vmParametersList, commandLineWrapper);
}
}
else {
appendParamsEncodingClasspath(javaParameters, commandLine, vmParametersList);
}
}
else {
appendParamsEncodingClasspath(javaParameters, commandLine, vmParametersList);
}
final String mainClass = javaParameters.getMainClass();
final String jarPath = javaParameters.getJarPath();
if (mainClass != null) {
commandLine.addParameter(mainClass);
}
else if (jarPath != null) {
commandLine.addParameter("-jar");
commandLine.addParameter(jarPath);
}
commandLine.addParameters(javaParameters.getProgramParametersList().getList());
commandLine.withWorkDirectory(javaParameters.getWorkingDirectory());
return commandLine;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:44,代码来源:JdkUtil.java
示例16: appendJarClasspathParams
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
private static void appendJarClasspathParams(SimpleJavaParameters javaParameters,
GeneralCommandLine commandLine,
ParametersList vmParametersList, Class commandLineWrapper) {
try {
final Manifest manifest = new Manifest();
manifest.getMainAttributes().putValue("Created-By",
ApplicationNamesInfo.getInstance().getFullProductName());
final boolean writeDynamicVMOptions = javaParameters.isDynamicVMOptions() && useDynamicVMOptions();
if (writeDynamicVMOptions) {
List<String> dParams = new ArrayList<String>();
for (String param : vmParametersList.getList()) {
if (param.startsWith("-D")) {
dParams.add(param);
}
}
manifest.getMainAttributes().putValue("VM-Options", ParametersListUtil.join(dParams));
final ArrayList<String> restParams = new ArrayList<String>(vmParametersList.getList());
restParams.removeAll(dParams);
commandLine.addParameters(restParams);
}
else {
commandLine.addParameters(vmParametersList.getList());
}
final boolean notEscape = vmParametersList.hasParameter(PROPERTY_DO_NOT_ESCAPE_CLASSPATH_URL);
final List<String> classPathList = javaParameters.getClassPath().getPathList();
final String jarFile = CommandLineWrapperUtil.createClasspathJarFile(manifest, classPathList, notEscape).getAbsolutePath();
commandLine.addParameter("-classpath");
if (writeDynamicVMOptions) {
commandLine.addParameter(PathUtil.getJarPathForClass(commandLineWrapper) + File.pathSeparator + jarFile);
appendEncoding(javaParameters, commandLine, vmParametersList);
commandLine.addParameter(commandLineWrapper.getName());
commandLine.addParameter(jarFile);
}
else {
commandLine.addParameters(jarFile);
appendEncoding(javaParameters, commandLine, vmParametersList);
}
}
catch (IOException e) {
LOG.error(e);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:44,代码来源:JdkUtil.java
示例17: enhanceRemoteProcessing
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
@Override
public void enhanceRemoteProcessing(@NotNull SimpleJavaParameters parameters) throws ExecutionException {
PathsList classPath = parameters.getClassPath();
// Gradle i18n bundle.
ExternalSystemApiUtil.addBundle(classPath, GradleBundle.PATH_TO_BUNDLE, GradleBundle.class);
// Gradle tool jars.
String toolingApiPath = PathManager.getJarPathForClass(ProjectConnection.class);
if (toolingApiPath == null) {
LOG.warn(GradleBundle.message("gradle.generic.text.error.jar.not.found"));
throw new ExecutionException("Can't find gradle libraries");
}
File gradleJarsDir = new File(toolingApiPath).getParentFile();
File[] gradleJars = gradleJarsDir.listFiles(FileFilters.filesWithExtension("jar"));
if (gradleJars == null) {
LOG.warn(GradleBundle.message("gradle.generic.text.error.jar.not.found"));
throw new ExecutionException("Can't find gradle libraries at " + gradleJarsDir.getAbsolutePath());
}
for (File jar : gradleJars) {
classPath.add(jar.getAbsolutePath());
}
List<String> additionalEntries = ContainerUtilRt.newArrayList();
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(GroovyObject.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(GsonBuilder.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ExternalProject.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(JavaProjectData.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(LanguageLevel.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(StdModuleTypes.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(JavaModuleType.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ModuleType.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(EmptyModuleType.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ProjectImportAction.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(Init.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(org.slf4j.Logger.class));
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(Log4jLoggerFactory.class));
for (String entry : additionalEntries) {
classPath.add(entry);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:BaseGradleProjectResolverExtension.java
示例18: enhanceRemoteProcessing
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
@Override
public void enhanceRemoteProcessing(@NotNull SimpleJavaParameters parameters) throws ExecutionException {
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:AbstractProjectResolverExtension.java
示例19: appendCoverageArgument
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
public abstract void appendCoverageArgument(final String sessionDataFilePath, @Nullable final String[] patterns, final SimpleJavaParameters parameters,
final boolean collectLineInfo, final boolean isSampling);
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:JavaCoverageRunner.java
示例20: isValidXalanPresent
import com.intellij.execution.configurations.SimpleJavaParameters; //导入依赖的package包/类
@Nullable
private static Boolean isValidXalanPresent(SimpleJavaParameters parameters) {
final List<VirtualFile> files = parameters.getClassPath().getVirtualFiles();
for (VirtualFile file : files) {
if (file.getName().matches(".*xalan.*\\.jar")) {
final VirtualFile root = JarFileSystem.getInstance().getJarRootForLocalFile(file);
final VirtualFile manifestFile = root != null ? root.findFileByRelativePath("META-INF/MANIFEST.MF") : null;
if (manifestFile != null) {
try {
Manifest manifest = manifestFile.getUserData(MANIFEST);
if (manifest == null) {
manifest = new Manifest(manifestFile.getInputStream());
manifestFile.putUserData(MANIFEST, manifest);
}
Attributes attributes = manifest.getAttributes("org/apache/xalan/");
if (attributes == null) {
attributes = manifest.getAttributes("org/apache/xalan");
}
if (attributes == null) {
LOG.info("No manifest attributes for 'org/apache/xalan/' in " + manifestFile.getPresentableUrl());
continue;
}
final String version = attributes.getValue("Implementation-Version");
if (version != null) {
final String[] parts = version.split("\\.");
if (parts.length >= 2) {
if (Integer.parseInt(parts[0]) >= 2 && Integer.parseInt(parts[1]) >= 6) {
return true;
}
}
LOG.info("Unsupported Xalan version: " + version);
} else {
LOG.info("No Xalan version information in " + file.getPath());
}
} catch (IOException e) {
LOG.warn("Unable to read manifest from " + file.getName(), e);
}
} else {
LOG.info("No manifest file in " + file.getPath());
}
return false;
}
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:47,代码来源:XsltDebuggerExtension.java
注:本文中的com.intellij.execution.configurations.SimpleJavaParameters类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论