zafarkhaja / jsemver

Java implementation of the SemVer Specification
MIT License
429 stars 82 forks source link

Not easy to set major, minor, patch of an existing version. #36

Closed agentgt closed 6 months ago

agentgt commented 7 years ago

The API makes it easy to increment a major,minor,patch but does not make it easy to replace any of those with an explicit amount.

That is I would expect the API to have something like:

Version.valueOf("1.0.0") .withPatch(2).toString() == "1.0.2"

And of course if you have build meta data that would be preserved as well and this is of course would be an immutable operation (ie creates another Version).

asarkar commented 3 years ago

I don't think this library is maintained any more. You may want to check out https://github.com/asarkar/jsemver.

zafarkhaja commented 1 year ago

Hello Adam! Sorry it took me this long to get back to you.

If it's still relevant to you, could you please tell me what use case you had in mind for this feature?

Setting version to an arbitrary number doesn't make a lot of sense to me in the context of software versioning, to be honest. Unless you want some kind of a version builder, maybe? In that case, Version.Builder could be upgraded with new methods.

agentgt commented 10 months ago

@zafarkhaja sorry I can't remember exactly. It was so long ago but IIRC had written some custom release plugins and I think I need to basically decrement or increment to test if some version was deployed.

zafarkhaja commented 6 months ago

Still think the Version.Builder should be sufficient for this, let me know if I'm wrong.