Configurable extension properties of the egg-pmd plugin. When applied to a project, it defines the version right away now.
| Type | Name and description |
|---|---|
boolean |
annotatedTagsOnlyUse only annotated tags. |
boolean |
firstParentOnlyOnly visit the first parent, when searching for tags. |
boolean |
longFormatAlways use the long format? |
java.lang.String |
matchThe match clause that is used to match the tags describing this projects version. |
groovy.lang.Closure |
postProcessVersionIf you need to post-process the version yielded |
groovy.lang.Closure |
replaceGlobWithHow to figure out the version from the matched tag. |
MonotonouslyIncreasingVersionNumber |
versionNumberA scheme to define a monotonously increasing number from the versioning data. |
int |
versionNumberPaddingHow much padding should be used on the different places of the versionNumber. |
| Constructor and description |
|---|
VersioningExtension
(org.gradle.api.Project project) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static java.lang.String |
createRegexFromGlob(java.lang.String glob)Create a regex from a (simplified) glob pattern. |
|
java.lang.String |
describeLongVersion()Takes all options and calculates the long version with them, so longFormat is always set to true. |
|
java.lang.String |
describeVersion()Describe the version using git describe. |
|
boolean |
exactMatch()Returns true, if HEAD is currently pointing at a commit that has a tag (that matches the options of git describe). |
|
long |
versionNumber()Determine a monotonously increasing version number from the tags and number of commits. |
| 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() |
Use only annotated tags.
Only visit the first parent, when searching for tags. See 'man git describe'
Always use the long format?
The match clause that is used to match the tags describing this projects version.
If you need to post-process the version yielded
How to figure out the version from the matched tag. Default is to trim the prefix.
A scheme to define a monotonously increasing number from the versioning data.
How much padding should be used on the different places of the versionNumber. Use this when your version number CAN be a long instead of an int.
Create a regex from a (simplified) glob pattern. Not currently used except in tests, but maybe we wanna use grgit in the future. So we might need it again to match the tags...
Takes all options and calculates the long version with them, so longFormat is always set to true.
Describe the version using git describe.
You can add an optional 'match' glob, that will cause git describe to only match certain tags.
By default, this is considered a prefix to the 'real' version number and is stripped away using
GlobReplace.REPLACE_PREFIX.
If this is not what you want, you can pass a closure, taking two arguments (glob, tag) to
figure out how you want the version called.
Example uses:
describeVersion(), describeVersion(match: "database-*")
For all options,
Returns true, if HEAD is currently pointing at a commit that has a tag (that matches the options of git describe).
Determine a monotonously increasing version number from the tags and number of commits.
Groovy Documentation