Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 488885

Summary: [1.9] Trigger a full build when module-info.java has changed
Product: [Eclipse Project] JDT Reporter: Jay Arthanareeswaran <jarthana>
Component: CoreAssignee: Jay Arthanareeswaran <jarthana>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: pbenedict
Version: 4.5.1   
Target Milestone: BETA J9   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Jay Arthanareeswaran CLA 2016-03-02 12:56:39 EST
Just like classpath change, change in module information should trigger full build of the current project and dependent projects if any. At the moment, only the modified module-info.java is compiled by the incremental compiler.

I have a patch that triggers build on any content change of the module-info. But clearly this needs improvement. A complete fix should identify the elements of the module that affect the compilation of the build and trigger the build accordingly - most probably these would be 'exports' and 'requires'.
Comment 1 Jay Arthanareeswaran CLA 2016-03-03 01:22:30 EST
A first cut fix is released here with relevant tests.

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA9&id=a54886812b7dc23c212e40cce3ea10b5dc5e1c5e

One of the new tests is disabled because of a known issue. Here are the known issues:
1. The fix doesn't look at the things that are changed in the module-info. Any content change (other than encoding change etc.) will trigger the build.
2. When a "requires java.base" is added or removed, a build is triggered. This should not happen. At the moment, the equals() method of IModule implementations simply call Arrays.equals() on requires. But we should find a way to leave java.base out of the equation.
Comment 2 Paul Benedict CLA 2016-03-03 15:51:53 EST
How is this going to interact with tooling? Theoretically, maybe in the future, module-info.java could be generated from a tool like Maven. In that kind of scenario, this feature would clash because a build would be triggered on the wrong kind of change.
Comment 3 Jay Arthanareeswaran CLA 2016-03-04 00:10:33 EST
(In reply to Paul Benedict from comment #2)
> How is this going to interact with tooling? Theoretically, maybe in the
> future, module-info.java could be generated from a tool like Maven. In that
> kind of scenario, this feature would clash because a build would be
> triggered on the wrong kind of change.

I don't know what you mean by wrong kind of change. What I have released is a stop gap fix. A full fix should trigger the build only if it is absolutely required.
Comment 4 Eclipse Genie CLA 2020-04-29 10:14:11 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.