Bug 487161 - [Import/Export] Import existing projects' dependent projects
Summary: [Import/Export] Import existing projects' dependent projects
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-03 13:33 EST by Raymond Auge CLA
Modified: 2016-02-04 02:27 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Auge CLA 2016-02-03 13:33:08 EST
Given a tree of projects (where the Import existing projects UI is given a directory and finds many eclipse projects in subdirectories)

It would be great when selecting one (or some) of the discovered projects if there was an option to also import dependencies of those from the remaining projects residing in the same discovered list.

This would save lots of time and effort in manually iterating over the missing dependencies from a very large tree of eclipse projects.

In fact, I would be willing to accept the time that would be required to analyse the graph in order to calculate the transitive closure (it certainly would still be faster than the human time required to do it.)
Comment 1 Brian de Alwis CLA 2016-02-03 15:23:37 EST
I suspect you want the importer to be able to recognize the project type (e.g., a PDE plugin project) and use the dependencies as determined by the PDE model.  The existing Import Existing Project wizard can't do it as it doesn't know about PDE or other models.  I wonder if the Smart Import could do it.
Comment 2 Raymond Auge CLA 2016-02-03 16:43:04 EST
(In reply to Brian de Alwis from comment #1)
> I suspect you want the importer to be able to recognize the project type
> (e.g., a PDE plugin project) and use the dependencies as determined by the
> PDE model.  The existing Import Existing Project wizard can't do it as it
> doesn't know about PDE or other models.  I wonder if the Smart Import could
> do it.

You may be right, I don't know.

Are the project references found in .classpath specifically from PDE? Our projects are not PDE projects, they are basic java projects.

	<natures>
		<nature>org.eclipse.jdt.core.javanature</nature>
	</natures>

where the .classpath file simple references other projects as:

	<classpathentry kind="src" path="/frontend-taglib"/>
	<classpathentry kind="src" path="/portal-metatype"/>
Comment 3 Brian de Alwis CLA 2016-02-03 19:37:46 EST
The Platform's importer is independent of JDT (source of the javanature).  It's independent of everything except for Core Resources.  But Mickael's Smart Importer is much more capable, though not yet committed.
Comment 4 Mickael Istria CLA 2016-02-04 02:27:17 EST
Here is the documentation about Smart Import: https://wiki.eclipse.org/E4/UI/Smart_Import . Your feedback on this would be highly welcome Raymond.
The value of Smart Import is more for discovery of non-Eclipse projects. For projects that already have Eclipse metadata (.project) the behavior is almost identical to the "Import existing projects" wizard. So wouldn't be any better in that case.
The relationship between the user story and Smart Import is that both require to perform some specific analysis (read a .classpath for plain JDT, read pom, read Bower file or MANIFEST... for some other projects) BEFORE actually importing content to give additional hints to user (hints would be project locations and types for Smart Import, and project dependencies for this user story). That means that both requires projects that provide natures (JDT, PDE, m2e, JSDT...) to contribute to a generic dependency computation against a set of folders that aren't projects yet. I don't know what's already done on this topic, but it seems like PDE is able to open dependent projects when opening a plugin; so there seems to be some similar logic implemented somewhere.
So there might be some factorization possible, and the Smart Import could also be extended to run a dependency analysis. However it's not in the current scope and the scope shouldn't be changed until bug 472614 is resolved (or it will make merging it more complicated that it already is).

As a workaround, you could import all projects in your IDE, then close them all, then open the project you want and click yes on the pop-up asking you whether to "open dependent projects".