Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 72078

Summary: Project source excludes does not work
Product: [Tools] CDT Reporter: Vaidotas Radžius <vradzius>
Component: cdt-coreAssignee: Alain Magloire <alain>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2    
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on:    
Bug Blocks: 72435    
Attachments:
Description Flags
Second problem screenshot none

Description Vaidotas Radžius CLA 2004-08-17 04:19:26 EDT
Enviroment:
WinXP Pro
Eclipse 3.0 + CDT 2.0 build 20040816
Using standard make project.

Steps to reproduce:
1. create project structure:
\Project
|
-Includes
|
-Release
|--TempInc
-Source
2. add some *.cpp files to TempInc folder.
3. Also there is a project files in Includes there is some *.h files and in 
Source folder there is some *.cpp files.
4. Goto Project Property Page: C/C++ Project paths
5. Add exclude for folder TempInc files like **/TempInc/*.* or like 
Release/TempInc/*.*
6. Close and reopen project to start indexer.

Problem:
1.Look at the indexer problems list and you find out that files under TempInc 
folder was indexed. 
2. Also you find that in the C/C++ Project tree view those files are shown. 
3. Also there is another problem that when you add the same project folder 
another time to C/C++ Project paths. The contents of project in C/C++ Projects 
tree view gets dublicated. You can find to the same folder with the same files 
twice or maybe more, but on the file system and in navigator view there is only 
one.
Comment 1 Alain Magloire CLA 2004-08-23 11:03:01 EDT
> Problem:
> 1.Look at the indexer problems list and you find out that files under 
> TempInc folder was indexed.

This is an indexer problem, it does not look at the exclutions pattern
and just recursively go through.

So let's make a new PR, to track this particular problem of the
indexer(bogdan this is for you) :

https://bugs.eclipse.org/bugs/show_bug.cgi?id=72435

> 2. Also you find that in the C/C++ Project tree view those files are shown.

Yes they are, look closely the icon is different(icon for non-c-resources).
You can filter them out by checking the filter "do not show non-c-resources"
See "filters" drop down on the C/C++ Project  view.
The idea here is that folks were confuse when they did not see the files, say
Readme, log.txt etc ... so by default the files are visible.

> 3. Also there is another problem that when you add the same project folder 
> another time to C/C++ Project paths. The contents of project in C/C++ 
> Projects 
> tree view gets dublicated. You can find to the same folder with the same 
> files 
> twice or maybe more, but on the file system and in navigator view there is > 
> only  one.

Sorry, you have lost me on this one.  How did you manage to add a second
time the project as a source folder, give me more info on this particular
problem, as I do not follow.

Comment 2 Alain Magloire CLA 2004-08-23 11:03:29 EDT
to me!!
Comment 3 Vaidotas Radžius CLA 2004-08-23 11:20:13 EDT
3. Problem I found by directly editing .cdtproject file.
I do this way, because this is faster way to add includes, definitions and 
excludes. By copy->paste from another project.
Example: <pathentry excluding="Release/TempInc/*.*" kind="src" path=""/>
Paste it to the newly created .cdtproject file.
Comment 4 Vaidotas Radžius CLA 2004-08-23 11:37:51 EDT
Created attachment 14122 [details]
Second problem screenshot

As You see from the screen shot I add here. my excluded source files are shown
here thought i exclude them from my project in C/C++ project properties window.
Comment 5 Alain Magloire CLA 2004-08-23 17:03:45 EDT
> 3. Problem I found by directly editing .cdtproject file.
> I do this way, because this is faster way to add includes, definitions and 
> excludes. By copy->paste from another project.
> Example: <pathentry excluding="Release/TempInc/*.*" kind="src" path=""/>
> Paste it to the newly created .cdtproject file.

If you do that no checking is done.  So you propably have two source entries
probably something like this.

<pathentry excluding="Release/TempInc/*.*" kind="src" path=""/>
<pathentry  kind="src" path=""/>

Basically duplications of pathentries.

Lets accept the bug because the Core Model should probably
ignore this error for certain entries like Source folder and 
the output entries.

On the TODO list.  Meanwhile check again your .cdtproject for such duplications
Comment 6 Alain Magloire CLA 2004-08-24 14:34:49 EDT
> <pathentry excluding="Release/TempInc/*.*" kind="src" path=""/>
> <pathentry  kind="src" path=""/>
> 
> Basically duplications of pathentries.

In the head I've put some code to detect the duplication and issue
a warning.  Only __one__ of the source entries will be taken removing
the duplication.  It will be up to the user to fix the corrupted ".cdtproject"

Fix in the head.