Reputation: 1409
How can I mark a package as being internal? (it should throw a warning when its classes are used)
There are plenty of examples of this in the Eclipse plug-ins (i.e. org.eclipse.core.internal
)
By using only import-package
/ export-package
directives instead of require-bundle
, I could just omit the export-package
directive in my plug-in, but the internal
warning would be of use in the other case.
Upvotes: 1
Views: 530
Reputation: 111216
You can specify x-internal:=true
in the Export-Package directive:
Export-Package: org.eclipse.e4.ui.css.core;x-internal:=true
There is also an x-friends
directive to let to specify a list of bundles which can use the package.
More on this in the Eclipse help for bundle manifest headers
When using the Manifest.mf editor you can specify this by switching to the 'Runtime' tab. Select the Exported Package you want to make internal and in the 'Package Visibility' section select 'hidden from all plugins except'. With no plugins in the except list you get x-internal, if you list plugins in the list you get x-friends.
Upvotes: 3