Class VersionValueSource
java.lang.Object
io.github.joke.conventionalversion.VersionValueSource
- All Implemented Interfaces:
org.gradle.api.provider.ValueSource<VersionResult, VersionValueSource.Parameters>
public abstract class VersionValueSource
extends Object
implements org.gradle.api.provider.ValueSource<VersionResult, VersionValueSource.Parameters>
Reads git and calculates the version, as a value source.
A ValueSource rather than a direct call during configuration: Gradle re-executes one on
every build specifically to decide whether a cached entry is still valid. Reading git directly
would bake the answer into the configuration cache entry, and the build would keep publishing a
version derived from an older commit until something unrelated invalidated the entry.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceEverything that can change the answer, so that changing any of it re-runs the calculation. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.provider.ValueSource
getParameters
-
Constructor Details
-
VersionValueSource
public VersionValueSource()
-
-
Method Details
-
obtain
- Specified by:
obtainin interfaceorg.gradle.api.provider.ValueSource<VersionResult, VersionValueSource.Parameters>
-