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).