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.