Package com.xenoterracide.gradle.git
Class GitExtension
java.lang.Object
com.xenoterracide.gradle.git.GitExtension
- All Implemented Interfaces:
Provides<GitMetadata>
-
Method Summary
Modifier and TypeMethodDescriptionwill find the common ancestor between this branch and the given remote reference that is in your local git databse.org.gradle.api.provider.Provider<String> Gets the current branch.org.gradle.api.provider.Provider<String> Gets the current commit.org.gradle.api.provider.Provider<Boolean> getDirty()Gets dirty status.org.gradle.api.provider.Provider<Long> Gets commit distance.org.gradle.api.provider.Provider<GitMetadata> Returns a provider of the value.org.gradle.api.provider.Provider<List<GitRemoteForGradle>> Gets the list of remotes.org.gradle.api.provider.Provider<GitStatus> Gets the status.org.gradle.api.provider.Provider<String> getTag()Gets latest tag.org.gradle.api.provider.Provider<String> Short version of a commit SHA.
-
Method Details
-
getProvider
Description copied from interface:ProvidesReturns a provider of the value.- Specified by:
getProviderin interfaceProvides<GitMetadata>- Returns:
- a provider of the value
-
getBranch
Gets the current branch.- Returns:
- the current branch
-
getUniqueShort
Short version of a commit SHA.- Returns:
- SHA. Length starts at 8 but may grow as repository does
-
getTag
Gets latest tag.- Returns:
- the latest tag
-
getDistance
Gets commit distance.- Returns:
- the commit distance
-
getDirty
Gets dirty status.- Returns:
- the status
-
getStatus
Gets the status.- Returns:
- the status
-
getCommit
Gets the current commit.- Returns:
- the current commit
-
getRemotes
Gets the list of remotes.- Returns:
- the list of remotes
-
commonAncestorDistanceFor
will find the common ancestor between this branch and the given remote reference that is in your local git databse. Essentially this is the distance from a tag from agit merge base.- Parameters:
remote- the remote- Returns:
- the distance
-