Package io.github.gmazzo.gitversion
Class GitVersionValueSource
-
- All Implemented Interfaces:
-
org.gradle.api.provider.ValueSource
public abstract class GitVersionValueSource implements ValueSource<String, GitVersionValueSource.Params>
A ValueSource that computes the version based on the latest git tag (optional filtering by GitVersionValueSource.Params.tagPrefix).
The version is computed as follows:
If the current commit is tagged, the version is the tag name.
If the current commit is not tagged, the version is the tag name of the latest tag reachable from the current commit suffixed with
-SNAPSHOT.If there are no tags, the version is
0.1.0-SNAPSHOT(configured through GitVersionValueSource.Params.initialVersion).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceGitVersionValueSource.Params
-
Field Summary
Fields Modifier and Type Field Description private final GitVersionModifierSpecmodifierprivate final Stringcandidateprivate final GitVersionValueSource.Paramsparameters
-
Constructor Summary
Constructors Constructor Description GitVersionValueSource(ExecOperations execOperations)
-
Method Summary
Modifier and Type Method Description final GitVersionModifierSpecgetModifier()final StringgetCandidate()Stringobtain()final StringexactTag(String tagPrefix)final StringclosestTag(String tagPrefix, Boolean warnIfMissing)final IntegertagsCount(String tagPrefix)final Stringcommand(String args, Function1<String, Unit> onError)-
Methods inherited from class io.github.gmazzo.gitversion.GitVersionValueSource
getParameters -
Methods inherited from class org.gradle.api.provider.ValueSource
getParameters -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getModifier
final GitVersionModifierSpec getModifier()
-
getCandidate
final String getCandidate()
-
closestTag
final String closestTag(String tagPrefix, Boolean warnIfMissing)
-
-
-
-