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

Bug 120210

Summary: [workspace] Build Path Exclusion Filter not applied
Product: [Eclipse Project] PDE Reporter: Mo Nours Arab <monours_arab>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, erik, mark.melvin
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Mo Nours Arab CLA 2005-12-09 20:26:11 EST
Given a hierarchy of
project
 src
   a.b.c
   a.b.c.d
   a.b.c.e
   a.b.c.f

Attempting to exclude any file or set of files from one of the packages doesn't end up effecting file.jar.  file.jar is set to use 'src' as it source folder in the Build tab (build.properties), but it does not apply the exclusion list as set in Project->Properities->Java Build Path->Source, where a/b/c/d/file1.txt may be excluded.
Other info which may or may not be useful, in the Build tab (build.properties), src folder is not checked in either Binary Build nor Source Build...

Project->Properties->Java Compiler->Building does have "Enable use of exlusion patterns in source folders" enabled
Is there something one can do in Build tab to enforce things?
What could possiblt be overriding the exclusion?
Comment 1 Pascal Rapicault CLA 2006-01-10 11:36:21 EST
The exclusion filters specified in the Project->Properities->Java Build Path are not used by the plug-in export. The value would have to be duplicated in the build.properties.
Comment 2 Mark Melvin CLA 2006-01-10 11:52:12 EST
I'll bite...  How would I do that in build.properies? ;o)
Comment 3 Pascal Rapicault CLA 2006-01-10 12:53:05 EST
*** Bug 104156 has been marked as a duplicate of this bug. ***
Comment 4 Pascal Rapicault CLA 2006-01-10 14:57:42 EST
This is not implemented.

You would have to patch ModelBuildScriptGenerator to read the exclusion list from the build.properties and generate the appropriate exclusion filter when generating 
the javac call.
A comma separated list of the excluded file should be good enough.

Marking as 3.2 in case Mark provides the patch :)
Comment 5 Mark Melvin CLA 2006-01-11 10:25:38 EST
Hmm...I'd love to take a crack at a patch.  I'll post it if I do.
Comment 6 Mark Melvin CLA 2006-01-11 21:56:48 EST
Actually, it looks like it *is* implemented now that I have grokked the source.  Let's say my plugin's jar file is called "plugin.jar".  So, my build.properties looks something like this:

source.plugin.jar = src/
output.plugin.jar = bin/
bin.includes = plugin.xml,\
               META-INF/,\
               plugin.jar,\
               plugin.properties

Basically we just wanted to exclude a couple files in our src folder from the final jar.  As it turns out, all I had to do was simply add the following to build.properties:

exclude.plugin.jar = com/my/company/pkg/file1,\
                     com/my/company/pkg/file2

And they are properly excluded from the final jar file.  So it looks like I don't need to come up with a patch after all.  I think we could close this bug.
Comment 7 Pascal Rapicault CLA 2006-01-12 09:45:26 EST
The result looks the same but how you get there is different:
 - The exclusion filter specified in the build path excludes files from the compilation, so the files are never given to the compiler
 - The excludes.<jarName> will cause all the code to be compiled but the resulting jar to not be copied.

So I think we should not close it now.
Comment 8 Jeff McAffer CLA 2006-04-24 14:44:30 EDT
deferring to 3.3
Comment 9 Pascal Rapicault CLA 2007-03-29 22:19:48 EDT
No plan to address that for 3.3
Comment 10 Andrew Niefer CLA 2009-09-14 16:34:09 EDT

*** This bug has been marked as a duplicate of bug 105631 ***