Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Output rules for Export/Import package #120

Open
tjwatson opened this issue May 22, 2020 · 1 comment
Open

Output rules for Export/Import package #120

tjwatson opened this issue May 22, 2020 · 1 comment
Assignees

Comments

@tjwatson
Copy link
Collaborator

tjwatson commented May 22, 2020

With OSGi there is a concern about package versions when an exported package uses one of the renamed packages. For example, consider the following export from a Bundle X:

Export-Package: some.api; uses:="javax.servlet"; version="1.0"

Here javax.servlet is renamed to jakarata.servlet and the package some.api has types from javax.servlet in its API signature.

When transforming bundle X the transformer must transform the Export-Package for some.api to:

Export-Package: some.api; uses:="jakarta.servlet"; version="2.0"

Here the uses directive needed to be updated, but also the major version of the package should be updated because some.api had a breaking change with the rename of javax.servlet->jakarta.servlet

We need to ensure this version transformation occurs when the transformer detects that a used packages (as specified by the uses:= directive). In addition we also need a way to output a future rule that this package some.api had a major version change due to a transformation. This information then can be used when transforming a later bundle that imports the some.api package:

Import-Package: some.api; version="[1.0, 2.0)"

If a bundle being transformed has the above import the transformed import should use a range that included the major version bump included with the transformed export:

Import-Package: some.api; version="[2.0, 3.0)"

The assumption is that the importing bundles will be transformed after the exporting bundles and the output of the transformer on the exporter can be used to feed the new rule for range transformation to the later transformation of the importing bundles.

@bjhargrave
Copy link
Collaborator

bjhargrave commented May 22, 2020

We also need to pay attention to the range of the import. If the range is narrow (provider type) "[1.3,1.4)" then the replacement import range must also be narrow "[2.0,2.1)".

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

No branches or pull requests

3 participants