Class VersionEvaluatorProvider
java.lang.Object
org.jdrupes.gitversioning.core.VersionEvaluatorProvider
- All Implemented Interfaces:
VersionEvaluator, VersionEvaluatorProvider
Reference implementation of
VersionEvaluatorProvider.
Finds the latest semantically versioned tag reachable from HEAD using the
configured TagFilter, then delegates to the configured
TagProcessor to produce the final version string.
Uses a ConcurrentHashMap to cache the set of
commits reachable from HEAD, avoiding redundant graph walks.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new evaluator provider with default tag filter and processor. -
Method Summary
Modifier and TypeMethodDescriptionReturns a stream of "dirty" (uncommitted or untracked) files in the work tree that match the configured file selection.matchingAntPattern(String pattern) Include all files matching the given Ant pattern when evaluating the version.matchingGlob(String glob) Include all files matching the given glob expression when evaluating the version.matchingRegex(String regex) Include all files matching the given regular expression when evaluating the version.Returns a stream of files modified since the latest version tag that match the configured file selection.org.eclipse.jgit.lib.RepositoryReturns the evaluator's repository.repository(org.eclipse.jgit.lib.Repository repository) Sets the repository to use.subDirectory(Path subDirectory) Include all files under the given sub-directory when evaluating the version.Sets the tag filter to use.tagProcessor(TagProcessor tagProcessor) Sets the tag processor to use.version()Evaluates and returns the version string for the current repository state.
-
Field Details
-
log
-
-
Constructor Details
-
VersionEvaluatorProvider
public VersionEvaluatorProvider()Creates a new evaluator provider with default tag filter and processor.
-
-
Method Details
-
repository
Description copied from interface:VersionEvaluatorProviderSets the repository to use.- Specified by:
repositoryin interfaceVersionEvaluatorProvider- Parameters:
repository- the Git repository- Returns:
- this provider for chaining
-
repository
Description copied from interface:VersionEvaluatorReturns the evaluator's repository.- Specified by:
repositoryin interfaceVersionEvaluator- Returns:
- the repository
-
tagFilter
Description copied from interface:VersionEvaluatorSets the tag filter to use. The filter determines which tags are recognized as version tags and extracts the version string from them.- Specified by:
tagFilterin interfaceVersionEvaluator- Parameters:
tagFilter- the tag filter- Returns:
- this evaluator for chaining
-
tagProcessor
Description copied from interface:VersionEvaluatorSets the tag processor to use. The processor generates the final version string from the tag name and parsed version.- Specified by:
tagProcessorin interfaceVersionEvaluator- Parameters:
tagProcessor- the tag processor- Returns:
- this evaluator for chaining
-
matchingGlob
Description copied from interface:VersionEvaluatorInclude all files matching the given glob expression when evaluating the version.- Specified by:
matchingGlobin interfaceVersionEvaluator- Parameters:
glob- the glob expression- Returns:
- this evaluator for chaining
-
matchingRegex
Description copied from interface:VersionEvaluatorInclude all files matching the given regular expression when evaluating the version.- Specified by:
matchingRegexin interfaceVersionEvaluator- Parameters:
regex- the regular expression- Returns:
- this evaluator for chaining
-
matchingAntPattern
Description copied from interface:VersionEvaluatorInclude all files matching the given Ant pattern when evaluating the version.- Specified by:
matchingAntPatternin interfaceVersionEvaluator- Parameters:
pattern- the Ant pattern- Returns:
- this evaluator for chaining
-
subDirectory
Description copied from interface:VersionEvaluatorInclude all files under the given sub-directory when evaluating the version.- Specified by:
subDirectoryin interfaceVersionEvaluator- Parameters:
subDirectory- the sub-directory, relative to the repository work tree or absolute- Returns:
- this evaluator for chaining
-
dirtyFiles
Description copied from interface:VersionEvaluatorReturns a stream of "dirty" (uncommitted or untracked) files in the work tree that match the configured file selection.- Specified by:
dirtyFilesin interfaceVersionEvaluator- Returns:
- a stream of paths
-
modifiedFiles
Description copied from interface:VersionEvaluatorReturns a stream of files modified since the latest version tag that match the configured file selection.- Specified by:
modifiedFilesin interfaceVersionEvaluator- Returns:
- a stream of paths
-
version
Description copied from interface:VersionEvaluatorEvaluates and returns the version string for the current repository state.- Specified by:
versionin interfaceVersionEvaluator- Returns:
- the version string
-