From b5200186eb839dfe23f2cf5f30b66e96356d2083 Mon Sep 17 00:00:00 2001 From: nik Date: Tue, 9 Apr 2013 10:40:53 +0400 Subject: [PATCH] decoupling Google AppEngine facet from Web facet --- .../impl/artifacts/ArtifactUtil.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactUtil.java b/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactUtil.java index 3b71293ec025..16bfde6ad6a6 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactUtil.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactUtil.java @@ -564,6 +564,32 @@ public class ArtifactUtil { return modules; } + public static Collection getArtifactsContainingModuleOutput(@NotNull final Module module) { + ArtifactManager artifactManager = ArtifactManager.getInstance(module.getProject()); + final PackagingElementResolvingContext context = artifactManager.getResolvingContext(); + final Set result = new HashSet(); + Processor> processor = new Processor>() { + @Override + public boolean process(@NotNull PackagingElement element) { + if (element instanceof ProductionModuleOutputPackagingElement + && module.equals(((ProductionModuleOutputPackagingElement)element).findModule(context))) { + return false; + } + if (element instanceof ArtifactPackagingElement && result.contains(((ArtifactPackagingElement)element).findArtifact(context))) { + return false; + } + return true; + } + }; + for (Artifact artifact : artifactManager.getSortedArtifacts()) { + boolean contains = !processPackagingElements(artifact, null, processor, context, true); + if (contains) { + result.add(artifact); + } + } + return result; + } + public static List getArtifactWithOutputPaths(Project project) { final List result = new ArrayList(); for (Artifact artifact : ArtifactManager.getInstance(project).getSortedArtifacts()) {