decoupling Google AppEngine facet from Web facet

This commit is contained in:
nik
2013-04-09 10:40:53 +04:00
parent da8d65fd11
commit b5200186eb
@@ -564,6 +564,32 @@ public class ArtifactUtil {
return modules;
}
public static Collection<Artifact> getArtifactsContainingModuleOutput(@NotNull final Module module) {
ArtifactManager artifactManager = ArtifactManager.getInstance(module.getProject());
final PackagingElementResolvingContext context = artifactManager.getResolvingContext();
final Set<Artifact> result = new HashSet<Artifact>();
Processor<PackagingElement<?>> processor = new Processor<PackagingElement<?>>() {
@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<Artifact> getArtifactWithOutputPaths(Project project) {
final List<Artifact> result = new ArrayList<Artifact>();
for (Artifact artifact : ArtifactManager.getInstance(project).getSortedArtifacts()) {