Interface VersionEvaluator
- All Known Subinterfaces:
VersionEvaluatorProvider
- All Known Implementing Classes:
VersionEvaluatorProvider
public interface VersionEvaluator
Defines a configurable version evaluator.
-
Method Summary
Modifier and TypeMethodDescriptiondirtyFiles(org.eclipse.jgit.lib.Repository repository, Path subDir) Searches the sub directory for changes (any of combines added, changed, removed, missing, modified, conflicting or untracked).static VersionEvaluatorforRepository(org.eclipse.jgit.lib.Repository repository) Creates a version evaluator for the given repository.static VersionEvaluatorforRepository(org.eclipse.jgit.lib.Repository repository, ClassLoader classLoader) Creates a version evaluator for the given repository.subDirectory(Path subDirectory) Sets the sub directory of the work tree that is relevant for evaluating the version.Sets the tag filter to use.tagProcessor(TagProcessor tagProcessor) Sets the tag processor to use.version()Returns the evaluated version.
-
Method Details
-
forRepository
static VersionEvaluator forRepository(org.eclipse.jgit.lib.Repository repository, ClassLoader classLoader) Creates a version evaluator for the given repository. The implementation is looked up using the [ServiceLoader] mechanism with the given class loader.- Parameters:
repository- the repositoryclassLoader- the class loader- Returns:
- the version evaluator
-
forRepository
Creates a version evaluator for the given repository. The implementation is looked up using the [ServiceLoader] mechanism, using the class loaders of the current thread and the [VersionEvaluator] class.- Parameters:
repository- the repository- Returns:
- the version evaluator
-
dirtyFiles
static List<Path> dirtyFiles(org.eclipse.jgit.lib.Repository repository, Path subDir) throws org.eclipse.jgit.api.errors.GitAPIException Searches the sub directory for changes (any of combines added, changed, removed, missing, modified, conflicting or untracked).- Parameters:
repository- the repositorysubDir- the sub dir- Returns:
- true, if is dirty
- Throws:
org.eclipse.jgit.api.errors.GitAPIException- the git API exception
-
subDirectory
Sets the sub directory of the work tree that is relevant for evaluating the version. Usually, only files in this directory are checked for changes, resulting in a "dirty" in the version.- Parameters:
subDirectory- the sub directory- Returns:
- the version evaluator
-
tagFilter
Sets the tag filter to use.- Parameters:
tagFilter- the tag filter- Returns:
- the version evaluator
-
tagProcessor
Sets the tag processor to use.- Parameters:
tagProcessor- the tag processor- Returns:
- the version evaluator
-
version
-