-
public final class GitVersionServiceCalculate the version from a Git Repository. The repository uses GitFlow for the development. The start parameter is the local source directory.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classGitVersionService.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Gitclientprivate final Repositoryrepositoryprivate final Stringbranchprivate StringmainBranchprivate StringdevelopBranchprivate StringhotfixPrefixprivate StringfeaturePrefixprivate StringreleasePrefixprivate StringversionPrefixprivate Stringseparatorprivate BooleanlocalOnlyprivate Booleanshortenedprivate VersiondefaultVersionprivate final Stringversionprivate final StringcontainerVersionprivate final StringrevIDprivate final StringpreviousVersion
-
Constructor Summary
Constructors Constructor Description GitVersionService(File directory, VersionType versionType)creates the service from a directory GitVersionService(File directory)creates the service from a directory
-
Method Summary
Modifier and Type Method Description final GitgetClient()Git client for the existing working copy. final RepositorygetRepository()Repository for the existing working copy. final StringgetBranch()This is the current branch name. final StringgetMainBranch()Name of the main branch. final UnitsetMainBranch(String mainBranch)Name of the main branch. final StringgetDevelopBranch()Name of the develop branch. final UnitsetDevelopBranch(String developBranch)Name of the develop branch. final StringgetHotfixPrefix()Prefix of a hotfix branch. final UnitsetHotfixPrefix(String hotfixPrefix)Prefix of a hotfix branch. final StringgetFeaturePrefix()Prefix of a feature branch. final UnitsetFeaturePrefix(String featurePrefix)Prefix of a feature branch. final StringgetReleasePrefix()Prefix of a release branch. final UnitsetReleasePrefix(String releasePrefix)Prefix of a release branch. final StringgetVersionPrefix()Prefix of a version tag. final UnitsetVersionPrefix(String versionPrefix)Prefix of a version tag. final StringgetSeparator()Separator for prefix and branch name. final UnitsetSeparator(String separator)Separator for prefix and branch name. final BooleangetLocalOnly()Version can be set for development to local only. final UnitsetLocalOnly(Boolean localOnly)Version can be set for development to local only. final BooleangetShortened()Version is shortened for branches and hotfixes with an hash for the string if shortened is true. final UnitsetShortened(Boolean shortened)Version is shortened for branches and hotfixes with an hash for the string if shortened is true. final VersiongetDefaultVersion()Default version. final UnitsetDefaultVersion(Version defaultVersion)Default version. final StringgetVersion()This is the calculated version of the Git repository. final StringgetContainerVersion()This is the calculated containerVersion of the Git repository. final StringgetRevID()final StringgetPreviousVersion()This is the calculated previous version from the Git repository. final RevCommitgetRevObjectFrom(Version version)Calculates the commit for a specified version. -
-
Constructor Detail
-
GitVersionService
GitVersionService(File directory, VersionType versionType)
creates the service from a directory- Parameters:
directory- local source directoryversionType- default value com.intershop.release.version.VersionType.fourDigits.
-
GitVersionService
GitVersionService(File directory)
creates the service from a directory- Parameters:
directory- local source directory
-
-
Method Detail
-
getClient
final Git getClient()
Git client for the existing working copy.
-
getRepository
final Repository getRepository()
Repository for the existing working copy.
-
getMainBranch
final String getMainBranch()
Name of the main branch. Default value is master.
-
setMainBranch
final Unit setMainBranch(String mainBranch)
Name of the main branch. Default value is master.
-
getDevelopBranch
final String getDevelopBranch()
Name of the develop branch. Default value is develop.
-
setDevelopBranch
final Unit setDevelopBranch(String developBranch)
Name of the develop branch. Default value is develop.
-
getHotfixPrefix
final String getHotfixPrefix()
Prefix of a hotfix branch. Default value is hotfix.
-
setHotfixPrefix
final Unit setHotfixPrefix(String hotfixPrefix)
Prefix of a hotfix branch. Default value is hotfix.
-
getFeaturePrefix
final String getFeaturePrefix()
Prefix of a feature branch. Default value is feature.
-
setFeaturePrefix
final Unit setFeaturePrefix(String featurePrefix)
Prefix of a feature branch. Default value is feature.
-
getReleasePrefix
final String getReleasePrefix()
Prefix of a release branch. Default value is release.
-
setReleasePrefix
final Unit setReleasePrefix(String releasePrefix)
Prefix of a release branch. Default value is release.
-
getVersionPrefix
final String getVersionPrefix()
Prefix of a version tag. Default value is version.
-
setVersionPrefix
final Unit setVersionPrefix(String versionPrefix)
Prefix of a version tag. Default value is version.
-
getSeparator
final String getSeparator()
Separator for prefix and branch name. Default value is /.
-
setSeparator
final Unit setSeparator(String separator)
Separator for prefix and branch name. Default value is /.
-
getLocalOnly
final Boolean getLocalOnly()
Version can be set for development to local only.
-
setLocalOnly
final Unit setLocalOnly(Boolean localOnly)
Version can be set for development to local only.
-
getShortened
final Boolean getShortened()
Version is shortened for branches and hotfixes with an hash for the string if shortened is true.
-
setShortened
final Unit setShortened(Boolean shortened)
Version is shortened for branches and hotfixes with an hash for the string if shortened is true.
-
getDefaultVersion
final Version getDefaultVersion()
Default version. Default value is Version.Builder(versionType).build().
-
setDefaultVersion
final Unit setDefaultVersion(Version defaultVersion)
Default version. Default value is Version.Builder(versionType).build().
-
getVersion
final String getVersion()
This is the calculated version of the Git repository.
-
getContainerVersion
final String getContainerVersion()
This is the calculated containerVersion of the Git repository.
-
getPreviousVersion
final String getPreviousVersion()
This is the calculated previous version from the Git repository.
-
getRevObjectFrom
final RevCommit getRevObjectFrom(Version version)
Calculates the commit for a specified version.
- Parameters:
version- is the a version
-
-
-
-