Class VersionValueSource
java.lang.Object
io.github.joke.conventionalversion.VersionValueSource
- All Implemented Interfaces:
org.gradle.api.provider.ValueSource<VersionCatalogue, VersionValueSource.Parameters>
public abstract class VersionValueSource
extends Object
implements org.gradle.api.provider.ValueSource<VersionCatalogue, VersionValueSource.Parameters>
Reads git and release-please's configuration, then calculates every package's version.
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 directly would
bake the answer into the configuration cache entry, and the build would keep publishing a version
derived from an older commit - or from an older configuration - until something unrelated
invalidated the entry.
Its only parameter is the directory to start from. Everything else that changes a number is read from release-please's own files, which is the point: there is no second place to configure it.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<VersionCatalogue.PackageVersion> protected VersionCalculatorprotected VersionCataloguecatalogue(String root, List<LinkedGroup> groups, List<RepositoryStateReader.PackageState> states) protected ConfigurationReaderprotected Stringprotected ManifestReaderprotected CommitMessageParser@Nullable VersionCatalogueobtain()protected JsonParserparser()protected ReleaseConfigurationreadConfiguration(String root) protected RepositoryStateReaderprotected StringManifest mode is required, so an absent file is a failure naming both rather than a fallback.protected Map<String, SemanticVersion> readManifest(String root) protected LinkedVersionReconcilerprotected BumpReducerreducer()protected GitRepositoryrepository(File directory) protected GitCommandRunnerprotected VersionResultEvery state carries the same head sha, so any of them names the commit this build came from.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<VersionCatalogue, VersionValueSource.Parameters>
-
catalogue
@VisibleForTesting protected VersionCatalogue catalogue(String root, List<LinkedGroup> groups, List<RepositoryStateReader.PackageState> states) -
calculateAll
@VisibleForTesting protected List<VersionCatalogue.PackageVersion> calculateAll(List<RepositoryStateReader.PackageState> states) -
unmatched
@VisibleForTesting protected VersionResult unmatched(List<RepositoryStateReader.PackageState> states) Every state carries the same head sha, so any of them names the commit this build came from. -
readConfiguration
-
readManifest
-
readFile
-
contentOf
-
calculator
-
messageParser
-
reducer
-
reconciler
-
parser
-
configurationReader
-
manifestReader
-
reader
-
repository
-
runner
-