Community
Participate
Working Groups
This request has been made at least a couple of times on newsgroups; it is most commonly encountered using version control, but is not a version control problem. One can exclude certain files from inclusion in a jar, can hide certain files associated with version control from the UI, and can prevent resources from being copied into the build tree. However, it is not possible to prevent .java files from being built. This is sometimes required. Ant permits it (several different means to specify). Using eclipse with an existing project that relies upon an exclusion facility (such as ant or IntelliJ's IDEA) is quite difficult. The typical workaround is to delete (outside of version control) the files and directories that cause problems. They reappear when the version control system refreshes. Other workarounds are even more baroque (I helped build a script to populate a tree of symlinks ... not the ideal solution). Please consider adding an "exclude" button to the UI for sourcepath, and adding an internal storage, and comprehension of what it means to exclude to core.
Would such excluded files be excluded from building only, or not available completely (search, code assist, package view, etc...).
I'd say that minimal functionality for the feature would be to suppress building only. If the information was supplied to the plugins, then they might allow further customization (hide it if it won't be compiled). This might be permitted in the package view as an option, or possibly an icon decoration in the tree. Note that if it isn't compiled, then it can't *contribute* to code completion. I don't see why code completion (of other defined interfaces and such) inside the editor, when the file is open, would be suppressed.
What you mean is that these files would not be treated as compilation units but rather as resource files. This means, they would not get compiled, indexed for search and presented in the package view (except as non-java resources). At least this story would be consistent. You can experiment this minimalistic behavior by copying a java file outside the classpath. You can still open it in a Java editor and perform some Java actions on it, but with minimal support of course.
*** Bug 22409 has been marked as a duplicate of this bug. ***
*** Bug 24583 has been marked as a duplicate of this bug. ***
*** Bug 24127 has been marked as a duplicate of this bug. ***
Exclusion filters got added to source folder, providing this ability. UI for it is on its way (for 2.1M4). Fixed.
Verified.