tycho
tycho copied to clipboard
Use DS annotations for tycho components
Currently we use hand crafted component.xml using DS-Annotations would automate this process and make it much more convenient and clear.
Would you please ellaborate what should/could be done here?
We currently have for example here some component definitions, hand crafted:
https://github.com/eclipse/tycho/tree/master/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/OSGI-INF
the in code then these methods are (sometimes) marked with // for DS usage.
On the other hand one can use DS Annotations with the following advantages:
- Automatic validation and generation of the XML (e.g. missing methods)
- One can work "in code" to change something without taking care of the XML
- The annotations already document that these is used for DS so one don't think they are unused
- With recent Tycho 2.7.3 you don't even need to check in the XML as they are generated by the build
Would you please do one of them to serve as example? And I can trying doing others while familiarizing myself with DS .
I can try to prepare an example, I have written a short "quickstart" once at m2e here:
https://github.com/eclipse-m2e/m2e-core/pull/628/files#r841896726
and here is an example for a very simple component:
https://github.com/eclipse-m2e/m2e-core/blob/master/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectFacadeAdapterFactory.java
@akurtakov do you plan to further work on this?
I hope to find time for it before 3.0
Great let me know if you need any help.
@laeubi Is this fixed in Tycho 3.0.0? Is the MANIFEST.MF also extended with the service metadata references? Would be good to also document this in https://wiki.eclipse.org/Tycho/FAQ#How_to_use_OSGi_declarative_service_annotations.
@kwin this is about Tycho using DS internally (and is somehow obsolete now).
The wiki itself is heavily outdated and mostly would need a complete overhaul. From the user side you can use all the annotations and Tycho will generate the xml, but you will need to add the service metadata references (or mostly PDE will do this for you if you enable DS annotation processing).