當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。