Bug 294573 - Better auto-detect source folders (when adding Java facet to project)
Summary: Better auto-detect source folders (when adding Java facet to project)
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-09 03:57 EST by Darryl Miles CLA
Modified: 2009-11-09 03:57 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 Darryl Miles CLA 2009-11-09 03:57:23 EST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-GB; rv:1.8.1.23) Gecko/20090823 SeaMonkey/1.1.18
Build Identifier: 

Auto-detection should work when no existing "source folder" configuration exists, this includes a "null config", i.e. a configuration that contains an element to stay "I am configured and I have no source folders".

At the moment a folder "src" is taken to be the top level source folder, however some other IDEs use a strcture like "src/main/java" and "src/test/java" and "src/resources".


What is being requested in this feature request is that the auto-detection process attempts to open the *.java files present in the project to examine the "package" statement and then guess the correct top level source folder.

It can then skip that tree and search for more *.java (outside of that source root).


The action of the current facet creation also creates a META-INF/MANIFEST.MF in the one and only source folder.  It should not do this (if the source folder root already existed before the facet was added).  The creation of a default META-INF/MANIFEST.MF should only be done for new project creation wizards not when adding the facet to an exiting project. (i.e. when the source root folder did not exist before the facet was added, i.e. the wizard process created the folder "/src" itself)

This would be especially problematic if multiple source folders were auto-detected, i.e. we don't want a META-INF/MANIFEST.MF created in them all.



The "src/test/resouces" and "src/main/resources" situations would need a special rule that could treat "src/**/resources" path matching, since this is not specific (like the above *.java) detection then maybe requires review to confirm.

Reproducible: Always