Bug 45988 - Allow Inclusion filters for java output folders
Summary: Allow Inclusion filters for java output folders
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-03 15:52 EST by Sachin Patel CLA
Modified: 2003-11-07 15:39 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sachin Patel CLA 2003-11-03 15:52:34 EST
Provide a way to state that only .java files should be processed into the
output folder of a java project.  For example if I have a java project in 
which I have the root of the project as a source folder ("project/") and my 
output folder is ("project/bin"), only class files should be placed into bin.
Otherwise all other resources are copied into bin, and there needs to be a way 
to exclude all other resources. An inclusion filter of ".class" on my ouput 
folder would only allow .class files to be placed in bin.
Comment 1 Philipe Mulet CLA 2003-11-06 18:14:02 EST
Can't you simply exclude these resources from copy behavior ? 
see: Preferences>Java>Compiler>Build Path>Filtered Resource

alternatively, you could put your resources inside a separate library folder, 
which you could add on your build path, only source folder contents gets into 
the output folder.

Ok to close?
Comment 2 Sachin Patel CLA 2003-11-06 18:59:23 EST
I cannot use the filter resources in build path, because the list of resources
that I don't want in the output folder is infinate.  The only resources I want 
in the output folder are compiled java source.  I cannot use library, because
I need the root of the project to be the place where I drop in resources.  This
is why I still thing we need this option.  If not exclusion filters, how about
a single prefrence that states only include compiled resources in the output 
folder?
Comment 3 Philipe Mulet CLA 2003-11-07 05:06:40 EST
Did you try to exclude '*.*' ? We do not consider Java/Class files as 
resources, this should do the trick.
Comment 4 Sachin Patel CLA 2003-11-07 08:59:36 EST
I set * and *.* as exclustion filters and it works only when I drop in 
resources into the project. However if I use the Create new Class File Wizard 
to create a new class, and type in the name field, I always get the warning at 
the top "Folder is not on the Java build class path".  If I hit finish, the 
wizard fails and a dialog box states: 

Creation of element failed.
Reason: Blah.java [in <default> [in <project root> [in test]]] does not exist.

Is this a bug?

So to summerize using *.*, * as exclusion filters works since dropping in java 
source still puts the class file into bin, however creation of a Java Class 
using the wizard fails.
Comment 5 Philipe Mulet CLA 2003-11-07 09:31:12 EST
Did you exclude from the build path setting (using the source folder 
property) ? Or rather using Preferences>Java>Compiler>Build Path>Filtered 
Resource ?
Comment 6 Sachin Patel CLA 2003-11-07 10:17:28 EST
I did not use Preferences>Java>Compiler>Build Path>Filtered Resource becuase I 
only want to apply this case to a single java project.  So I used the exclusion 
filter on the build properties on the java project.
Comment 7 Philipe Mulet CLA 2003-11-07 11:44:15 EST
You can customize Java compiler preferences on a per project basis, under 
project properties.

This is the only way to get the behavior you want. A classpath exclusion rule 
isn't going to help you, as it would exclude source files as well.
We will add inclusion rules instead of exclusion ones for the source folders, 
then you may simply want to use it so as to only include *.java files. For now, 
the other preference is your only hope.

Ok to close?
Comment 8 Sachin Patel CLA 2003-11-07 13:20:09 EST
Ok I see what you are saying, before we close, is there a way to set Filtered 
Resources in the Build Path tab programatically?
Comment 9 Sachin Patel CLA 2003-11-07 14:25:27 EST
Thanks for your help, we got in working programatically.  Ok to close.
Comment 10 Philipe Mulet CLA 2003-11-07 15:39:45 EST
Glad you found it (using IJavaProject#setOption(...)) I presume.