RFR: 8295884: Implement IDE support for Eclipse [v30]

Magnus Ihse Bursie ihse at openjdk.org
Thu Jan 12 13:04:21 UTC 2023


On Wed, 4 Jan 2023 13:06:37 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> Eclipse is a popular and very well-known IDE in the world of Java development, utilized widely in many contexts, by beginners and experienced teams alike. Although a relatively lightweight IDE, it features surprisingly powerful indexing and code analysis capabilities, as well as useful tools, among which are make integration. While the tools it provides are not always as sophisticated as other IDEs (IntelliJ IDEA will likely come to mind as one such competitor), the simplicity of using it, as well as the reliability of this rugged IDE makes up greatly for the slightly less advanced tooling. Eclipse requires very little starting infrastructure in the workspace for all these features and indexing support as well, which makes it a good candidate for developing on the JDK.
>> 
>> This enhancement adds 4 extra targets to the make system for generating a basic Eclipse Workspace that provides almost full indexing support for the JDK, with varying levels as desired, from a minimalistic option only including the Java Virtual Machine's source code, to generating a workspace with both Java and C/C++ natures included, which allows for using Eclipse's unique ability to quickly swap between Java and C/C++ mode to work on both native and Java sources at the same time. Cross Compiling support is available, and in its entirety the change touches very little of the existing make system, barring its own Makefile within the ide subdirectory.
>> 
>> Indexing capabilities utilizing the enhancement:
>> <img width="960" alt="java" src="https://user-images.githubusercontent.com/32636402/197784819-67ec7de4-7e27-4f33-b738-59b75a9e4403.PNG">
>> <img width="787" alt="escape" src="https://user-images.githubusercontent.com/32636402/197784843-df8621a8-7b0a-42da-86f4-3afb92de0f71.PNG">
>
> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 38 commits:
> 
>  - Merge remote-tracking branch 'upstream/master' into eclipse
>  - Progress
>  - Merge remote-tracking branch 'upstream/master' into eclipse
>  - Formatting Cleanup
>  - Proper Checks
>  - Merge remote-tracking branch 'upstream/master' into eclipse
>  - Include Files for C/C++ code now work properly
>  - Merge remote-tracking branch 'upstream/master' into eclipse
>  - Merge remote-tracking branch 'upstream/master' into eclipse
>  - Merge remote-tracking branch 'upstream/master' into eclipse
>  - ... and 28 more: https://git.openjdk.org/jdk/compare/82deb5ca...5745a0df

To clarify: I think this would mean you gain in readability and maintainability. If Eclipse updates their XML format, it is much easier to open an `eclipse.xml.template` file in an editor, when it is "almost" pure XML, and do the needed changes, than to try to make changes to a makefile with a long row of print statements.

make/ide/eclipse/CreateWorkspace.gmk line 160:

> 158: 
> 159:   # Start with the Workspace file first
> 160:   $$(call WriteFile,<?xml version="1.0" encoding="UTF-8"?>, $(WORKSPACE_FILE))

A general thought. Maybe you would be helped by having one, or a few, set of template files, instead of writing each line like this? We have support for replacing specialized patterns in a template file with variables, or insert the contents of an entire file in a line (iirc, it's not been used in a while). This way you could for instance generate "partial" xml files for all conditional/looped parts below, and then have a "master" xml template for the general structure, adapt individual values with replacement, and inject the partial xml files in suitable places.

-------------

PR: https://git.openjdk.org/jdk/pull/10853


More information about the ide-support-dev mailing list