-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate pde.ds to 'org.osgi.service.component.annotations' from Maven-Central #38
Comments
I backported this to Tycho 2.7.2 as well : eclipse-tycho/tycho#903
Even though it is compatible, if one selects
Just note that this will require also changes in the DS xml editor and in the handling of the annotations (constructor injection for example). So if you like to invest time, it would most probably be better to first have 1.4 support and then try to get rid of some jars that do not harm anything :-) |
Great!
Yes that's right. I already expected that all versions have to be included. Unless the PDE-DS builder could parse some version annotations. But I think the compiler does a better job in that. And in the end I assume it's easier to ship all versions (a jar with a few annotations is not large) and put the desired one on the classpath for compilation.
Looks like I have opened another big box here. 😅 |
Yep, but having DS 1.4 support would be really great and appreciated ;-) I even think that we can start with supporting the 1.4 annotations first and simply do the editor later, if annotations work smoothly there is not much need for an editor anyways and we maybe just drop it and replace with a simple XML editor... |
FWIW, I think we can retire the non textual part of the DS editor and only support a text editor for it. The "advanced" UI used to be very buggy in the past (when I still tried to use it) and have not been improved since. |
Understand. I'll try to not postpone it too long.
I have not yet worked much with DS (but since it looks very promising I hope/expect to use it more in the future). However I was surprised an Editor even exists. As you said I thought the xml is supposed to be fully generated by the tooling. So there should not be any need for it, should it? So I would support the removal. |
There was a time before annotation support in OSGi and you can still create the XML without using annotations (for whatever reasons). Its also sometimes much nicer to have a UI present things in a structured way that staring at an XML document, especially if your not that familiar with it.
Don't know but the editor already "knows" what to open so it is disabled for anything > 1.3 already
|
We should still support the textual editor, if possible migrate its support to the generic editor. I think it would be fine to remove the other tabs and put this into the N&N. |
When reworking/enhancing the DS support in PDE, I wonder if we should use BND internally to create the service's xml-files. I have not yet investigated which module of bnd is doing that, but given that m2e uses bnd.lib any ways it is already in the SimRel. |
You can take a look at the DS support of tycho to get an idea how to use the BND-lib: but be aware that generating the xml is only half way down, we also want live validation and error markers and... |
Thanks for the link.
Of course but we would at least have saved one part. |
This is addressed with the following PRs and can be closed once all are merged: |
All mentioned PRs are merged, thus is completed. |
In eclipse-equinox/equinox#18
o.e.osgi.services
is migrated from embedding the sources of the osgi packageorg.osgi.service.component.annotations
to use the osgi-bundles published to Maven-Central.The OSGi-bundle
org.osgi.service.component.annotations
published to Maven-Central is designed to not resolve at runtime (see eclipse-equinox/equinox#18). Therefore and because the contained annotations are designed to be used at compile-time only Plug-ins should not import the package (or worse require the containing bundle).PDE DS offers to add the annotations implicitly to the classpath to make the compilation in the IDE work.
In the past Tycho did not support this. But @laeubi changed this recently for the upcoming Tycho-3: https://github.com/eclipse/tycho/blob/master/RELEASE_NOTES.md#support-for-pde-declarative-component-annotation-progressing
One (or the only) workaround was/is to import the package
org.osgi.service.component.annotations
in a Plug-in that uses DS. This worked because the package was supplied by o.e.osgi.services. But sinceo.e.osgi.services
is about to be deprecated for removal (see eclipse-equinox/equinox#18) and the part relevant for DS is replaced byorg.osgi.service.component.annotations
(which does not resolve so we cannot add it at runtime or to a TP) we should make sure that the mentioned package is not imported anymore. Consequently the PDE-DS builder should mark the import of that package as an error encouraging the user to remove it (best with some explanation).See also eclipse-equinox/equinox#18, eclipse-equinox/equinox#18, eclipse-equinox/equinox#18 and subsequent.
Besides I would like to check if the
org.eclipse.pde.ds.annotations
and its sub-plug-insorg.eclipse.pde.ds.lib
andorg.eclipse.pde.ds1_2.lib
can be replaced or at least simplify using 'org.osgi.service.component.annotations' from Maven-Central.As part of this work the annotation package can be updated to the latest versions as suggested in eclipse-equinox/equinox.framework#36.
The text was updated successfully, but these errors were encountered: