Class to hold semantic version details
| Type | Name and description |
|---|---|
int |
ciBuildNumberBuild number as determined by CI |
java.lang.String |
currentBranchThe name of the current branch |
java.lang.String |
gitMajorVersionMajor version as read from git, this may not be the same as the desired version |
java.lang.String |
gitMinorVersionMinor version as read from git, this may not be the same as the desired version |
java.lang.Integer |
gitPatchVersionPatch version as read from git |
boolean |
isCIIs the build being performed by CI? |
boolean |
isUntaggedThe current currentBranch has not yet been tagged with a version number |
java.lang.String |
majorVersionMajor version as set by user |
java.lang.String |
masterBranch |
java.lang.String |
minorVersionMinor version as set by user |
java.lang.Integer |
patchVersionPatch version |
java.lang.String |
versionsemantic version, also including details of the branch if not master and SNAPSHOT if not running as CI |
| Type | Name and description |
|---|---|
void |
evaluateCurrentGitBranch()Get the current git branch and save it |
void |
evaluateGitVersion()Evaluate the version from git and save it The branch is assumed to be untagged if the number of additional commits on top of the tag, as returned by git describe, is 0 or there are no tags matching "vXXX-XXX-XXX. |
java.lang.String |
gitVersionTag()Composes the String for the git tag evaluateGitVersion() needs to have been called before calling this method |
boolean |
isMasterBranch() |
void |
readGit()Reads information from git and sets internal variables appropriately |
boolean |
shouldBuildGitTag()Logic for if we should do a git build tag |
boolean |
shouldVersionGitTag()Logic for if we should do a git version tag |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Build number as determined by CI
The name of the current branch
Major version as read from git, this may not be the same as the desired version
Minor version as read from git, this may not be the same as the desired version
Patch version as read from git
Is the build being performed by CI?
The current currentBranch has not yet been tagged with a version number
Major version as set by user
Minor version as set by user
Patch version
semantic version, also including details of the branch if not master and SNAPSHOT if not running as CI
Get the current git branch and save it
Evaluate the version from git and save it The branch is assumed to be untagged if the number of additional commits on top of the tag, as returned by git describe, is 0 or there are no tags matching "vXXX-XXX-XXX. git describe returns "tag-commits-hash", where commits is a number. It requires the current branch to have been evaluated before calling this method.
Composes the String for the git tag evaluateGitVersion() needs to have been called before calling this method
Reads information from git and sets internal variables appropriately
Logic for if we should do a git build tag Only if we are the CI
Logic for if we should do a git version tag Only if we are CI, we are on the master branch and we haven't done the version tag yet in a previous build