From jwaters at openjdk.org Wed Jan 4 13:06:37 2023 From: jwaters at openjdk.org (Julian Waters) Date: Wed, 4 Jan 2023 13:06:37 GMT Subject: RFR: 8295884: Implement IDE support for Eclipse [v30] In-Reply-To: References: Message-ID: > 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: > java > escape 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 ------------- Changes: https://git.openjdk.org/jdk/pull/10853/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10853&range=29 Stats: 620 lines in 5 files changed: 618 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/10853.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10853/head:pull/10853 PR: https://git.openjdk.org/jdk/pull/10853 From ihse at openjdk.org Thu Jan 12 12:56:17 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 12 Jan 2023 12:56:17 GMT Subject: RFR: 8295884: Implement IDE support for Eclipse [v30] In-Reply-To: References: Message-ID: On Wed, 4 Jan 2023 13:06:37 GMT, Julian Waters 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: >> java >> escape > > 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 make/ide/eclipse/CreateWorkspace.gmk line 479: > 477: )) > 478: > 479: all: workspace-full You are missing a trailing newline here. ------------- PR: https://git.openjdk.org/jdk/pull/10853 From ihse at openjdk.org Thu Jan 12 13:04:21 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 12 Jan 2023 13:04:21 GMT Subject: RFR: 8295884: Implement IDE support for Eclipse [v30] In-Reply-To: References: Message-ID: <9n5LBsCUJB6hpAh2eQ-fcKt-zrlTEU9DYm9AOXIlzwg=.deb614bc-5706-4d34-8cdb-b0b44d8f2e46@github.com> On Wed, 4 Jan 2023 13:06:37 GMT, Julian Waters 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: >> java >> escape > > 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,, $(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 From ihse at openjdk.org Thu Jan 12 13:11:22 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 12 Jan 2023 13:11:22 GMT Subject: RFR: 8295884: Implement IDE support for Eclipse [v30] In-Reply-To: References: Message-ID: On Wed, 4 Jan 2023 13:06:37 GMT, Julian Waters 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: >> java >> escape > > 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 If you want to go down that route, the function you'll need is `SetupTextFileProcessing`. It has two relevant arguments: * `REPLACEMENTS`, which takes a kind of a special syntax argument, like this: REPLACEMENTS := \ @@COPYRIGHT_YEAR@@ => $(COPYRIGHT_YEAR) ; \ @@VERSION_SHORT@@ => $(VERSION_SHORT) ; \ @@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION), \ The stuff to the left of the arrow is the literal pattern to search for. By tradition, we have used the `@@...@@` to mark our patterns. It is not required, but it is recommended since it is easy to spot and low chance of collision with any real text. It is also recommend as in the example above to name the pattern after the variable it will replace. * `INCLUDES`, which similarly has this syntax: INCLUDES := \ @@DEBUG_PARTIAL_XML@@ => $(OUTPUT)/$(DEBUG_PARTIAL).xml The placeholder (i.e. `@@DEBUG_PARTIAL_XML@@`) will need to be alone on a single line. This line will be removed and replaced with the contents of the given file. (There are currently no usages of this functionality in the JDK build, but I don't think it has bit-rotted away) ------------- PR: https://git.openjdk.org/jdk/pull/10853 From jwaters at openjdk.org Thu Jan 12 15:09:37 2023 From: jwaters at openjdk.org (Julian Waters) Date: Thu, 12 Jan 2023 15:09:37 GMT Subject: RFR: 8295884: Implement IDE support for Eclipse [v30] In-Reply-To: References: Message-ID: On Wed, 4 Jan 2023 13:06:37 GMT, Julian Waters 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: >> java >> escape > > 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 Oh my god, thanks so much for that pointer, this likely would've been so much easier to do, zzz I'll do that after implementing extracting defines from the command line though, to make it less messy ------------- PR: https://git.openjdk.org/jdk/pull/10853 From magnus.ihse.bursie at oracle.com Tue Jan 17 12:14:04 2023 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Tue, 17 Jan 2023 13:14:04 +0100 Subject: Add a .editorconfig file? Message-ID: As suggested in https://github.com/openjdk/jdk/pull/11491#issuecomment-1385301564, maybe we should add a .editorconfig file to the JDK project, to help IDEs and editors comply with jcheck rules. To get this to work, I think we need to first convert the current jchecks rules into a matching .editorconfig file, and then verify that this works and has no unintended consequences on the major IDEs. /Magnus From ihse at openjdk.org Mon Jan 23 15:14:30 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 23 Jan 2023 15:14:30 GMT Subject: RFR: 8295884: Implement IDE support for Eclipse [v30] In-Reply-To: References: Message-ID: <5EDBcRWu_c5-rjJ_lLC7Smh4cNiWBHOy8w6bCxgA5wE=.4bdaa92f-241b-41d8-9be7-45c1bf4bad55@github.com> On Thu, 12 Jan 2023 15:06:43 GMT, Julian Waters wrote: >> 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 > > Oh my god, thanks so much for that pointer, this likely would've been so much easier to do, zzz > > I'll do that after implementing extracting defines from the command line though, to make it less messy @TheShermanTanker If you intend to rewrite this using template files, maybe set the PR in Draft state? ------------- PR: https://git.openjdk.org/jdk/pull/10853