1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

Bug 487536 - Binary container does not recognize binaries if output

folder is not in the project root

Change-Id: I5cde939f7c31b9df8fb2b41a5a5a9e33ccd45260
This commit is contained in:
Alena Laskavaia 2016-02-09 14:06:01 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent 44599764f0
commit 15436d74df

View file

@ -528,6 +528,30 @@ public class CProject extends Openable implements ICProject {
return outputs; 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 @Override
public boolean isOnOutputEntry(IResource resource) { public boolean isOnOutputEntry(IResource resource) {
IPath path = resource.getFullPath(); 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 // 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 // Also make sure I'm not a source root since my SourceRoot object would
// have already added this. // have already added this.
if (!found && isOnOutputEntry(child) && !projectIsSourceRoot) if (!found && !projectIsSourceRoot && (isParentOfOutputEntry(child) || isOnOutputEntry(child)))
children.add(new CContainer(this, child)); children.add(new CContainer(this, child));
} }
} }