public class DetermineGitVersion
extends org.gradle.api.internal.ConventionTask
| Constructor and Description |
|---|
DetermineGitVersion() |
| Modifier and Type | Method and Description |
|---|---|
void |
determineVersion()
Determines the version and stores it in the target file.
|
SemVersion |
getCachedVersion()
Gets the version that was written to the target file by a previous invocation
of this task.
|
java.io.File |
getGitDirectory()
Gets the full path of the .git directory of the Git repository that will be used for versioning.
|
java.lang.String |
getOverrideBranchName()
Gets the branch name that will be used for versioning.
|
java.io.File |
getRepositoryLocation()
Gets the location of the Git repository.
|
RulesContainer |
getRules() |
java.io.File |
getTargetFile()
Gets the target file to which the version will be written.
|
void |
setOverrideBranchName(java.lang.String overrideBranchName)
Sets the branch name that should be used for versioning.
|
void |
setRepositoryLocation(java.io.File repositoryLocation)
Sets the location of the Git repository that will be used for versioning.
|
void |
setRules(RulesContainer rules) |
void |
setTargetFile(java.io.File targetFile)
Sets the target file to which the version will be written.
|
conventionMapping, conventionMapping, getConventionMappingaddValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActionClassLoaders, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString@Internal public java.io.File getRepositoryLocation()
public void setRepositoryLocation(java.io.File repositoryLocation)
The repository location may be either the work tree root, any subdirectory under it, or the .git directory. The location of the actual .git directory will then be determined from this path, and used as an input directory for the task.
repositoryLocation - the full path to the repository@InputDirectory @Optional @Nullable public java.io.File getGitDirectory()
@Internal @Nullable public RulesContainer getRules()
public void setRules(RulesContainer rules)
@Input @Optional public java.lang.String getOverrideBranchName()
null if the repository HEAD is usedpublic void setOverrideBranchName(java.lang.String overrideBranchName)
By default (if this property is null), the Git repository's HEAD branch is used.
overrideBranchName - the branch name, or null to use the repository HEAD@OutputFile public java.io.File getTargetFile()
public void setTargetFile(java.io.File targetFile)
targetFile - the full path to the target file@Nullable @Internal public SemVersion getCachedVersion() throws java.io.IOException
SemVersion parsed from the contents of the version file that was previously written;
null if the file does not existjava.io.IOException - for I/O errorspublic void determineVersion()
throws java.io.IOException
java.io.IOException - for I/O errors