Class GitConventionalVersioning
- java.lang.Object
-
- net.videki.semver.cc.release.common.GitConventionalVersioning
-
- All Implemented Interfaces:
ConventionalVersioning
public class GitConventionalVersioning extends Object implements ConventionalVersioning
Conventional commits version handler facade for a specific git repository. Use this for version resolution and handling of git repositories.
-
-
Constructor Summary
Constructors Constructor Description GitConventionalVersioning(org.eclipse.jgit.lib.Repository repository)Constructor to be used with a specific repo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SemanticVersionChangegetNextVersionChangeType()Calculates the change type ro calculate the next (release) version based on the commits since the last tag.SemanticVersiongetReleaseVersion(SemanticVersion currentVersion)Returns the actual release version based on the commits.LogHandlerlogHandler()Returns the configured log handler for behaviourial logging.
-
-
-
Method Detail
-
logHandler
public LogHandler logHandler()
Returns the configured log handler for behaviourial logging.- Specified by:
logHandlerin interfaceConventionalVersioning- Returns:
- The log handler.
-
getNextVersionChangeType
public SemanticVersionChange getNextVersionChangeType() throws ScmApiException, IOException
Calculates the change type ro calculate the next (release) version based on the commits since the last tag.- Specified by:
getNextVersionChangeTypein interfaceConventionalVersioning- Returns:
- The top-most change type according to the commits.
- Throws:
ScmApiException- thrown in case os SCM-related errors.IOException- thrown in case of any IO issues.
-
getReleaseVersion
public SemanticVersion getReleaseVersion(SemanticVersion currentVersion) throws IOException, ScmApiException
Returns the actual release version based on the commits.- Specified by:
getReleaseVersionin interfaceConventionalVersioning- Parameters:
currentVersion- The current (semantic) version.- Returns:
- The release version (semantic version) to be passed over to the maven release plugin.
- Throws:
IOException- thrown in case of any IO issues.ScmApiException- thrown in case os SCM-related errors.
-
-