bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
532 stars 305 forks source link

No documentation page for `-versionpolicy` instruction #6372

Closed bric3 closed 1 week ago

bric3 commented 1 week ago

I was reading this page (https://bnd.bndtools.org/heads/import_package.html) and tried to navigate to the version policy instruction page (https://bnd.bndtools.org/instructions/versionpolicy.html), but this lands on a 404.

I suppose the doc is simple, however having a description of the default format would be nice.

I have this in mockito -versionpolicy: [${version;==;${@}},${version;+;${@}}), and I think it means something about a range from the current version to the next.

chrisrueger commented 1 week ago

@bric3 there is https://bnd.bndtools.org/instructions/consumer_policy.html and https://bnd.bndtools.org/instructions/provider_policy.html (Update: and https://bnd.bndtools.org/chapters/170-versioning.html and https://bnd.bndtools.org/macros/range.html)

I cannot find a versionpolicy.md in the source anymore, so maybe it is outdated.

Do these links answer your questions? If yes, I could update the docs to link to those links instead of the 404 one.

bric3 commented 1 week ago

@chrisrueger I saw these links, that say I don't really now how much they apply there.

I'm not well versed in OSGI (so I'm not sure at all of what I write there), they all look fitting in a way, like section 10.5 in https://bnd.bndtools.org/chapters/170-versioning.html but I feel this option is about configuring a default for the import package directive as the doc page indicates:

The import package doc That is, when the exporter is 1.2.3.build123, then the import version will be 1.2. If a specific version (range) is specified, this will override any found version. This default an be overridden with the -versionpolicy instruction.

Also I'm not sure how to read the range [${version;==;${@}},${version;+;${@}}) from range documentation page because the syntax is completely different.

chrisrueger commented 1 week ago

I believe this is also an important link for the version / versionmask macro: https://bnd.bndtools.org/macros/version.html

Regarding: [${version;==;${@}},${version;+;${@}}) I believe it reads:

Lower Bound ([): Inclusive, starting at the exact version (${version;==;${@}}). Upper Bound ()): Exclusive, up to but not including the next major version (${version;+;${@}}).

${@} is a placeholder for a version calculated by bnd. But this is not my specialty.

@pkriens, you have some additional thoughts?

chrisrueger commented 1 week ago

@bric3 I have merged PR #6373 . Besides fixing and adding links I also added some more examples to https://bnd.bndtools.org/macros/range.html#examples Maybe this is helpful

bric3 commented 1 week ago

Thank you @chrisrueger