8295884: Implement IDE support for Eclipse#10853
8295884: Implement IDE support for Eclipse#10853TheShermanTanker wants to merge 54 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back jwaters! A progress list of the required criteria for merging this PR into |
|
@TheShermanTanker The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
b6a85ca to
310efd2
Compare
There was a problem hiding this comment.
This looks like nice work.
I'm curious how does this eclipse project figures out preprocessor settings like -D flags from the build to correctly setup the environment for the native code? I know this was a major deal when creating the compile-commands.json for other native IDE integrations. I've heard some IDEs just run the build once and inspect the command lines, but our default log level won't show that. I'm not familiar with eclipse project files, but I couldn't really see anything here that addressed this issue. Can you work with the native code in a meaningful way without it?
You're right, it seems I forgot to also include the preprocessor defines in the generated workspace :P |
|
@TheShermanTanker Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information. |
|
Will this work with jtreg test sources too? At least on Intellij those require a brittle intellij plugin. |
I also forgot to mention that CDT does come with an integrated Build Output Parser that can do just that, but I do want to avoid using it, if possible, since it's much more convenient to be able to start working on code the moment configure completes instead of having to wait for the build to finish once |
|
@erikj79 @magicus Seems like this is the best I can do for now, baseline support for Eclipse should now be present with these final touchups (Environment setup is not fully complete yet, but Eclipse is flexible enough that for most development work, this should not be too problematic). I do plan to refine support for it in the future, since there are still areas for improvement, but at present I think this should be decent enough for the time being |
make/ide/eclipse/workspace.template
Outdated
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <projectDescription> | ||
| <name>Java</name> | ||
| <comment>The official Java HotSpot Virtual Machine, Runtime Environment, and Development Kit</comment> |
There was a problem hiding this comment.
Just call it OpenJDK; there is a legal trademark swamp associated with "Java".
There was a problem hiding this comment.
Got it, will also rename it to just jdk to match the cloned repository to be extra safe
|
|
||
| # Use server as base for defines and includes | ||
| JVM_VARIANT=server | ||
| # Use primary variant for defines and includes |
There was a problem hiding this comment.
This might be a correct fix but it is independent of this PR.
There was a problem hiding this comment.
Submitted https://bugs.openjdk.org/browse/JDK-8303760 and #12906 to fix that issue separately
|
:( |
erikj79
left a comment
There was a problem hiding this comment.
Functionally this looks ok to me, just some comment on cosmetics.
Co-authored-by: Erik Joelsson <37597443+erikj79@users.noreply.github.com>
Co-authored-by: Erik Joelsson <37597443+erikj79@users.noreply.github.com>
Co-authored-by: Erik Joelsson <37597443+erikj79@users.noreply.github.com>
|
Alright, that should be all of them |
|
@TheShermanTanker This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 167 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
Thanks Erik! @magicus is this final revision ok with you? |
|
/integrate |
|
Sorry this took so long, for everyone that was waiting for this. Do note that C support may still be a little wonky in some cases, if there are any bugs do feel free to send me a message in this Pull Request (doesn't matter that it's already been integrated) |
|
Going to push as commit 45809fd.
Your commit was automatically rebased without conflicts. |
|
@TheShermanTanker Pushed as commit 45809fd. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
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:


Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10853/head:pull/10853$ git checkout pull/10853Update a local copy of the PR:
$ git checkout pull/10853$ git pull https://git.openjdk.org/jdk pull/10853/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10853View PR using the GUI difftool:
$ git pr show -t 10853Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10853.diff