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


Java PathsList.add方法代码示例

本文整理汇总了Java中com.intellij.util.PathsList.add方法的典型用法代码示例。如果您正苦于以下问题:Java PathsList.add方法的具体用法?Java PathsList.add怎么用?Java PathsList.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.PathsList的用法示例。


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

示例1: enhanceRemoteProcessing

import com.intellij.util.PathsList; //导入方法依赖的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

示例2: removeFrameworkStuff

import com.intellij.util.PathsList; //导入方法依赖的package包/类
private PathsList removeFrameworkStuff(Module module, List<VirtualFile> rootFiles) {
  final List<File> toExclude = getImplicitClasspathRoots(module);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Before removing framework stuff: " + rootFiles);
    LOG.debug("Implicit roots:" + toExclude);
  }

  PathsList scriptClassPath = new PathsList();
  eachRoot:
  for (VirtualFile file : rootFiles) {
    for (final File excluded : toExclude) {
      if (VfsUtil.isAncestor(excluded, VfsUtil.virtualToIoFile(file), false)) {
        continue eachRoot;
      }
    }
    scriptClassPath.add(file);
  }
  return scriptClassPath;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:MvcFramework.java

示例3: updateJavaParameters

import com.intellij.util.PathsList; //导入方法依赖的package包/类
/**
 * The goal of this function is to find classpath for JUnit runner.
 * <p/>
 * There are two ways to do so:
 * 1. If Pants supports `--export-classpath-manifest-jar-only`, then only the manifest jar will be
 * picked up which contains all the classpath links for a particular test.
 * 2. If not, this method will collect classpath based on all known target ids from project modules.
 */
@Override
public <T extends RunConfigurationBase> void updateJavaParameters(
  T configuration,
  JavaParameters params,
  RunnerSettings runnerSettings
) throws ExecutionException {
  final Module module = findPantsModule(configuration);
  if (module == null) {
    return;
  }
  /**
   * This enables dynamic classpath for this particular run and prevents argument too long errors caused by long classpaths.
   */
  params.setUseDynamicClasspath(true);

  final PathsList classpath = params.getClassPath();

  VirtualFile manifestJar = PantsUtil.findProjectManifestJar(configuration.getProject())
    .orElseThrow(() -> new ExecutionException("Pants supports manifest jar, but it is not found."));
  classpath.add(manifestJar.getPath());


  PantsExternalMetricsListenerManager.getInstance().logTestRunner(configuration);
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:33,代码来源:PantsClasspathRunConfigurationExtension.java

示例4: getClassPathFromRootModel

import com.intellij.util.PathsList; //导入方法依赖的package包/类
@Nullable
public static PathsList getClassPathFromRootModel(Module module, boolean isTests, JavaParameters params, boolean allowDuplication)
  throws CantRunException {
  if (module == null) {
    return null;
  }

  final JavaParameters tmp = new JavaParameters();
  tmp.configureByModule(module, isTests ? JavaParameters.CLASSES_AND_TESTS : JavaParameters.CLASSES_ONLY);
  if (tmp.getClassPath().getVirtualFiles().isEmpty()) {
    return null;
  }

  Set<VirtualFile> core = new HashSet<VirtualFile>(params.getClassPath().getVirtualFiles());

  PathsList nonCore = new PathsList();
  for (VirtualFile virtualFile : tmp.getClassPath().getVirtualFiles()) {
    if (allowDuplication || !core.contains(virtualFile)) {
      nonCore.add(virtualFile);
    }
  }
  return nonCore;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:GroovyScriptRunner.java

示例5: _appendSwingExplorerJarsToClassPath

import com.intellij.util.PathsList; //导入方法依赖的package包/类
/**
 * F�gt die JAR-Dateien zum Classpath des auszuf�hrenden Programms hinzu
 *
 * @param profileState Profil, bei dem es hinzugef�gt werden soll
 * @throws ExecutionException Wenn die JavaParameter nicht geladen werden konnten
 */
private void _appendSwingExplorerJarsToClassPath(ApplicationConfiguration.JavaApplicationCommandLineState profileState) throws ExecutionException
{
  PathsList classPath = profileState.getJavaParameters().getClassPath();

  classPath.add(swagJarFile);
  classPath.add(swexplJarFile);
}
 
开发者ID:wglanzer,项目名称:swingexplorer-idea,代码行数:14,代码来源:Runner.java

示例6: handleJavaResources

import com.intellij.util.PathsList; //导入方法依赖的package包/类
private static void handleJavaResources(@NotNull IdeaAndroidProject ideaAndroidProject,
                                        @NotNull PathsList classPath) {
  BaseArtifact testArtifact = ideaAndroidProject.findSelectedTestArtifactInSelectedVariant();
  if (testArtifact == null) {
    return;
  }

  try {
    classPath.add(ideaAndroidProject.getSelectedVariant().getMainArtifact().getJavaResourcesFolder());
    classPath.add(testArtifact.getJavaResourcesFolder());
  }
  catch (UnsupportedMethodException e) {
    // Java resources were not in older versions of the gradle plugin.
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:AndroidJunitPatcher.java

示例7: getClassPathFromRootModel

import com.intellij.util.PathsList; //导入方法依赖的package包/类
@Nullable
public static PathsList getClassPathFromRootModel(Module module,
                                                  boolean isTests,
                                                  JavaParameters params,
                                                  boolean allowDuplication,
                                                  PathsList pathList)
  throws CantRunException {
  if (module == null) {
    return null;
  }

  pathList.add(".");

  final JavaParameters tmp = new JavaParameters();
  tmp.configureByModule(module, isTests ? JavaParameters.CLASSES_AND_TESTS : JavaParameters.CLASSES_ONLY);
  if (tmp.getClassPath().getVirtualFiles().isEmpty()) {
    return null;
  }

  Set<VirtualFile> core = new HashSet<VirtualFile>(params.getClassPath().getVirtualFiles());

  for (VirtualFile virtualFile : tmp.getClassPath().getVirtualFiles()) {
    if (allowDuplication || !core.contains(virtualFile)) {
      pathList.add(virtualFile);
    }
  }
  return pathList;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:GroovyScriptRunner.java

示例8: addBundle

import com.intellij.util.PathsList; //导入方法依赖的package包/类
/**
 * Configures given classpath to reference target i18n bundle file(s).
 *
 * @param classPath     process classpath
 * @param bundlePath    path to the target bundle file
 * @param contextClass  class from the same content root as the target bundle file
 */
public static void addBundle(@NotNull PathsList classPath, @NotNull String bundlePath, @NotNull Class<?> contextClass) {
  String pathToUse = bundlePath.replace('.', '/');
  if (!pathToUse.endsWith(".properties")) {
    pathToUse += ".properties";
  }
  if (!pathToUse.startsWith("/")) {
    pathToUse = '/' + pathToUse;
  }
  String root = PathManager.getResourceRoot(contextClass, pathToUse);
  if (root != null) {
    classPath.add(root);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:ExternalSystemApiUtil.java

示例9: addNoJdkModFiles

import com.intellij.util.PathsList; //导入方法依赖的package包/类
private static void addNoJdkModFiles(OrderRootsEnumerator orderEnumerator, PathsList pathsList)
{
	for(VirtualFile virtualFile : orderEnumerator.getRoots())
	{
		VirtualFile archive = ArchiveVfsUtil.getVirtualFileForArchive(virtualFile);
		if(archive != null && archive.getFileType() == JModFileType.INSTANCE)
		{
			continue;
		}

		pathsList.add(virtualFile);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:14,代码来源:JavaParameters.java

示例10: configureClassPath

import com.intellij.util.PathsList; //导入方法依赖的package包/类
private static void configureClassPath(PathsList cp) {
    cp.add(PathUtil.getJarPathForClass(HotSwapAgent.class)); // TODO take it from module cp
    cp.add(PathUtil.getJarPathForClass(MutationCoverageReport.class));
}
 
开发者ID:artspb,项目名称:idea-pitest,代码行数:5,代码来源:JavaParametersConfigurator.java

示例11: enhanceParameters

import com.intellij.util.PathsList; //导入方法依赖的package包/类
@Override
public void enhanceParameters(@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();
  String[] gradleJars = gradleJarsDir.list(new FilenameFilter() {
    @Override
    public boolean accept(File dir, String name) {
      return name.endsWith(".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 (String jar : gradleJars) {
    classPath.add(new File(gradleJarsDir, jar).getAbsolutePath());
  }

  List<String> additionalEntries = ContainerUtilRt.newArrayList();
  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));
  for (String entry : additionalEntries) {
    classPath.add(entry);
  }

  for (GradleProjectResolverExtension extension : RESOLVER_EXTENSIONS.getValue()) {
    extension.enhanceParameters(parameters);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:44,代码来源:GradleManager.java


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