public class PatternVersionStrategy extends VersionStrategy<PatternVersionStrategy>
VersionStrategy.StrategySearchMode| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_TAG_VERSION_PATTERN |
static String |
DEFAULT_VERSION_PATTERN |
| Constructor and Description |
|---|
PatternVersionStrategy(VersionNamingConfiguration vnc,
org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.api.Git git,
MetadataRegistrar registrar)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Version |
build(Commit head,
List<Commit> parents)
Build a version using the given information extracted from the git repository.
|
PatternVersionStrategy |
setAutoIncrementPatch(boolean autoIncrementPatch)
Set the parameter to increment automatically patch number for standard versions coming from annotated tag.
|
PatternVersionStrategy |
setTagVersionPattern(String tagVersionPattern)
Set the version pattern to use to compute the final version when HEAD is on a commit with an annotated tag.
|
PatternVersionStrategy |
setVersionPattern(String versionPattern)
Set the version pattern to use to compute the final version.
|
computeTagType, enhanceVersionWithBranch, findMaxVersionCommit, findTagToUse, findVersionCommit, getBaseVersionAndRegisterMetadata, getGit, getRegistrar, getRepository, getVersionNamingConfiguration, isBaseCommitOnHead, isGitDirty, isVersionTag, maxVersionTag, maxVersionTag, runAndGetSelf, searchDepthLimit, searchMode, self, setSearchDepthLimit, tagToVersion, toVersionTarget, toVersionTarget, versionFromTagpublic static final String DEFAULT_VERSION_PATTERN
public static final String DEFAULT_TAG_VERSION_PATTERN
public PatternVersionStrategy(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 metadatapublic Version build(Commit head, List<Commit> parents) throws VersionCalculationException
VersionStrategybuild in class VersionStrategy<PatternVersionStrategy>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 PatternVersionStrategy setVersionPattern(String versionPattern)
versionPattern - a non null string describing the patternpublic PatternVersionStrategy setTagVersionPattern(String tagVersionPattern)
tagVersionPattern - a non null string describing the patternpublic PatternVersionStrategy setAutoIncrementPatch(boolean autoIncrementPatch)
autoIncrementPatch - true to increment the patch number, false otherwiseCopyright © 2016–2021 Matthieu Brouillard. All rights reserved.