ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Radeski" <a...@radeski.net>
Subject Re: OSGi friendly LatestRevisionStrategy patch
Date Mon, 01 Sep 2008 10:18:11 GMT
On 9/1/08, Tony Sweeney <tony.sweeney@springsource.com> wrote:

> > For example, from the LatestRevisionStrategyTest.testComparator()
> > test, the natural order of both OSGi and non-OSGi versions is:
> > 0.2a, 0.2_b, 0.2rc1, 0.2-final, 1.0-dev1, 1.0-dev2, 1.0-alpha1,
> > 1.0-alpha2, 1.0-beta1, 1.0-beta2, 1.0-gamma, 1.0-rc1, 1.0-rc2, 1.0,
> > 1.0.1, 2.0, 2.0.0, 2.0.0.b006, 2.0.0.b012, 2.0.0.xyz

> Note that several of your examples are not valid OSGi revision numbers.
> The syntax for OSGi is "major[.minor[.micro[.qualifier]]]" where major,
> minor and micro can only be numeric, and qualifier is the only part of a
> version number which can contain alphanumeric characters, from the character
> range [a-zA-Z0-9], '_' and '-'. If the minor or micro number is absent it should
> sort as 0 (i.e. 2.1 == 2.1.0), and the sort order of qualifier is a natural
> alphabetical sort. You can only have a qualifier if you have all three numeric
> components, so only the versions from 1.0 onwards in your list are valid.

Yep, what I was adding was OSGi version compatibility to the existing
Latest Strategy impl,
not strict conformance. I appended the OSGi versions to the existing
test case (these are
the non-osgi versions you mentioned above), which in hind sight
probably wasn't the best idea.

> > However, the current implementation produces the following, where the
> > last four elements are in the wrong order:
> > 0.2a, 0.2_b, 0.2rc1, 0.2-final, 1.0-dev1, 1.0-dev2, 1.0-alpha1,
> > 1.0-alpha2, 1.0-beta1, 1.0-beta2, 1.0-gamma, 1.0-rc1, 1.0-rc2, 1.0,
> > 1.0.1, 2.0, 2.0.0.b006, 2.0.0.b012, 2.0.0.xyz, 2.0.0

> 2.0.0 should sort with 2.0 before all of the 2.0.0 versions with a qualifier,
> so if your patch fixes that then it's an improvement.

Yep, the patch does order them all correctly (non-osgi and osgi
versions together). However, the testing
is limited to that done in the Ivy test suite. There  is a small
possibility that in the wild there are more exotic
versions strings than may be ordered incorrectly. As per Xaviers
suggestion, it may be better to provide an alternative
Latest Strategy than patching the existing one, but I'll leave that
decision to you guys.

Alex.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message