eclipse-sprotty / sprotty-server

Server implementation for the Sprotty diagramming framework
https://eclipse.org/sprotty
Eclipse Public License 2.0
23 stars 19 forks source link

Remove Xtext dependencies from Sprotty #93

Open glatuske opened 7 months ago

glatuske commented 7 months ago

The bundle org.eclipse.sprotty has an import package on Xtext but no Java class is using it. This import should be removed.

I guess this dependency comes via Xtend but is build time only.

sailingKieler commented 7 months ago

The bundle org.eclipse.sprotty has an import package on Xtext but no Java class is using it. This import should be removed.

I guess this dependency comes via Xtend but is build time only.

@glatuske the sprotty protocol datatypes are specified in Xtend using Xtend's active annotations, which are declared in org.eclipse.xtend.lib.macro (transitively pulled via org.eclipse.xtend.lib). Their retention policy is unspecified, i.e. CLASS by default, so they're not available at runtime, and maybe their declaration is not required at runtime.

However, the setters and getters in the datatype use (are generated with) the annotation org.eclipse.xtext.xbase.lib.Pure that as retention policy RUNTIME.

Consequence: In order to get rid of that dependencies we would have to replace the Xtend-based definitions by counterparts in Java, which is not super tempting.

In which way are those dependencies problematic for you?

sailingKieler commented 7 months ago

One more finding: It's actually the java package org.eclipse.xtext.xtend2.lib that is requested and that is exported by bundle org.eclipse.xtext.xbase.lib.

So on eclipse bundle/maven artifact level it's "just" org.eclipse.xtext.xbase.lib that is required as dependency. I was able to rid of org.eclipse.xtext.xtend2.lib package import via a minor change (in IdCache), getting rid of the dependency on org.eclipse.xtext.xbase.lib will by a major refactoring, I guess.

glatuske commented 7 months ago

@sailingKieler I have created my request because of the combination of different Xtext versions (and Google Guice & Guava) with @kieler is quite tricky. We will give it a try to update KLighD to use Guice 6.0 as well. I'll come back when I know more.

sailingKieler commented 7 months ago

Which dependency version constraint do you have there? (I'm currently not up-to-date on that). What we might try is to relax the version constraint on xbase.lib here, as I don't expect significant changes among the recent versions.

glatuske commented 7 months ago

It would help us, if the minimum version would be set to 2.31 (or below).