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

Support PDE DS Plugin classpath additions #406

Closed
laeubi opened this issue Dec 2, 2021 · 1 comment
Closed

Support PDE DS Plugin classpath additions #406

laeubi opened this issue Dec 2, 2021 · 1 comment
Milestone

Comments

@laeubi
Copy link
Member

laeubi commented Dec 2, 2021

The PDE DS Plugin has a configuration file named org.eclipse.pde.ds.annotations.prefs that looks like this:

classpath=true
dsVersion=V1_3
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
path=OSGI-INF
validationErrorLevel=error
validationErrorLevel.missingImplicitUnbindMethod=error

the interesting part is classpath=true what adds the DS annotation classes to the classpath of the current project.

While everything works in PDE, the tycho build fails with:

Access restriction: The type 'Activate' is not API
  (restriction on classpath entry 'somepath/org.eclipse.osgi.services-3.10.200.v20210723-0643.jar')

so it is required to add a package-import to the bundle to make this compile. The DS annotations are all have a retention of RetentionPolicy.CLASS that means they are not available at runtime and thus only needed at compile-time.

We should add support for this to not force people adding useless imports to their bundle.

@laeubi laeubi modified the milestones: 2.7, 3.0 Jan 27, 2022
laeubi added a commit to laeubi/tycho that referenced this issue Apr 13, 2022
Signed-off-by: Christoph Läubrich <[email protected]>
laeubi added a commit to laeubi/tycho that referenced this issue Apr 14, 2022
@laeubi laeubi closed this as completed in be74d52 Apr 14, 2022
@laeubi laeubi modified the milestones: 3.0, 2.7.2 Apr 21, 2022
@laeubi
Copy link
Member Author

laeubi commented Apr 21, 2022

This is also backported to 2.7.2

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

No branches or pull requests

1 participant