8326964: Remove Eclipse Shared Workspaces

Reviewed-by: erikj, ihse
This commit is contained in:
Julian Waters 2024-03-19 06:27:50 +00:00
parent ac5b6cb2d4
commit 4ef591f71f
5 changed files with 45 additions and 119 deletions

3
.gitignore vendored
View File

@ -18,8 +18,5 @@ NashornProfile.txt
/src/utils/LogCompilation/target/
/.project/
/.settings/
/.project
/.classpath
/.cproject
/compile_commands.json
/.cache

View File

@ -110,10 +110,6 @@ Java and C/C++ natures during development by running:</p>
<pre><code>make eclipse-mixed-env</code></pre>
<p>Do note that this generates all features that come with both Java and
C/C++ natures.</p>
<p>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:</p>
<pre><code>make eclipse-shared-&lt;ENV&gt;-env</code></pre>
<p>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.</p>
<p>If doing so results in an error, you can also import the JDK via
<code>File -&gt; Import -&gt; Existing Projects into Workspace</code> as
a last resort.</p>
<p>Alternatively, if you want a Java Workspace inside the JDK's source
directory, you can instead run:</p>
<pre><code>make eclipse-shared-java-env</code></pre>
<p>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:</p>

View File

@ -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>-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:

View File

@ -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) \

View File

@ -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), \
<target name="$$(strip $$(name))" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> \
@ -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), \
<link> \
<name>$$(strip $$(src))</name> \
<type>2</type> \
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src)))</location> \
</link>$$(NEWLINE))
endif
ifneq ($$(findstring $$($1_NATURE), JAVA MIXED), )
$1_LINKED_RESOURCES += $$(foreach src,$(JAVA_DIRS), \
<link> \
<name>$$(strip $$(src))</name> \
<type>2</type> \
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src)))</location> \
</link>$$(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 += \
<link> \
<name>make</name> \
<type>2</type> \
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/make))</location> \
</link> \
<link> \
<name>src/hotspot</name> \
<type>2</type> \
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/src/hotspot))</location> \
</link>$$(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 += \
<link> \
<name>make</name> \
<type>2</type> \
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/make))</location> \
</link> \
<link> \
<name>src/hotspot</name> \
<type>2</type> \
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/src/hotspot))</location> \
</link>$$(NEWLINE)
endif
ifneq ($$(findstring $$($1_NATURE), NATIVE MIXED), )
$1_LINKED_RESOURCES += $$(foreach src,$(NATIVE_DIRS), \
<link> \
<name>$$(strip $$(src))</name> \
<type>2</type> \
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src)))</location> \
</link>$$(NEWLINE))
endif
ifneq ($$(findstring $$($1_NATURE), NATIVE MIXED), )
$1_LINKED_RESOURCES += $$(foreach src,$(NATIVE_DIRS), \
<link> \
<name>$$(strip $$(src))</name> \
<type>2</type> \
<location>$$(subst \\,/,$$(call FixPath, $(TOPDIR)/$$(src)))</location> \
</link>$$(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