Conversation
This is an attempt to improve the compatibility with Semver v2 as defined by https://semver.org/ by introducing **jsemver** as internal representation for the Version class. Note that these changes lead to slightly different behavior in the increment methods. Previously, the respective version level would be increased while setting all less important numbers (to the right) to zero. For instance ```java new Version("1.2.0-SNAPSHOT").getNextMinorVersion() // 1.3.0 ``` With basing the internal representation on jsemver this changed to ```java new Version("1.2.0-SNAPSHO").getNextMinorVersion() // 1.2.0 ``` Similar different behavior can be observed for the other parts. With jsemver as internal representation we could easily support more of Semver specification in _gestalt_ by exposing both the full _prerelease_ information and the _build metadata_. I'd also like to offer methods for version increments which will directly set the prerelease information, like ```java version.getNextMinorVersion("SNAPSHOT") ``` This would be helpful for implementing CLI tooling in Terasology to easily prepare a specific release and switch to the next snapshot version. Please feel free to share suggestions or opinions on this. I was also considering to implement the Semver specification from scratch or whether we should fork the whole project...
Member
|
Looks good, I would be happy to have further functionality exposed. I guess the state of the jsemver library is something we'll have to keep an eye on - as it hasn't had its first major version release yet, nor is it in maven central (also a problem for gestalt, which I would like to address one day). |
Member
Author
Agreed on both. In worst case we'll have to add gestalt-semver and maintain it ourselves 🙈 |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an attempt to improve the compatibility with Semver v2 as
defined by https://semver.org/ by introducing jsemver as internal
representation for the Version class.
Note that these changes lead to slightly different behavior in the
increment methods. Previously, the respective version level would be
increased while setting all less important numbers (to the right) to
zero. For instance
With basing the internal representation on jsemver this changed to
Similar different behavior can be observed for the other parts.
With jsemver as internal representation we could easily support more of
Semver specification in gestalt by exposing both the full prerelease
information and the build metadata.
I'd also like to offer methods for version increments which will
directly set the prerelease information, like
This would be helpful for implementing CLI tooling in Terasology to
easily prepare a specific release and switch to the next snapshot
version.
Please feel free to share suggestions or opinions on this. I was also
considering to implement the Semver specification from scratch or
whether we should fork the whole project...