In a prior mail thread several people expressed in interest in extending the p2 Projector with support for the OSGi "uses constraints" directive.
The goal is to make the Projector functionality on par with that of the Felix Resolver.
I hope there is still interest in collaborating on this issue.
With that said I will open the discussion with the obvious:
What exactly uses constraints mean (OSGi Core spec: 3.7.6 Package Constraints)?
In particular the transitive nature of uses constraints seem to make the problem so hard to solve. So why do they have to be transitive in the first place?
I am basing this question on the following premises:
1. Uses constraints only apply to public packages
2. A bundle imports directly all public packages it uses
- Can the Require-Bundle re-exports be converted to this?
Now consider the example:
Bundle A:
Import-Package: p, t
Bundle B:
Export-Package: p;uses:=q
Import-Package: q
Bundle C:
Export-Package: q;uses:=t
Import-Package: t
Bundle D:
Export-Package: t;version=1
Bundle E:
Export-Package: t;version=2
Consider the wiring:
Bundle A: wired to p, t;version=1
Bundle B: wired to q
Bundle C: wired to t;version=2
If Bundle A makes a call to "p" how can it be transitively exposed to "t;version=2" given that "t" is not in the public signature of "p"? I.e. A does not mention "t" anywhere in it's code.
The OSGi spec says A can be exposed to both versions of "t": once by direct import and once transitively through B and C.
Regards
Todor