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


Java OwnJavaParameters类代码示例

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


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

示例1: getJavaParameters

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
public OwnJavaParameters getJavaParameters()
{
	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:consulo,项目名称:consulo-apache-ant,代码行数:26,代码来源:AntCommandLineBuilder.java

示例2: getNameAndDescription

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
@NotNull
@Override
public Pair<String, String> getNameAndDescription()
{
	Module module = getSelectedModule.apply(moduleComboBox);
	if(module == null)
	{
		return Pair.create(null, "module not specified");
	}

	Boolean productionOnly = this.productionOnly.get();
	Sdk jdkToRun = OwnJavaParameters.getJdkToRunModule(module, productionOnly);
	Sdk moduleJdk = ModuleUtilCore.getSdk(module, JavaModuleExtension.class);

	if(jdkToRun == null || moduleJdk == null)
	{
		return Pair.create(null, "module not specified");
	}

	if(Objects.equals(moduleJdk.getHomeDirectory(), jdkToRun.getHomeDirectory()))
	{
		return Pair.create(moduleJdk.getName(), BundleBase.format("SDK of ''{0}'' module", module.getName()));
	}
	return Pair.create(jdkToRun.getName(), BundleBase.format("newest SDK from ''{0}'' module {1} dependencies", module.getName(), productionOnly ? "" : "test"));
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:DefaultJreSelector.java

示例3: getClasspathType

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
@MagicConstant(valuesFromClass = OwnJavaParameters.class)
public static int getClasspathType(final RunConfigurationModule configurationModule,
		final String mainClassName,
		final boolean classMustHaveSource,
		final boolean includeProvidedDependencies) throws CantRunException
{
	final Module module = configurationModule.getModule();
	if(module == null)
	{
		throw CantRunException.noModuleConfigured(configurationModule.getModuleName());
	}
	Boolean inProduction = isClassInProductionSources(mainClassName, module);
	if(inProduction == null)
	{
		if(!classMustHaveSource)
		{
			return OwnJavaParameters.JDK_AND_CLASSES_AND_TESTS;
		}
		throw CantRunException.classNotFound(mainClassName, module);
	}

	return inProduction ? (includeProvidedDependencies ? OwnJavaParameters.JDK_AND_CLASSES_AND_PROVIDED : OwnJavaParameters.JDK_AND_CLASSES) : OwnJavaParameters.JDK_AND_CLASSES_AND_TESTS;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:24,代码来源:JavaParametersUtil.java

示例4: appendCoverageArgument

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
public void appendCoverageArgument(final OwnJavaParameters 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

      ((JavaCoverageRunner)runner).appendCoverageArgument(new File(path).getCanonicalPath(),
                                                          getPatterns(),
                                                          javaParameters,
                                                          isTrackPerTestCoverage() && !isSampling(),
                                                          isSampling());
    }
  }
  catch (IOException e) {
    LOG.info(e);
  }
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:19,代码来源:JavaCoverageEnabledConfiguration.java

示例5: updateJavaParameters

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
public void updateJavaParameters(RunConfigurationBase configuration, OwnJavaParameters 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(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:consulo,项目名称:consulo-java,代码行数:24,代码来源:CoverageJavaRunConfigurationExtension.java

示例6: appendCoverageArgument

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
public void appendCoverageArgument(final String sessionDataFilePath, final String[] patterns, final OwnJavaParameters javaParameters,
                                   final boolean collectLineInfo, final boolean isSampling) {
  @NonNls StringBuffer argument = new StringBuffer("-javaagent:");
  argument.append(PathManager.getLibPath()).append(File.separator);
  argument.append("cobertura.jar=");

  if (patterns != null && patterns.length > 0) {
    for (String coveragePattern : patterns) {
      coveragePattern = coveragePattern.replace("$", "\\$").replace(".", "\\.").replaceAll("\\*", ".*");
      if (!coveragePattern.endsWith(".*")) { //include inner classes
        coveragePattern += "(\\$.*)*";
      }
      argument.append("--includeClasses ").append(coveragePattern).append(" ");
    }
  }
  if (SystemInfo.isWindows) {
    argument.append("--datafile ").append("\\\"").append(sessionDataFilePath).append("\\\"");
  }
  else {
    argument.append("--datafile ").append(sessionDataFilePath);
  }
  javaParameters.getVMParametersList().add(argument.toString());
  javaParameters.getVMParametersList().defineProperty("net.sourceforge.cobertura.datafile", sessionDataFilePath);
  javaParameters.getClassPath().add(PathManager.getLibPath() + File.separator + "cobertura.jar");
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:CoberturaCoverageRunner.java

示例7: getState

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
@Override
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException
{
	final JavaCommandLineState state = new JavaCommandLineState(env)
	{
		@Override
		protected OwnJavaParameters createJavaParameters()
		{
			return myParameters;
		}
	};
	final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(myProject);
	if(myFilters != null)
	{
		builder.filters(myFilters);
	}
	state.setConsoleBuilder(builder);
	return state;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:20,代码来源:JavaExecutionUtil.java

示例8: createJavaParameters

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
@Override
protected OwnJavaParameters createJavaParameters() throws ExecutionException
{
	final OwnJavaParameters params = new OwnJavaParameters();
	final String jreHome = myConfiguration.isAlternativeJrePathEnabled() ? myConfiguration.getAlternativeJrePath() : null;
	params.setJdk(JavaParametersUtil.createProjectJdk(myConfiguration.getProject(), jreHome));
	setupJavaParameters(params);
	params.setJarPath(FileUtil.toSystemDependentName(myConfiguration.getJarPath()));
	return params;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:11,代码来源:JarApplicationCommandLineState.java

示例9: createJavaParameters

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
@Override
protected OwnJavaParameters createJavaParameters() throws ExecutionException
{
	final OwnJavaParameters params = new OwnJavaParameters();
	T configuration = getConfiguration();
	params.setShortenCommandLine(configuration.getShortenCommandLine(), configuration.getProject());

	final JavaRunConfigurationModule module = myConfiguration.getConfigurationModule();
	final String alternativeJreHome = myConfiguration.ALTERNATIVE_JRE_PATH_ENABLED ? myConfiguration.ALTERNATIVE_JRE_PATH : null;
	if(module.getModule() != null)
	{
		DumbService.getInstance(module.getProject()).runWithAlternativeResolveEnabled(() ->
		{
			int classPathType = JavaParametersUtil.getClasspathType(module, myConfiguration.MAIN_CLASS_NAME, false, myConfiguration.isProvidedScopeIncluded());
			JavaParametersUtil.configureModule(module, params, classPathType, alternativeJreHome);
		});
	}
	else
	{
		JavaParametersUtil.configureProject(module.getProject(), params, OwnJavaParameters.JDK_AND_CLASSES_AND_TESTS, alternativeJreHome);
	}

	params.setMainClass(myConfiguration.MAIN_CLASS_NAME);

	setupJavaParameters(params);

	setupModulePath(params, module);

	return params;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:31,代码来源:ApplicationConfiguration.java

示例10: setupModulePath

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
private static void setupModulePath(OwnJavaParameters params, JavaRunConfigurationModule module)
{
	if(JavaSdkUtil.isJdkAtLeast(params.getJdk(), JavaSdkVersion.JDK_1_9))
	{
		PsiJavaModule mainModule = DumbService.getInstance(module.getProject()).computeWithAlternativeResolveEnabled(() -> JavaModuleGraphUtil.findDescriptorByElement(module.findClass(params
				.getMainClass())));
		if(mainModule != null)
		{
			params.setModuleName(mainModule.getName());
			PathsList classPath = params.getClassPath(), modulePath = params.getModulePath();
			modulePath.addAll(classPath.getPathList());
			classPath.clear();
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:16,代码来源:ApplicationConfiguration.java

示例11: setupJavaParameters

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
protected void setupJavaParameters(OwnJavaParameters params) throws ExecutionException
{
	JavaParametersUtil.configureConfiguration(params, myConfiguration);

	for(RunConfigurationExtension ext : RunConfigurationExtension.EP_NAME.getExtensions())
	{
		ext.updateJavaParameters(getConfiguration(), params, getRunnerSettings());
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:10,代码来源:BaseJavaApplicationCommandLineState.java

示例12: collectListeners

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
protected void collectListeners(OwnJavaParameters javaParameters, StringBuilder buf, String epName, String delimiter)
{
	final T configuration = getConfiguration();
	final Object[] listeners = Extensions.getExtensions(epName);
	for(final Object listener : listeners)
	{
		boolean enabled = true;
		for(RunConfigurationExtension ext : Extensions.getExtensions(RunConfigurationExtension.EP_NAME))
		{
			if(ext.isListenerDisabled(configuration, listener, getRunnerSettings()))
			{
				enabled = false;
				break;
			}
		}
		if(enabled)
		{
			if(buf.length() > 0)
			{
				buf.append(delimiter);
			}
			final Class classListener = listener.getClass();
			buf.append(classListener.getName());
			javaParameters.getClassPath().add(PathUtil.getJarPathForClass(classListener));
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:28,代码来源:JavaTestFrameworkRunnableState.java

示例13: configureClasspath

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
protected void configureClasspath(final OwnJavaParameters javaParameters) throws CantRunException
{
	configureRTClasspath(javaParameters);
	RunConfigurationModule module = getConfiguration().getConfigurationModule();
	final String alternativeJreName = getConfiguration().isAlternativeJrePathEnabled() ? getConfiguration().getAlternativeJrePath() : null;
	final int pathType = OwnJavaParameters.JDK_AND_CLASSES_AND_TESTS;
	if(configureByModule(module.getModule()))
	{
		JavaParametersUtil.configureModule(module, javaParameters, pathType, alternativeJreName);
	}
	else
	{
		JavaParametersUtil.configureProject(getConfiguration().getProject(), javaParameters, pathType, alternativeJreName);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:16,代码来源:JavaTestFrameworkRunnableState.java

示例14: createServerSocket

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
protected void createServerSocket(OwnJavaParameters javaParameters)
{
	try
	{
		myServerSocket = new ServerSocket(0, 0, InetAddress.getByName("127.0.0.1"));
		javaParameters.getProgramParametersList().add("-socket" + myServerSocket.getLocalPort());
	}
	catch(IOException e)
	{
		LOG.error(e);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:13,代码来源:JavaTestFrameworkRunnableState.java

示例15: createTempFiles

import consulo.java.execution.configurations.OwnJavaParameters; //导入依赖的package包/类
protected void createTempFiles(OwnJavaParameters javaParameters)
{
	try
	{
		myWorkingDirsFile = FileUtil.createTempFile("idea_working_dirs_" + getFrameworkId(), ".tmp", true);
		javaParameters.getProgramParametersList().add("@[email protected]" + myWorkingDirsFile.getAbsolutePath());

		myTempFile = FileUtil.createTempFile("idea_" + getFrameworkId(), ".tmp", true);
		passTempFile(javaParameters.getProgramParametersList(), myTempFile.getAbsolutePath());
	}
	catch(Exception e)
	{
		LOG.error(e);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:16,代码来源:JavaTestFrameworkRunnableState.java


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