Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 520307 - Handle module-info file in PDE project
Summary: Handle module-info file in PDE project
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.8   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.7.1a   Edit
Assignee: Vikas Chandra CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 525652 (view as bug list)
Depends on:
Blocks: 458235
  Show dependency tree
 
Reported: 2017-07-28 08:29 EDT by Vikas Chandra CLA
Modified: 2017-10-12 02:56 EDT (History)
2 users (show)

See Also:


Attachments
tentative quickfix (5.74 KB, patch)
2017-09-23 15:33 EDT, Vikas Chandra CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vikas Chandra CLA 2017-07-28 08:29:40 EDT
PDE project should be able to support existence of module-info file in the project. There should be a way to either work with PDE manifest file or module-info file via an option ( ? ).
Comment 1 Vikas Chandra CLA 2017-09-19 11:24:57 EDT
One way could be show an error marker in module-info file in a PDE project. In quick-fix, there can be an option to remove module-info file from build path.
Comment 2 Eclipse Genie CLA 2017-09-23 13:24:48 EDT
New Gerrit change created: https://git.eclipse.org/r/105658
Comment 3 Vikas Chandra CLA 2017-09-23 13:28:41 EDT
The gerrit in previous comment removes "Create module-option.java" in PDE project.
Comment 4 Eclipse Genie CLA 2017-09-23 15:18:55 EDT
New Gerrit change created: https://git.eclipse.org/r/105659
Comment 5 Vikas Chandra CLA 2017-09-23 15:33:14 EDT
Created attachment 270328 [details]
tentative quickfix
Comment 6 Eclipse Genie CLA 2017-09-25 02:55:02 EDT
Gerrit change https://git.eclipse.org/r/105658 was merged to [R4_7_maintenance].
Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=f7c4a4ba416535d63d93974abf4d5f5aae9330fa
Comment 7 Vikas Chandra CLA 2017-09-25 13:49:15 EDT
Till the time module-info.java is handled in pde project and module system of java9 and OSGI system can work together, removing the option is the best option it messes up the workspace.

I will track if java9 modularity+ OSGI can work together via a separate bug.
Comment 8 Vikas Chandra CLA 2017-09-25 13:49:48 EDT
I will abandon the rest of the changes on this bug for the time being.
Comment 9 Vikas Chandra CLA 2017-09-27 06:27:51 EDT
Verified comment#3  in
Version: Oxygen.1a (4.7.1a)
Build id: M20170926-1700
Comment 10 Noopur Gupta CLA 2017-10-06 01:50:00 EDT
*** Bug 525652 has been marked as a duplicate of this bug. ***
Comment 11 Stephan Herrmann CLA 2017-10-06 14:39:45 EDT
(In reply to Noopur Gupta from comment #10)
> *** Bug 525652 has been marked as a duplicate of this bug. ***

Should we reconsider the fix here? While I agree that in an ideal world you need EITHER a manifest OR module-info, but that world hasn't arrived, and thus I don't see a strong reason for hiding the wizard in PDE projects.
Comment 12 Vikas Chandra CLA 2017-10-07 08:17:54 EDT
>>strong reason for hiding the wizard in PDE projects

As of now, creating module-info.java messes up the plugin as a whole and create module info in plugin project creates module-info ( based on plugin project) that looks incorrect. There are alternate ways to add module-info.

Once module-info doesn't mess up the plugin project ( and when there is more support for module-info), we can enable this. What do you think?
Comment 13 Stephan Herrmann CLA 2017-10-10 16:50:27 EDT
(In reply to Vikas Chandra from comment #12)
> >>strong reason for hiding the wizard in PDE projects
> 
> As of now, creating module-info.java messes up the plugin as a whole and
> create module info in plugin project creates module-info ( based on plugin
> project) that looks incorrect.

Can you give an example? Perhaps, you mean problems relating to require plug-ins that don't yet have module-info?

Makes me think: perhaps we should generally give a warning if the wizard finds required classes in an unnamed module? Those will no longer be accessible after adding module-info.java. Or is this handled already?

> There are alternate ways to add module-info.

Which?

Noopur keeps pointing to "Create module-info.java" wizard as the preferred way of creating this files.
Comment 14 Jay Arthanareeswaran CLA 2017-10-11 00:14:13 EDT
(In reply to Stephan Herrmann from comment #13)
> Noopur keeps pointing to "Create module-info.java" wizard as the preferred
> way of creating this files.

(In reply to Vikas Chandra from comment #12)
> There are alternate ways to add module-info.

Are you talking about manually adding the module-info file? The wizard brings lot more than just creating the module-info. It finds and puts all the packages (in exports section) and required modules in the module-info. Probably we can further enhance the wizard to fill up other sections such as provides, uses etc. too. So, no question that the wizard is the preferred way.
Comment 15 Vikas Chandra CLA 2017-10-11 00:38:01 EDT
Create module-info for Hello World plugin projects creates
module P9 {
exports p9.handlers;requires org.eclipse.core.commands.3.9.0.v20170530;
requires org.eclipse.jface.3.13.1.v20170810;
requires org.eclipse.swt.win32.win32.x86.64.3.106.1.v20170829;
requires org.eclipse.ui.workbench.3.110.1.v20170704;
}


This module-info already has lot of syntax errors ( no quick-fixes for those errors) and it does no good and breaks the workspace.

I see a lot of 'Syntax error on tokens, delete this token".

Are you suggesting we should create an empty module-info file for PDE project? If we are to create a module info file, at least it shouldn't have syntax error or have a quickfix for them?
Comment 16 Vikas Chandra CLA 2017-10-11 00:56:02 EDT
>>Can you give an example? 

Create a hello world command plugin project in PDE and then create a module-info ( you can use pre 25th sept java9 build or locally revert comment#6 and try in launched workspace).
Comment 17 Stephan Herrmann CLA 2017-10-11 14:02:34 EDT
(In reply to Vikas Chandra from comment #15)
> Create module-info for Hello World plugin projects creates
> module P9 {
> exports p9.handlers;requires org.eclipse.core.commands.3.9.0.v20170530;
> requires org.eclipse.jface.3.13.1.v20170810;
> requires org.eclipse.swt.win32.win32.x86.64.3.106.1.v20170829;
> requires org.eclipse.ui.workbench.3.110.1.v20170704;
> }
> 
> 
> This module-info already has lot of syntax errors ( no quick-fixes for those
> errors) and it does no good and breaks the workspace.
> 
> I see a lot of 'Syntax error on tokens, delete this token".

All this should go away when bug 525660 is implemented and used :)

For now I see your point.
Comment 18 Vikas Chandra CLA 2017-10-12 02:56:18 EDT
>> bug 525660 is implemented and used 

This is one of the highest priority on my list now. And we will "surely" revisit this issue post that fix.