• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PackagingElementResolvingContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getManifestFile

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Nullable 
public ManifestFileConfiguration getManifestFile(CompositePackagingElement<?> element, ArtifactType artifactType,
                                                 final PackagingElementResolvingContext context) {
  final VirtualFile manifestFile = ManifestFileUtil.findManifestFile(element, context, artifactType);
  if (manifestFile == null) {
    return null;
  }

  ManifestFileConfiguration configuration = myManifestFiles.get(manifestFile);
  if (configuration == null) {
    configuration = ManifestFileUtil.createManifestFileConfiguration(manifestFile);
    myOriginalManifestFiles.put(manifestFile, new ManifestFileConfiguration(configuration));
    myManifestFiles.put(manifestFile, configuration);
  }
  return configuration;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ManifestFilesInfo.java


示例2: computeAntInstructions

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Override
public List<? extends Generator> computeAntInstructions(@NotNull PackagingElementResolvingContext resolvingContext,
                                                        @NotNull AntCopyInstructionCreator creator,
                                                        @NotNull ArtifactAntGenerationContext generationContext,
                                                        @NotNull ArtifactType artifactType) {
  final String jarPath = generationContext.getSubstitutedPath(myFilePath);
  final String pathInJar = StringUtil.trimStart(myPathInJar, "/");
  if (pathInJar.length() == 0) {
    return Collections.singletonList(creator.createExtractedDirectoryInstruction(jarPath));
  }

  final String archiveName = PathUtil.getFileName(myFilePath);
  final String tempDirProperty = generationContext.createNewTempFileProperty("temp.unpacked.path." + archiveName, archiveName);
  final String tempDirPath = BuildProperties.propertyRef(tempDirProperty);
  generationContext.runBeforeCurrentArtifact(new Mkdir(tempDirPath));

  final Unzip unzip = new Unzip(jarPath, tempDirPath);
  final PatternSet patterns = new PatternSet(null);
  patterns.add(new Include(pathInJar + "**"));
  unzip.add(patterns);
  generationContext.runBeforeCurrentArtifact(unzip);

  return Collections.singletonList(creator.createDirectoryContentCopyInstruction(tempDirPath + "/" + pathInJar));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ExtractedDirectoryPackagingElement.java


示例3: computeAntInstructions

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Override
public List<? extends Generator> computeAntInstructions(@NotNull PackagingElementResolvingContext resolvingContext, @NotNull AntCopyInstructionCreator creator,
                                                        @NotNull ArtifactAntGenerationContext generationContext,
                                                        @NotNull ArtifactType artifactType) {
  final String tempJarProperty = generationContext.createNewTempFileProperty("temp.jar.path." + myArchiveFileName, myArchiveFileName);
  String jarPath = BuildProperties.propertyRef(tempJarProperty);
  final Tag jar;
  if (myArchiveFileName.endsWith(".jar")) {
    jar = new Jar(jarPath, "preserve", true);
  }
  else {
    jar = new Zip(jarPath);
  }
  for (Generator generator : computeChildrenGenerators(resolvingContext, new ArchiveAntCopyInstructionCreator(""), generationContext, artifactType)) {
    jar.add(generator);
  }
  generationContext.runBeforeCurrentArtifact(jar);
  return Collections.singletonList(creator.createFileCopyInstruction(jarPath, myArchiveFileName));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ArchivePackagingElement.java


示例4: findLibrary

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Nullable
public Library findLibrary(@NotNull PackagingElementResolvingContext context) {
  if (myModuleName == null) {
    return context.findLibrary(myLevel, myLibraryName);
  }
  final ModulesProvider modulesProvider = context.getModulesProvider();
  final Module module = modulesProvider.getModule(myModuleName);
  if (module != null) {
    for (OrderEntry entry : modulesProvider.getRootModel(module).getOrderEntries()) {
      if (entry instanceof LibraryOrderEntry) {
        final LibraryOrderEntry libraryEntry = (LibraryOrderEntry)entry;
        if (libraryEntry.isModuleLevel()) {
          final String libraryName = libraryEntry.getLibraryName();
          if (libraryName != null && libraryName.equals(myLibraryName)) {
            return libraryEntry.getLibrary();
          }
        }
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:LibraryPackagingElement.java


示例5: computeFileToArtifactsMap

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
private MultiValuesMap<VirtualFile, Artifact> computeFileToArtifactsMap() {
  final MultiValuesMap<VirtualFile, Artifact> result = new MultiValuesMap<VirtualFile, Artifact>();
  final ArtifactManager artifactManager = ArtifactManager.getInstance(myProject);
  for (final Artifact artifact : artifactManager.getArtifacts()) {
    final PackagingElementResolvingContext context = artifactManager.getResolvingContext();
    ArtifactUtil.processPackagingElements(artifact, null, new PackagingElementProcessor<PackagingElement<?>>() {
      @Override
      public boolean process(@NotNull PackagingElement<?> element, @NotNull PackagingElementPath path) {
        if (element instanceof FileOrDirectoryCopyPackagingElement<?>) {
          final VirtualFile root = ((FileOrDirectoryCopyPackagingElement)element).findFile();
          if (root != null) {
            result.put(root, artifact);
          }
        }
        else if (element instanceof ModuleOutputPackagingElement) {
          for (VirtualFile sourceRoot : ((ModuleOutputPackagingElement)element).getSourceRoots(context)) {
            result.put(sourceRoot, artifact);
          }
        }
        return true;
      }
    }, context, true);
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ArtifactBySourceFileFinderImpl.java


示例6: setupModulesCombobox

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
private void setupModulesCombobox(PackagingElementResolvingContext context) {
  final Module[] modules = context.getModulesProvider().getModules().clone();
  Arrays.sort(modules, ModulesAlphaComparator.INSTANCE);
  if (modules.length > 1) {
    myModuleComboBox.addItem(null);
  }
  for (Module module : modules) {
    myModuleComboBox.addItem(module);
  }
  myModuleComboBox.setRenderer(new ModuleListRenderer(myModuleComboBox));
  new ComboboxSpeedSearch(myModuleComboBox) {
    @Override
    protected String getElementText(Object element) {
      return element instanceof Module ? ((Module)element).getName() : "";
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JarArtifactFromModulesDialog.java


示例7: collectIncludedArtifacts

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
private static void collectIncludedArtifacts(Artifact artifact, final PackagingElementResolvingContext context,
                                             final Set<Artifact> processed, final Set<Artifact> result, final boolean withOutputPathOnly) {
  if (!processed.add(artifact)) {
    return;
  }
  if (!withOutputPathOnly || !StringUtil.isEmpty(artifact.getOutputPath())) {
    result.add(artifact);
  }

  ArtifactUtil.processPackagingElements(artifact, ArtifactElementType.ARTIFACT_ELEMENT_TYPE, new Processor<ArtifactPackagingElement>() {
      @Override
      public boolean process(ArtifactPackagingElement element) {
        Artifact included = element.findArtifact(context);
        if (included != null) {
          collectIncludedArtifacts(included, context, processed, result, withOutputPathOnly);
        }
        return true;
      }
    }, context, false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ArtifactCompileScope.java


示例8: getNewArtifactTemplates

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@NotNull
@Override
public List<? extends ArtifactTemplate> getNewArtifactTemplates(@NotNull PackagingElementResolvingContext context) {
  final List<AndroidFacet> facets = new ArrayList<AndroidFacet>();

  for (Module module : context.getModulesProvider().getModules()) {
    final FacetModel facetModel = context.getModulesProvider().getFacetModel(module);
    final AndroidFacet facet = facetModel.getFacetByType(AndroidFacet.ID);

    if (facet != null && !facet.isLibraryProject()) {
      facets.add(facet);
    }
  }

  if (facets.size() == 0) {
    return Collections.emptyList();
  }
  return Collections.singletonList(new MyTemplate(context.getProject(), facets));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AndroidApplicationArtifactType.java


示例9: getSourceRoots

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@NotNull
@Override
public Collection<VirtualFile> getSourceRoots(PackagingElementResolvingContext context) {
  Module module = findModule(context);
  if (module == null) return Collections.emptyList();

  List<VirtualFile> roots = new SmartList<VirtualFile>();
  ModuleRootModel rootModel = context.getModulesProvider().getRootModel(module);
  for (ContentEntry entry : rootModel.getContentEntries()) {
    for (SourceFolder folder : entry.getSourceFolders()) {
      if (folder.isTestSource()) {
        ContainerUtil.addIfNotNull(folder.getFile(), roots);
      }
    }
  }
  return roots;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:TestModuleOutputPackagingElement.java


示例10: getIn

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Override
public Iterator<String> getIn(String name) {
  final Set<String> included = new LinkedHashSet<String>();
  final PackagingElementResolvingContext context = myArtifactManager.getResolvingContext();
  final Artifact artifact = context.getArtifactModel().findArtifact(name);
  if (artifact != null) {
    ArtifactUtil.processPackagingElements(artifact, ArtifactElementType.ARTIFACT_ELEMENT_TYPE, new PackagingElementProcessor<ArtifactPackagingElement>() {
      @Override
      public boolean process(@NotNull ArtifactPackagingElement element,
                             @NotNull PackagingElementPath path) {
        final String artifactName = element.getArtifactName();
        if (myArtifactNames.contains(artifactName)) {
          included.add(artifactName);
        }
        return true;
      }
    }, context, false);
  }
  return included.iterator();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:ArtifactSortingUtilImpl.java


示例11: computeIncrementalCompilerInstructions

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Override
public void computeIncrementalCompilerInstructions(@NotNull IncrementalCompilerInstructionCreator creator,
		@NotNull PackagingElementResolvingContext resolvingContext,
		@NotNull ArtifactIncrementalCompilerContext compilerContext,
		@NotNull ArtifactType artifactType)
{
	Module module = findModule(resolvingContext);
	if(module != null)
	{
		VirtualFile[] virtualFiles = ModuleRootManager.getInstance(module).getContentFolderFiles(ContentFolderScopes.of(myContentFolderType));

		for(VirtualFile virtualFile : virtualFiles)
		{
			creator.addDirectoryCopyInstructions(virtualFile, null);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-javaee,代码行数:18,代码来源:WebResourceModuleOutputPackagingElement.java


示例12: findLibrary

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Nullable
public Library findLibrary(@Nonnull PackagingElementResolvingContext context) {
  if (myModuleName == null) {
    return context.findLibrary(myLevel, myLibraryName);
  }
  final ModulesProvider modulesProvider = context.getModulesProvider();
  final Module module = modulesProvider.getModule(myModuleName);
  if (module != null) {
    for (OrderEntry entry : modulesProvider.getRootModel(module).getOrderEntries()) {
      if (entry instanceof LibraryOrderEntry) {
        final LibraryOrderEntry libraryEntry = (LibraryOrderEntry)entry;
        if (libraryEntry.isModuleLevel()) {
          final String libraryName = libraryEntry.getLibraryName();
          if (libraryName != null && libraryName.equals(myLibraryName)) {
            return libraryEntry.getLibrary();
          }
        }
      }
    }
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:LibraryPackagingElement.java


示例13: computeFileToArtifactsMap

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
private MultiValuesMap<VirtualFile, Artifact> computeFileToArtifactsMap() {
  final MultiValuesMap<VirtualFile, Artifact> result = new MultiValuesMap<VirtualFile, Artifact>();
  final ArtifactManager artifactManager = ArtifactManager.getInstance(myProject);
  for (final Artifact artifact : artifactManager.getArtifacts()) {
    final PackagingElementResolvingContext context = artifactManager.getResolvingContext();
    ArtifactUtil.processPackagingElements(artifact, null, new PackagingElementProcessor<PackagingElement<?>>() {
      @Override
      public boolean process(@Nonnull PackagingElement<?> element, @Nonnull PackagingElementPath path) {
        if (element instanceof FileOrDirectoryCopyPackagingElement<?>) {
          final VirtualFile root = ((FileOrDirectoryCopyPackagingElement)element).findFile();
          if (root != null) {
            result.put(root, artifact);
          }
        }
        else if (element instanceof ModuleOutputPackagingElement) {
          for (VirtualFile sourceRoot : ((ModuleOutputPackagingElement)element).getSourceRoots(context)) {
            result.put(sourceRoot, artifact);
          }
        }
        return true;
      }
    }, context, true);
  }
  return result;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:ArtifactBySourceFileFinderImpl.java


示例14: getIn

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Override
public Iterator<String> getIn(String name) {
  final Set<String> included = new LinkedHashSet<String>();
  final PackagingElementResolvingContext context = myArtifactManager.getResolvingContext();
  final Artifact artifact = context.getArtifactModel().findArtifact(name);
  if (artifact != null) {
    ArtifactUtil.processPackagingElements(artifact, ArtifactElementType.getInstance(), new PackagingElementProcessor<ArtifactPackagingElement>() {
      @Override
      public boolean process(@Nonnull ArtifactPackagingElement element,
                             @Nonnull PackagingElementPath path) {
        final String artifactName = element.getArtifactName();
        if (myArtifactNames.contains(artifactName)) {
          included.add(artifactName);
        }
        return true;
      }
    }, context, false);
  }
  return included.iterator();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:ArtifactSortingUtilImpl.java


示例15: collectIncludedArtifacts

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
private static void collectIncludedArtifacts(Artifact artifact, final PackagingElementResolvingContext context,
                                             final Set<Artifact> processed, final Set<Artifact> result, final boolean withOutputPathOnly) {
  if (!processed.add(artifact)) {
    return;
  }
  if (!withOutputPathOnly || !StringUtil.isEmpty(artifact.getOutputPath())) {
    result.add(artifact);
  }

  ArtifactUtil.processPackagingElements(artifact, ArtifactElementType.getInstance(), new Processor<ArtifactPackagingElement>() {
    @Override
    public boolean process(ArtifactPackagingElement element) {
      Artifact included = element.findArtifact(context);
      if (included != null) {
        collectIncludedArtifacts(included, context, processed, result, withOutputPathOnly);
      }
      return true;
    }
  }, context, false);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:ArtifactCompileScope.java


示例16: getManifestFile

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Nullable
public ManifestFileConfiguration getManifestFile(CompositePackagingElement<?> element, ArtifactType artifactType,
		final PackagingElementResolvingContext context)
{
	final VirtualFile manifestFile = ManifestFileUtil.findManifestFile(element, context, artifactType);
	if(manifestFile == null)
	{
		return null;
	}

	ManifestFileConfiguration configuration = myManifestFiles.get(manifestFile);
	if(configuration == null)
	{
		configuration = ManifestFileUtil.createManifestFileConfiguration(manifestFile);
		myOriginalManifestFiles.put(manifestFile, new ManifestFileConfiguration(configuration));
		myManifestFiles.put(manifestFile, configuration);
	}
	return configuration;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:20,代码来源:ManifestFilesInfo.java


示例17: setupModulesCombobox

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
private void setupModulesCombobox(PackagingElementResolvingContext context)
{
	final Module[] modules = context.getModulesProvider().getModules().clone();
	Arrays.sort(modules, ModulesAlphaComparator.INSTANCE);
	if(modules.length > 1)
	{
		myModuleComboBox.addItem(null);
	}
	for(Module module : modules)
	{
		myModuleComboBox.addItem(module);
	}
	myModuleComboBox.setRenderer(new ModuleListRenderer(myModuleComboBox));
	new ComboboxSpeedSearch(myModuleComboBox)
	{
		@Override
		protected String getElementText(Object element)
		{
			return element instanceof Module ? ((Module) element).getName() : "";
		}
	};
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:JarArtifactFromModulesDialog.java


示例18: computeAntInstructions

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Override
public List<? extends Generator> computeAntInstructions(@NotNull PackagingElementResolvingContext resolvingContext, @NotNull AntCopyInstructionCreator creator,
                                                        @NotNull ArtifactAntGenerationContext generationContext,
                                                        @NotNull ArtifactType artifactType) {

  final List<Generator> children = new ArrayList<Generator>();
  final Generator command = creator.createSubFolderCommand(myDirectoryName);
  if (command != null) {
    children.add(command);
  }
  children.addAll(computeChildrenGenerators(resolvingContext, creator.subFolder(myDirectoryName), generationContext, artifactType));
  return children;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:DirectoryPackagingElement.java


示例19: computeAntInstructions

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@Override
public List<? extends Generator> computeAntInstructions(@NotNull PackagingElementResolvingContext resolvingContext,
                                                        @NotNull AntCopyInstructionCreator creator,
                                                        @NotNull ArtifactAntGenerationContext generationContext,
                                                        @NotNull ArtifactType artifactType) {
  final String path = generationContext.getSubstitutedPath(myFilePath);
  return Collections.singletonList(creator.createDirectoryContentCopyInstruction(path));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:DirectoryCopyPackagingElement.java


示例20: getSourceRoots

import com.intellij.packaging.elements.PackagingElementResolvingContext; //导入依赖的package包/类
@NotNull
@Override
public Collection<VirtualFile> getSourceRoots(PackagingElementResolvingContext context) {
  Module module = findModule(context);
  if (module == null) return Collections.emptyList();

  return context.getModulesProvider().getRootModel(module).getSourceRoots(JavaModuleSourceRootTypes.TESTS);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:TestModuleOutputPackagingElement.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DormandPrince853Integrator类代码示例发布时间:2022-05-23
下一篇:
Java Member类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap