Allow Baselining for 0.x versions
... baselining to also work on 0.x packages.
Originally posted by @peterkir in https://github.com/bndtools/bnd/issues/6702#issuecomment-3179068554
Currently in the baseline feature there is a special handling for versions < 1.0
From: https://bnd.bndtools.org/chapters/180-baselining.html#setting-up-a-project-for-baselining
the bundle/package version must be 1.0.0 or above. If the version is less (i.e. major version being 0) no baselining is possible, the purpose is to allow the primordial baseline to be established without errors.
In the discussions in https://github.com/bndtools/bnd/issues/6702 it was suggested that this special handling should be removed and baselining should work for all versions including 0.x
History
The following issue and commit seem to be how this feature was created.
- https://github.com/bndtools/bnd/issues/2452
- https://github.com/bndtools/bnd/commit/1cc175bcc344834f3e4dbea3f0f5000c4db0e27f
https://github.com/bndtools/bnd/blob/1cc175bcc344834f3e4dbea3f0f5000c4db0e27f/biz.aQute.bndlib/src/aQute/bnd/differ/Baseline.java#L264-L273
Configurability
TODO this needs to be discussed. Probably this new behavior should be opt in, to be backwards compatible
For the record: I think the current behavior is good (at least by default). I don’t feel the need to change it. However as stated before I would rather change the import version range policy to be incline with that default behavior
I can't find any statement about this in the spec that a version < 1 has any special meaning in OSGi the only thing the spec states is that if you do not specify a version on an exported package it defaults to 0.0.0 (what could not be baselined for obvious reasons).
Of course baslining itself is nowhere specified so one could of course do it the way here it just don't sound useful:
- If I care about consumers (of any kind) I would use baselining.
- If my project defines a policy that API can change any time I would still like to get warnings/errors (and maybe then suppress them if I feel its is covered by the policy)
- If I don't care in any way I won't enable baslining until version 1.x is released.