public class GitVersionExtension
extends java.lang.Object
gitVersion block.| Modifier and Type | Method and Description |
|---|---|
SemVersion |
determineVersion() |
SemVersion |
getCachedVersion()
Gets the version that was written to a file by an earlier invocation of
a
DetermineGitVersion task. |
java.lang.Object |
getLazyVersion()
Returns a lazily-evaluated object that can be assigned to the
Project.version
property. |
RulesContainer |
getRules()
Gets the container object that represents the versioning rules.
|
void |
rules(org.gradle.api.Action<RulesContainer> action)
Configures the rules using an action.
|
void |
rules(groovy.lang.Closure closure)
Configures the
rules container using a closure. |
@Nonnull public RulesContainer getRules()
RulesContainerpublic void rules(org.gradle.api.Action<RulesContainer> action)
action - the configuration Actionpublic void rules(@DelegatesTo(value=RulesContainer.class) groovy.lang.Closure closure)
rules container using a closure.closure - the configuration closure, executed in the context of the RulesContainer@Nonnull public SemVersion determineVersion()
@Nullable public SemVersion getCachedVersion() throws java.io.IOException
DetermineGitVersion task.null if the version file does not existjava.io.IOException - on I/O errors@Nonnull public java.lang.Object getLazyVersion()
Project.version
property. The version is only calculated the first time its toString() method is
called.
If at the time of evaluation, the version cannot be determined, the toString() method will return
an empty string.