Using Eclipse API tooling to enforce correct versions in Require-Bundle

53 Views Asked by At

Is it possible to make Eclipse API tooling to maintain versions MANIFEST.MF, so that when I use an API element which is annotated as (for example) @since 1.1, I get a warning of the corresponding Require-Bundle does not also specify a compatible version number?

I have a plugin A, which defines a class X. This class X was introduced in version 1.1:

/**
 * @since 1.1
 */
public class X {
}

I have another plugin B, which depends on A, version 1.0.0:

// MANIFEST.MF for plugin B
...
Require-Bundle: A;bundle-version="1.0.0"

Note that the dependency on A specifies version 1.0.0, not version 1.1 which is necessary to be able to resolve the new class X.

I was under the impression that API tooling would warn about these kinds of things, but it doesn't seem to do that. (It does warn when introducing X that I need to bump the version of A to 1.1, so my API tooling setup seems at least to work that far.)

Is this outside of the scope of API tooling, or have I setup my API tooling incorrectly? (No API tooling warnings/errors are set to ignore.)

1

There are 1 best solutions below

0
On

I believe there is no way to correlate @since with a version in Require-Bundle. But of course you can write down your own plugin ;-)