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


Java SimpleJavaParameters类代码示例

本文整理汇总了Java中com.intellij.execution.configurations.SimpleJavaParameters的典型用法代码示例。如果您正苦于以下问题:Java SimpleJavaParameters类的具体用法?Java SimpleJavaParameters怎么用?Java SimpleJavaParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SimpleJavaParameters类属于com.intellij.execution.configurations包,在下文中一共展示了SimpleJavaParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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