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


Java JavaParameters类代码示例

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


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

示例1: addBinFolder

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
private void addBinFolder(Path tomcatInstallation, JavaParameters javaParams) throws ExecutionException {
    // Dynamically adds the tomcat jars to the classpath
    Path binFolder = tomcatInstallation.resolve("bin");
    if (!Files.exists(binFolder)) {
        throw new ExecutionException("The Tomcat installation configured doesn't contains a bin folder");
    }
    String[] jars = binFolder.toFile().list(new FilenameFilter() {
        @Override
        public boolean accept(File dir, String name) {
            return name.endsWith(".jar");
        }
    });

    for (String jarFile : jars) {
        javaParams.getClassPath().add(binFolder.resolve(jarFile).toFile().getAbsolutePath());
    }
}
 
开发者ID:vitorzachi,项目名称:tomcat-runner,代码行数:18,代码来源:TomcatConfigurer.java

示例2: addLibFolder

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
private void addLibFolder(Path tomcatInstallation, JavaParameters javaParams) throws ExecutionException {
    // add libs folder
    Path libFolder = tomcatInstallation.resolve("lib");
    if (!Files.exists(libFolder)) {
        throw new ExecutionException("The Tomcat installation configured doesn't contains a lib folder");
    }
    String[] jars = libFolder.toFile().list(new FilenameFilter() {
        @Override
        public boolean accept(File dir, String name) {
            return name.endsWith(".jar");
        }
    });

    for (String jarFile : jars) {
        javaParams.getClassPath().add(libFolder.resolve(jarFile).toFile().getAbsolutePath());
    }
}
 
开发者ID:vitorzachi,项目名称:tomcat-runner,代码行数:18,代码来源:TomcatConfigurer.java

示例3: addLivingDocProgramParameterList

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
/**
 * <p>To override the default System Under Development class (used for fixture classes instantiation).<br>
 * The library with the specified class should be in the same directory as the runner. </p>
 * <br>
 * <code>-f CLASS;ARGS Use CLASS as the system under development and instantiate it with ARGS</code>
 */
private JavaParameters addLivingDocProgramParameterList() throws ExecutionException {

    JavaParameters javaParameters = new JavaParameters();

    // Generate XML report (defaults to plain)
    javaParameters.getProgramParametersList().add("--xml");

    try {
        javaParameters.getProgramParametersList().add(getSpecificationInputPath());
        javaParameters.getProgramParametersList().add(getReportOutputPath());

    } catch (Exception e) {
        LOG.error(e);
        throw new ExecutionException(e);
    }
    return javaParameters;
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:24,代码来源:RunProfileStateLivingDoc.java

示例4: checkTargetJPDAInstalled

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
private static void checkTargetJPDAInstalled(JavaParameters parameters) throws ExecutionException {
  final Sdk jdk = parameters.getJdk();
  if (jdk == null) {
    throw new ExecutionException(DebuggerBundle.message("error.jdk.not.specified"));
  }
  final JavaSdkVersion version = JavaSdk.getInstance().getVersion(jdk);
  String versionString = jdk.getVersionString();
  if (version == JavaSdkVersion.JDK_1_0 || version == JavaSdkVersion.JDK_1_1) {
    throw new ExecutionException(DebuggerBundle.message("error.unsupported.jdk.version", versionString));
  }
  if (SystemInfo.isWindows && version == JavaSdkVersion.JDK_1_2) {
    final VirtualFile homeDirectory = jdk.getHomeDirectory();
    if (homeDirectory == null || !homeDirectory.isValid()) {
      throw new ExecutionException(DebuggerBundle.message("error.invalid.jdk.home", versionString));
    }
    //noinspection HardCodedStringLiteral
    File dllFile = new File(
      homeDirectory.getPath().replace('/', File.separatorChar) + File.separator + "bin" + File.separator + "jdwp.dll"
    );
    if (!dllFile.exists()) {
      GetJPDADialog dialog = new GetJPDADialog();
      dialog.show();
      throw new ExecutionException(DebuggerBundle.message("error.debug.libraries.missing"));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:DebuggerManagerImpl.java

示例5: createCommandLineProxy

import com.intellij.execution.configurations.JavaParameters; //导入依赖的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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ProcessProxyFactoryImpl.java

示例6: passForkMode

import com.intellij.execution.configurations.JavaParameters; //导入依赖的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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:TestNGRunnableState.java

示例7: createJavaParameters

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
@Override
protected JavaParameters createJavaParameters() throws ExecutionException {
  final JavaParameters javaParameters = super.createJavaParameters();
  final JUnitConfiguration.Data data = getConfiguration().getPersistentData();
  final DumbService dumbService = DumbService.getInstance(getConfiguration().getProject());
  try {
    dumbService.setAlternativeResolveEnabled(true);
    getClassFilter(data);//check if junit found
  }
  finally {
    dumbService.setAlternativeResolveEnabled(false);
  }
  createTempFiles(javaParameters);

  createServerSocket(javaParameters);
  return javaParameters;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:TestPackage.java

示例8: createJavaParameters

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
@Override
protected JavaParameters createJavaParameters() throws ExecutionException {
  final JavaParameters javaParameters = super.createDefaultJavaParameters();
  final JUnitConfiguration.Data data = getConfiguration().getPersistentData();
  RunConfigurationModule module = getConfiguration().getConfigurationModule();
  final Project project = module.getProject();
  final SourceScope scope = getSourceScope();
  final GlobalSearchScope searchScope = scope != null ? scope.getGlobalSearchScope() : GlobalSearchScope.allScope(project);
  addClassesListToJavaParameters(myFailedTests, new Function<AbstractTestProxy, String>() {
    @Override
    public String fun(AbstractTestProxy testInfo) {
      return testInfo != null ? getTestPresentation(testInfo, project, searchScope) : null;
    }
  }, data.getPackageName(), true, javaParameters);

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

示例9: isApplicable

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
public static boolean isApplicable(@Nullable Project project, JavaParameters javaParameters, MavenRunConfiguration runConfiguration) {
  if (hasResumeFromParameter(runConfiguration)) { // This runConfiguration was created by other MavenResumeAction.
    MavenRunConfiguration clonedRunConf = runConfiguration.clone();
    List<String> clonedGoals = clonedRunConf.getRunnerParameters().getGoals();
    clonedGoals.remove(clonedGoals.size() - 1);
    clonedGoals.remove(clonedGoals.size() - 1);
    try {
      javaParameters = clonedRunConf.createJavaParameters(project);
    }
    catch (ExecutionException e) {
      return false;
    }
  }

  for (String params : javaParameters.getProgramParametersList().getList()) {
    if (PARAMS_DISABLING_RESUME.contains(params)) {
      return false;
    }
  }

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

示例10: assertClasspath

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
private void assertClasspath(String moduleName, Scope scope, Type type, String... expectedPaths) throws Exception {
  createOutputDirectories();

  PathsList actualPathsList;
  Module module = getModule(moduleName);

  if (scope == Scope.RUNTIME) {
    JavaParameters params = new JavaParameters();
    params.configureByModule(module, type == Type.TESTS ? JavaParameters.CLASSES_AND_TESTS : JavaParameters.CLASSES_ONLY);
    actualPathsList = params.getClassPath();
  }
  else {
    OrderEnumerator en = OrderEnumerator.orderEntries(module).recursively().withoutSdk().compileOnly();
    if (type == Type.PRODUCTION) en.productionOnly();
    actualPathsList = en.classes().getPathsList();
  }

  assertPaths(expectedPaths, actualPathsList.getPathList());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:MavenClasspathsAndSearchScopesTest.java

示例11: getCommandLine

import com.intellij.execution.configurations.JavaParameters; //导入依赖的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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:AntCommandLineBuilder.java

示例12: configureCommandLine

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
@Override
public void configureCommandLine(JavaParameters params, @Nullable Module module, boolean tests, VirtualFile script, GroovyScriptRunConfiguration configuration) throws CantRunException {
  configureGenericGroovyRunner(params, module, "groovy.ui.GroovyMain", false, tests);

  //addClasspathFromRootModel(module, tests, params, true);

  params.getVMParametersList().addParametersString(configuration.getVMParameters());

  addScriptEncodingSettings(params, script, module);

  if (configuration.isDebugEnabled()) {
    params.getProgramParametersList().add("--debug");
  }

  String path = ScriptFileUtil.getLocalFilePath(StringUtil.notNullize(configuration.getScriptPath()));
  params.getProgramParametersList().add(FileUtil.toSystemDependentName(path));
  params.getProgramParametersList().addParametersString(configuration.getScriptParameters());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DefaultGroovyScriptRunner.java

示例13: updateJavaParameters

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
public void updateJavaParameters(RunConfigurationBase configuration, JavaParameters params, RunnerSettings runnerSettings) {
  if (!isApplicableFor(configuration)) {
    return;
  }

  final JavaCoverageEnabledConfiguration coverageConfig = JavaCoverageEnabledConfiguration.getFrom(configuration);
  //noinspection ConstantConditions
  coverageConfig.setCurrentCoverageSuite(null);
  final CoverageRunner coverageRunner = coverageConfig.getCoverageRunner();
  if (runnerSettings instanceof CoverageRunnerData && coverageRunner != null) {
    final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(configuration.getProject());
    coverageConfig.setCurrentCoverageSuite(coverageDataManager.addCoverageSuite(coverageConfig));
    coverageConfig.appendCoverageArgument(configuration, params);

    final Sdk jdk = params.getJdk();
    if (jdk != null && JavaSdk.getInstance().isOfVersionOrHigher(jdk, JavaSdkVersion.JDK_1_7) && coverageRunner instanceof JavaCoverageRunner && !((JavaCoverageRunner)coverageRunner).isJdk7Compatible()) {
      Notifications.Bus.notify(new Notification("Coverage", "Coverage instrumentation is not fully compatible with JDK 7",
                                                coverageRunner.getPresentableName() +
                                                " coverage instrumentation can lead to java.lang.VerifyError errors with JDK 7. If so, please try IDEA coverage runner.",
                                                NotificationType.WARNING));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CoverageJavaRunConfigurationExtension.java

示例14: patchParameters

import com.intellij.execution.configurations.JavaParameters; //导入依赖的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());
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:25,代码来源:AppEngineGwtServer.java

示例15: createJavaParameters

import com.intellij.execution.configurations.JavaParameters; //导入依赖的package包/类
@Override
protected JavaParameters createJavaParameters() throws ExecutionException {
    final JavaParameters params = new JavaParameters();
    final JavaRunConfigurationModule module = myConfiguration.getConfigurationModule();
    final String jreHome = myConfiguration.isAlternativeJrePathEnabled() ? myConfiguration.getAlternativeJrePath() : null;
    final int classPathType = JavaParametersUtil.getClasspathType(module,
            PageObjectRunConfig.MAIN_CLASS_NAME,
            false);

    JavaParametersUtil.configureModule(module, params, classPathType, jreHome);
    params.setJdk(JavaParametersUtil.createProjectJdk(myConfiguration.getProject(), jreHome));
    params.setMainClass(PageObjectRunConfig.MAIN_CLASS_NAME);
    params.getProgramParametersList().add(EvaluationConfig.from(myConfiguration).toArgs());
    params.getClassPath().add(PathUtil.getJarPathForClass(RunPageObjectMain.class));
    params.getClassPath().add(PathUtil.getJarPathForClass(Logger.class));
    setupJavaParameters(params);

    return params;
}
 
开发者ID:bjorm,项目名称:PageObjectEvaluator,代码行数:20,代码来源:PageObjectRunState.java


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