Skip to content
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

PDE API-Tools should add api.tools.annotations on a Plug-ins classpath automatically #447

Closed
HannesWell opened this issue Jan 28, 2023 · 3 comments · Fixed by #912
Closed

Comments

@HannesWell
Copy link
Member

In order to use the PDE API-Tools annotations they have to be added from the current TP to the classpath of a Plugin by either Import-Package, Required-Bundle in the MANIFEST.MF or as additional.bundles in the build.properties. The latter is used by the ApiQuickFixProcessor, when converting the api-tools javadoc tags to annotations because it does not introduce a dependency at runtime (the annotations are only processed at build time).

In order to make using api-tools annotations even simpler the annotation should be added to a Plug-ins classpath using a IClasspathContributor created by the api-tools nature or builder. Then the a entry like additional.bundles = org.eclipse.pde.api.tools.annotations in the build.properties or even worse a entry in the MANIFEST.MF is not necessary anymore.
We already use that for the OSGiAnnotationsClasspathContributor and it works quite well.

If PDE supports that we have to check that Tycho supports that as well, but since Tycho just uses PDE's APIFileGenerator we can do that in PDE as well.

@laeubi
Copy link
Contributor

laeubi commented Jan 28, 2023

If PDE supports that we have to check that Tycho supports that as well, but since Tycho just uses PDE's APIFileGenerator we can do that in PDE as well.

Tycho has a similar concept an the tycho-apitools-plugin must just provide a (plexus)component that extends AbstractSpecificationClasspathContributor to automatically enable this.

@HannesWell
Copy link
Member Author

In order to ease the usage of these annotations it would probably also be good to have a Quick-Fix and/or clean-up to replace the java-doc based annotations.

@laeubi
Copy link
Contributor

laeubi commented Nov 12, 2023

In order to ease the usage of these annotations it would probably also be good to have a Quick-Fix and/or clean-up to replace the java-doc based annotations.

I would love to get open-rewrite working for that:

@timtebeek is currently investigate that for moderne.io and I'm currently investigate to have a JDT plugin for that:

laeubi added a commit to laeubi/eclipse.pde that referenced this issue Nov 12, 2023
Currently it is quite cumbersome to use and discover the PDE own API
tools annotations and requires some kind of workarounds.

This adds a classpath contributor that makes the annotations available
like already done for ds and bundle annotations.

Fix eclipse-pde#447
laeubi added a commit to laeubi/eclipse.pde that referenced this issue Nov 14, 2023
Currently it is quite cumbersome to use and discover the PDE own API
tools annotations and requires some kind of workarounds.

This adds a classpath contributor that makes the annotations available
like already done for ds and bundle annotations.

Fix eclipse-pde#447
laeubi added a commit to laeubi/eclipse.pde that referenced this issue Nov 29, 2023
Currently it is quite cumbersome to use and discover the PDE own API
tools annotations and requires some kind of workarounds.

This adds a classpath contributor that makes the annotations available
like already done for ds and bundle annotations.

Fix eclipse-pde#447
laeubi added a commit that referenced this issue Nov 29, 2023
Currently it is quite cumbersome to use and discover the PDE own API
tools annotations and requires some kind of workarounds.

This adds a classpath contributor that makes the annotations available
like already done for ds and bundle annotations.

Fix #447
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants