ObeoNetwork / M2Doc

The M2Doc technology enables the generation of Office Open XML documents from models.
http://obeonetwork.github.io/M2Doc/
Eclipse Public License 2.0
38 stars 22 forks source link

Removal of jdt dependency from org.obeonetwork.m2doc.ide.ui #522

Closed allbutsafe closed 1 week ago

allbutsafe commented 4 months ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please have a look to the support pages of our website : http://m2doc.org/support/

Current behavior

The package org.obeonetwork.m2doc.ide.ui has dependencies to the jdt (via org.obeonetwork.m2doc.ide.jdt). It seems to be used for the TemplateCustomPropertiesPage (IType).

When packaging M2Doc we get into conflict with our existing jdt (different version), so we have to leave out this package, and consequently org.obeonetwork.m2doc.genconf.editor and org.obeonetwork.m2doc.ide.jdt, as they refer to ide.ui.

We do not use the native M2Doc UI for configuration, but use M2Doc programmatically. So what we lose is a) prompt services (not so relevant) and b) the M2Doc interpreter view in genconf.editor (that's a pity, we would like to use that even more in the future).

Is it possible to remove the jdt dependencies from ide.ui? Or at least from genconf.editor?

Expected behavior

Packages org.obeonetwork.m2doc.ide and org.obeonetwork.m2doc.genconf.editor do not have a dependency to jdt.

Minimal reproduction of the problem with instructions

N/A

What is the motivation / use case for changing the behavior?

Integration of M2Doc in a larger Eclipse package

Environment


M2Doc version: 3.3.2
Eclipse version: 2023-12
Platform version:  Windows 11

Others:

ylussaud commented 4 months ago

Dependencies to the JDT are as follow: org.obeonetwork.m2doc.ide.ui

org.obeonetwork.m2doc.ide.jdt

But none of the dependencies require a specific version of the JDT so any version could be used. Do you have a specific P2 error message or anything else I can look into ?

The dependency from org.obeonetwork.m2doc.genconf.editor to org.obeonetwork.m2doc.ide.ui has been introduced to factorize UI code (some dialogs)...

jmauersberger commented 4 months ago

@ylussaud I think the problem description was not precise enough, it is not about a JDT version mismatch but the dependency itself. We bundle our own eclipse RCP application and we don't want the JDT to creep into the product, too many features are coming in that way. I quickly checked the code and as @allbutsafe pointed out, JDT classes are only used in one class TemplateCustomPropertiesPage , and even there I am not sure why JDT at all, was it convenience? I mean, m2doc has no relation to Java types and classes, hasn't it?

ylussaud commented 4 months ago

You can import Java services (methods from Java classes) in your template in order to extends the capabilities of AQL (the query language used by M2Doc). We rely on the JDT to list available classes in the workspace/target platform. I don't think I'll be able to move or remove that code.

If the problem with the product is the JDT UI, you can disable some capabilities in your product. I think it can be done with the org.eclipse.ui.activities extension point. There is an example in Capella.

And to answer your question @jmauersberger AQL have a typing system that use both EMF and Java types. This allows to call Java methods as IService.

jmauersberger commented 4 months ago

Got it, thanks @ylussaud. We also have our own services we inject but I was not aware that there is IDE support for that. Clear now.

Would it be possible to split the JDT dependent part (the wizard and IDE integration basically) from the services (which are nit at all IDE related?). The prompt service is SWT/JFace only, so eclipse runtime and not really IDE, right?

ylussaud commented 3 months ago

I'm not sure I'll be able to do that before the next release but I'll have a look. Limiting this kind of dependencies is a good practice.