public abstract class VersionStrategy extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
VersionStrategy.StrategySearchMode |
| Constructor and Description |
|---|
VersionStrategy(VersionNamingConfiguration vnc,
org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.api.Git git,
MetadataRegistrar registrar)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Version |
build(Commit head,
List<Commit> parents)
Build a version using the given information extracted from the git repository.
|
protected TagType |
computeTagType(org.eclipse.jgit.lib.Ref tagToUse,
org.eclipse.jgit.lib.Ref annotatedTag) |
boolean |
considerTagAsAVersionOne(org.eclipse.jgit.lib.Ref tag) |
protected Version |
enhanceVersionWithBranch(Version baseVersion,
String branch) |
protected org.eclipse.jgit.api.Git |
getGit() |
protected MetadataRegistrar |
getRegistrar() |
protected org.eclipse.jgit.lib.Repository |
getRepository() |
protected VersionNamingConfiguration |
getVersionNamingConfiguration() |
protected boolean |
isBaseCommitOnHead(Commit head,
Commit base) |
int |
searchDepthLimit()
Defines the history commit depth, starting from HEAD, until which parent commits will be parsed to find tags
information.
|
VersionStrategy.StrategySearchMode |
searchMode() |
public VersionStrategy(VersionNamingConfiguration vnc, org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.api.Git git, MetadataRegistrar registrar)
vnc - the configuration to userepository - the git repositorygit - a git helper object built from the repositoryregistrar - a storage for found/calculated metadataprotected MetadataRegistrar getRegistrar()
public abstract Version build(Commit head, List<Commit> parents) throws VersionCalculationException
head - cannot be null the current head commitparents - a non null list of commits that will be involved in version naming.
The list cannot be null and contains the first commit of the repository if no commit with version tag can be found.VersionCalculationException - in case an error occurred while computing the versionpublic int searchDepthLimit()
searchMode()
is VersionStrategy.StrategySearchMode.DEPTH.public boolean considerTagAsAVersionOne(org.eclipse.jgit.lib.Ref tag)
public VersionStrategy.StrategySearchMode searchMode()
protected TagType computeTagType(org.eclipse.jgit.lib.Ref tagToUse, org.eclipse.jgit.lib.Ref annotatedTag)
protected VersionNamingConfiguration getVersionNamingConfiguration()
protected org.eclipse.jgit.lib.Repository getRepository()
protected org.eclipse.jgit.api.Git getGit()
Copyright © 2016–2018 Matthieu Brouillard. All rights reserved.