From 4ef591f71f62ee6ea8a603ed7a3e568b348b2c16 Mon Sep 17 00:00:00 2001 From: Julian Waters Date: Tue, 19 Mar 2024 06:27:50 +0000 Subject: [PATCH] 8326964: Remove Eclipse Shared Workspaces Reviewed-by: erikj, ihse --- .gitignore | 3 - doc/ide.html | 7 -- doc/ide.md | 15 ---- make/Main.gmk | 28 +------ make/ide/eclipse/CreateWorkspace.gmk | 111 ++++++++++----------------- 5 files changed, 45 insertions(+), 119 deletions(-) diff --git a/.gitignore b/.gitignore index 1b2821174e4..d0736707b80 100644 --- a/.gitignore +++ b/.gitignore @@ -18,8 +18,5 @@ NashornProfile.txt /src/utils/LogCompilation/target/ /.project/ /.settings/ -/.project -/.classpath -/.cproject /compile_commands.json /.cache diff --git a/doc/ide.html b/doc/ide.html index 18d45617f91..0dd16b7b9e6 100644 --- a/doc/ide.html +++ b/doc/ide.html @@ -110,10 +110,6 @@ Java and C/C++ natures during development by running:

make eclipse-mixed-env

Do note that this generates all features that come with both Java and C/C++ natures.

-

By default, the Eclipse Workspace is located in the ide subdirectory -in the build output. To share the JDK's source directory with the -Eclipse Workspace, you can instead run:

-
make eclipse-shared-<ENV>-env

Eclipse support in the JDK is relatively new, so do keep in mind that not everything may work at the moment. As such, the resulting Workspace also has compilation database parsing support enabled, so you can pass @@ -160,9 +156,6 @@ to import the newly created Java Workspace.

If doing so results in an error, you can also import the JDK via File -> Import -> Existing Projects into Workspace as a last resort.

-

Alternatively, if you want a Java Workspace inside the JDK's source -directory, you can instead run:

-
make eclipse-shared-java-env

As mentioned above for Eclipse CDT, you can create a combined Java and C/C++ Workspace which can conveniently switch between Java and C/C++ natures during development by running:

diff --git a/doc/ide.md b/doc/ide.md index 3a1c9de3128..40e3430a438 100644 --- a/doc/ide.md +++ b/doc/ide.md @@ -100,14 +100,6 @@ make eclipse-mixed-env Do note that this generates all features that come with both Java and C/C++ natures. -By default, the Eclipse Workspace is located in the ide subdirectory in the -build output. To share the JDK's source directory with the Eclipse Workspace, -you can instead run: - -``` -make eclipse-shared--env -``` - Eclipse support in the JDK is relatively new, so do keep in mind that not everything may work at the moment. As such, the resulting Workspace also has compilation database parsing support enabled, so you can pass Eclipse @@ -176,13 +168,6 @@ If doing so results in an error, you can also import the JDK via `File -> Import -> Existing Projects into Workspace` as a last resort. -Alternatively, if you want a Java Workspace inside the JDK's source directory, -you can instead run: - -``` -make eclipse-shared-java-env -``` - As mentioned above for Eclipse CDT, you can create a combined Java and C/C++ Workspace which can conveniently switch between Java and C/C++ natures during development by running: diff --git a/make/Main.gmk b/make/Main.gmk index b0b7565c138..c79a9c3cb9c 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -268,42 +268,22 @@ $(eval $(call SetupTarget, hotspot-ide-project, \ $(eval $(call SetupTarget, eclipse-java-env, \ MAKEFILE := ide/eclipse/CreateWorkspace, \ - ARGS := --always-make WORKSPACE=java SHARED=false, \ + ARGS := --always-make WORKSPACE=java, \ )) $(eval $(call SetupTarget, eclipse-hotspot-env, \ MAKEFILE := ide/eclipse/CreateWorkspace, \ - ARGS := --always-make WORKSPACE=hotspot SHARED=false, \ + ARGS := --always-make WORKSPACE=hotspot, \ )) $(eval $(call SetupTarget, eclipse-native-env, \ MAKEFILE := ide/eclipse/CreateWorkspace, \ - ARGS := --always-make WORKSPACE=native SHARED=false, \ + ARGS := --always-make WORKSPACE=native, \ )) $(eval $(call SetupTarget, eclipse-mixed-env, \ MAKEFILE := ide/eclipse/CreateWorkspace, \ - ARGS := --always-make SHARED=false, \ -)) - -$(eval $(call SetupTarget, eclipse-shared-java-env, \ - MAKEFILE := ide/eclipse/CreateWorkspace, \ - ARGS := --always-make WORKSPACE=java SHARED=true, \ -)) - -$(eval $(call SetupTarget, eclipse-shared-hotspot-env, \ - MAKEFILE := ide/eclipse/CreateWorkspace, \ - ARGS := --always-make WORKSPACE=hotspot SHARED=true, \ -)) - -$(eval $(call SetupTarget, eclipse-shared-native-env, \ - MAKEFILE := ide/eclipse/CreateWorkspace, \ - ARGS := --always-make WORKSPACE=native SHARED=true, \ -)) - -$(eval $(call SetupTarget, eclipse-shared-mixed-env, \ - MAKEFILE := ide/eclipse/CreateWorkspace, \ - ARGS := --always-make SHARED=true, \ + ARGS := --always-make, \ )) ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \ diff --git a/make/ide/eclipse/CreateWorkspace.gmk b/make/ide/eclipse/CreateWorkspace.gmk index 2362c0f7e71..2849303d570 100644 --- a/make/ide/eclipse/CreateWorkspace.gmk +++ b/make/ide/eclipse/CreateWorkspace.gmk @@ -78,8 +78,6 @@ EmitExtractedDefines = \ # Remaining parameter(s) are named arguments: # NATURE - Which Eclipse Workspace nature to generate for the Workspace. Can # be one of JAVA, HOTSPOT, NATIVE, or MIXED. -# SHARED - Workspace will share the same directory as the JDK if true. Can be -# either true or false. Defaults to false if not specified. SetupEclipseWorkspace = $(NamedParamsMacroTemplate) define SetupEclipseWorkspaceBody @@ -95,26 +93,12 @@ define SetupEclipseWorkspaceBody $$(error Unrecognised nature $$($1_NATURE) specified for Eclipse Workspace) endif - ifeq ($$($1_SHARED), ) - $$(info Workspace sharing option not given, assuming non-shared Eclipse Workspace) - $1_SHARED := false - else ifeq ($$(findstring $$($1_SHARED), true false), ) - $$(error $$($1_NATURE) is not a boolean word) - endif - - ifeq ($$($1_SHARED), true) - $1_CLASSPATH_FILE := $(TOPDIR)/.classpath - $1_WORKSPACE_FILE := $(TOPDIR)/.project - $1_NATIVE_FILE := $(TOPDIR)/.cproject - $1_SETTINGS_FILE := $(TOPDIR)/.settings/language.settings.xml - else - $1_IDE_OUTPUTDIR := $(OUTPUTDIR)/ide/eclipse - $1_CLASSPATH_FILE := $$($1_IDE_OUTPUTDIR)/.classpath - $1_WORKSPACE_FILE := $$($1_IDE_OUTPUTDIR)/.project - $1_NATIVE_FILE := $$($1_IDE_OUTPUTDIR)/.cproject - $1_SETTINGS_FILE := $$($1_IDE_OUTPUTDIR)/.settings/language.settings.xml - $$(call MakeDir, $$($1_IDE_OUTPUTDIR)) - endif + $1_IDE_OUTPUTDIR := $(OUTPUTDIR)/ide/eclipse + $1_CLASSPATH_FILE := $$($1_IDE_OUTPUTDIR)/.classpath + $1_WORKSPACE_FILE := $$($1_IDE_OUTPUTDIR)/.project + $1_NATIVE_FILE := $$($1_IDE_OUTPUTDIR)/.cproject + $1_SETTINGS_FILE := $$($1_IDE_OUTPUTDIR)/.settings/language.settings.xml + $$(call MakeDir, $$($1_IDE_OUTPUTDIR)) ifneq ($$(findstring $$($1_NATURE), HOTSPOT NATIVE MIXED), ) ifeq ($$(call isCompiler, microsoft), true) @@ -198,14 +182,11 @@ define SetupEclipseWorkspaceBody $1_MAKE := $$(call FixPath, $(MAKE)) endif - $1_MATCHING_MAKE_TARGETS := - $1_PLAIN_MAKE_TARGETS := update-build-docs docs gensrc gendata \ - copy java launchers libs hotspot jdk product-images all-images test-image clean - # make reconfigure omitted since it is sensitive to which make was used - ifeq ($$($1_SHARED), true) - $1_PLAIN_MAKE_TARGETS += dist-clean - endif + # make dist-clean omitted since it would delete the Workspace as well + $1_MATCHING_MAKE_TARGETS := + $1_PLAIN_MAKE_TARGETS := update-build-docs docs gensrc gendata copy java \ + launchers libs hotspot jdk product-images product-bundles all-images test-image clean $1_MATCHING_MAKE_TARGETS += $$(foreach name,$$($1_PLAIN_MAKE_TARGETS), \ \ @@ -232,11 +213,7 @@ define SetupEclipseWorkspaceBody TARGETS += $$($1_CREATE_NATIVE_FILE) - ifeq ($$($1_SHARED), true) - $$(call MakeDir, $(TOPDIR)/.settings) - else - $$(call MakeDir, $$($1_IDE_OUTPUTDIR)/.settings) - endif + $$(call MakeDir, $$($1_IDE_OUTPUTDIR)/.settings) $1_CSETTINGS := $1_CXXSETTINGS := @@ -314,40 +291,38 @@ define SetupEclipseWorkspaceBody endif - ifeq ($$($1_SHARED), false) - ifneq ($$(findstring $$($1_NATURE), JAVA MIXED), ) - $1_LINKED_RESOURCES += $$(foreach src,$(JAVA_DIRS), \ - \ - $$(strip $$(src)) \ - 2 \ - $$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src))) \ - $$(NEWLINE)) - endif + ifneq ($$(findstring $$($1_NATURE), JAVA MIXED), ) + $1_LINKED_RESOURCES += $$(foreach src,$(JAVA_DIRS), \ + \ + $$(strip $$(src)) \ + 2 \ + $$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src))) \ + $$(NEWLINE)) + endif - ifneq ($$(findstring $$($1_NATURE), HOTSPOT NATIVE MIXED), ) - # CDT includes a Makefile editor, so if CDT support was indicated there's no harm in - # including the make sources as well, since the cost of indexing them is miniscule - $1_LINKED_RESOURCES += \ - \ - make \ - 2 \ - $$(subst \\,/,$$(call FixPath, $(TOPDIR)/make)) \ - \ - \ - src/hotspot \ - 2 \ - $$(subst \\,/,$$(call FixPath, $(TOPDIR)/src/hotspot)) \ - $$(NEWLINE) - endif + ifneq ($$(findstring $$($1_NATURE), HOTSPOT NATIVE MIXED), ) + # CDT includes a Makefile editor, so if CDT support was indicated there's no harm in + # including the make sources as well, since the cost of indexing them is miniscule + $1_LINKED_RESOURCES += \ + \ + make \ + 2 \ + $$(subst \\,/,$$(call FixPath, $(TOPDIR)/make)) \ + \ + \ + src/hotspot \ + 2 \ + $$(subst \\,/,$$(call FixPath, $(TOPDIR)/src/hotspot)) \ + $$(NEWLINE) + endif - ifneq ($$(findstring $$($1_NATURE), NATIVE MIXED), ) - $1_LINKED_RESOURCES += $$(foreach src,$(NATIVE_DIRS), \ - \ - $$(strip $$(src)) \ - 2 \ - $$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src))) \ - $$(NEWLINE)) - endif + ifneq ($$(findstring $$($1_NATURE), NATIVE MIXED), ) + $1_LINKED_RESOURCES += $$(foreach src,$(NATIVE_DIRS), \ + \ + $$(strip $$(src)) \ + 2 \ + $$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src))) \ + $$(NEWLINE)) endif $$(eval $$(call SetupTextFileProcessing, $1_CREATE_WORKSPACE_FILE, \ @@ -366,22 +341,18 @@ endef ifeq ($(WORKSPACE), java) $(eval $(call SetupEclipseWorkspace, SETUP_WORKSPACE, \ NATURE := JAVA, \ - SHARED := $(SHARED), \ )) else ifeq ($(WORKSPACE), hotspot) $(eval $(call SetupEclipseWorkspace, SETUP_WORKSPACE, \ NATURE := HOTSPOT, \ - SHARED := $(SHARED), \ )) else ifeq ($(WORKSPACE), native) $(eval $(call SetupEclipseWorkspace, SETUP_WORKSPACE, \ NATURE := NATIVE, \ - SHARED := $(SHARED), \ )) else $(eval $(call SetupEclipseWorkspace, SETUP_WORKSPACE, \ NATURE := MIXED, \ - SHARED := $(SHARED), \ )) endif