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:
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.
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)".
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:
Here
javax.servlet
is renamed tojakarata.servlet
and the packagesome.api
has types fromjavax.servlet
in its API signature.When transforming bundle X the transformer must transform the Export-Package for
some.api
to: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 ofjavax.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 packagesome.api
had a major version change due to a transformation. This information then can be used when transforming a later bundle that imports thesome.api
package: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:
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.