From 15436d74df437bc2942450a3cce328ebb91e5119 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 9 Feb 2016 14:06:01 -0500 Subject: [PATCH] Bug 487536 - Binary container does not recognize binaries if output folder is not in the project root Change-Id: I5cde939f7c31b9df8fb2b41a5a5a9e33ccd45260 --- .../cdt/internal/core/model/CProject.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java index 9c70fd71ec8..55884e031f6 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java @@ -528,6 +528,30 @@ public class CProject extends Openable implements ICProject { return outputs; } + + private boolean isParentOfOutputEntry(IResource resource) { + IPath path = resource.getFullPath(); + + // ensure that folders are only excluded if all of their children are excluded + if (resource.getType() == IResource.FOLDER || resource.getType() == IResource.PROJECT) { + try { + IOutputEntry[] entries = getOutputEntries(); + for (IOutputEntry entry : entries) { + + if (path.isPrefixOf(entry.getPath())) { + return true; + } + } + } catch (CModelException e) { + // + } + return false; + } + + return false; + + } + @Override public boolean isOnOutputEntry(IResource resource) { IPath path = resource.getFullPath(); @@ -630,7 +654,7 @@ public class CProject extends Openable implements ICProject { // Not in source folder, check if it's a container on output entry // Also make sure I'm not a source root since my SourceRoot object would // have already added this. - if (!found && isOnOutputEntry(child) && !projectIsSourceRoot) + if (!found && !projectIsSourceRoot && (isParentOfOutputEntry(child) || isOnOutputEntry(child))) children.add(new CContainer(this, child)); } }