Adds a method to Version to get the next logical Version. This was necessary for some automatic tagging we set up in Jenkins and I thought it may be useful to others.
Here are the rules:
For the simple case it merely increments the least significant number (either the patch or pre-release number). To move between significant releases (E.g. 1.0 -> 1.1 or 1.0.0-alpha.5 -> 1.0.0-beta.0) a base version can be given. If the current version is less than the base version then the base will be the next version. If they are equal then the least significant number is incremented. If the current version is ahead of the base the least significant version is incremented from the current version, though if the base is in a pre-release state and the current is not then the version has not been updated with consistency and is considered an error.
Adds a method to Version to get the next logical Version. This was necessary for some automatic tagging we set up in Jenkins and I thought it may be useful to others.
Here are the rules:
For the simple case it merely increments the least significant number (either the patch or pre-release number). To move between significant releases (E.g. 1.0 -> 1.1 or 1.0.0-alpha.5 -> 1.0.0-beta.0) a base version can be given. If the current version is less than the base version then the base will be the next version. If they are equal then the least significant number is incremented. If the current version is ahead of the base the least significant version is incremented from the current version, though if the base is in a pre-release state and the current is not then the version has not been updated with consistency and is considered an error.