public class GitVersionService
Calculate the version from a Git Repository. The repository uses GitFlow for the development. The start parameter is the local source directory.
public static com.intershop.gradle.gitflow.utils.GitVersionService.Companion Companion
@JvmOverloads
public GitVersionService(@NotNull
java.io.File directory,
@NotNull
com.intershop.release.version.VersionType versionType)
creates the service from a directory
directory - local source directoryversionType - default value com.intershop.release.version.VersionType.fourDigits.@JvmOverloads
public GitVersionService(@NotNull
java.io.File directory)
creates the service from a directory
directory - local source directory@NotNull public org.eclipse.jgit.api.Git getClient()
Git client for the existing working copy.
@NotNull public org.eclipse.jgit.lib.Repository getRepository()
Repository for the existing working copy.
@NotNull public java.lang.String getBranch()
This is the current branch name.
@NotNull public java.lang.String getMainBranch()
Name of the main branch. Default value is master.
public void setMainBranch(@NotNull
java.lang.String p)
Name of the main branch. Default value is master.
@NotNull public java.lang.String getDevelopBranch()
Name of the develop branch. Default value is develop.
public void setDevelopBranch(@NotNull
java.lang.String p)
Name of the develop branch. Default value is develop.
@NotNull public java.lang.String getHotfixPrefix()
Prefix of a hotfix branch. Default value is hotfix.
public void setHotfixPrefix(@NotNull
java.lang.String p)
Prefix of a hotfix branch. Default value is hotfix.
@NotNull public java.lang.String getFeaturePrefix()
Prefix of a feature branch. Default value is feature.
public void setFeaturePrefix(@NotNull
java.lang.String p)
Prefix of a feature branch. Default value is feature.
@NotNull public java.lang.String getReleasePrefix()
Prefix of a release branch. Default value is release.
public void setReleasePrefix(@NotNull
java.lang.String p)
Prefix of a release branch. Default value is release.
@NotNull public java.lang.String getVersionPrefix()
Prefix of a version tag. Default value is version.
public void setVersionPrefix(@NotNull
java.lang.String p)
Prefix of a version tag. Default value is version.
@NotNull public java.lang.String getSeparator()
Separator for prefix and branch name. Default value is /.
public void setSeparator(@NotNull
java.lang.String p)
Separator for prefix and branch name. Default value is /.
public boolean getLocalOnly()
Version can be set for development to local only.
public void setLocalOnly(boolean p)
Version can be set for development to local only.
@NotNull public com.intershop.release.version.Version getDefaultVersion()
Default version. Default value is Version.Builder(versionType).build().
public void setDefaultVersion(@NotNull
com.intershop.release.version.Version p)
Default version. Default value is Version.Builder(versionType).build().
@NotNull public java.lang.String getVersion()
This is the calculated version of the Git repository.
@NotNull public java.lang.String getRevID()
The revision id from the working copy (read only).
@Nullable public java.lang.String getPreviousVersion()
This is the calculated previous version from the Git repository.
@Nullable
public org.eclipse.jgit.revwalk.RevCommit getRevObjectFrom(@NotNull
com.intershop.release.version.Version version)
Calculates the commit for a specified version.
version - is the a version