Groovy Documentation

org.ajoberstar.gradle.git.tasks
[Java] Class GitClone

java.lang.Object
  org.gradle.api.DefaultTask
      org.ajoberstar.gradle.git.tasks.GitClone
All Implemented Interfaces:
AuthenticationSupported

public class GitClone
extends DefaultTask

Task to clone a Git repository.

Since:
0.1.0


Method Summary
void branchesToClone(java.lang.Object... branches)

Adds branches to clone if cloneAllBranches is set to false.

void cloneRepo()

Clones a Git repository as configured.

void credentials(groovy.lang.Closure closure)

Configured the credentials to be used when cloning the repo.

boolean getBare()

Gets whether the repository will be bare.

java.lang.String getBranch()

Gets the simple name of the branch to checkout if checkout is set to true.

java.util.Collection getBranchesToClone()

Gets the branches to clone if cloneAllBranches is set to false.

boolean getCheckout()

Gets whether or not to checkout the specified branch.

boolean getCloneAllBranches()

Gets whether all branches should be cloned.

PasswordCredentials getCredentials()

Gets the credentials to be used when cloning the repo.

java.io.File getDestinationDir()

Gets the destination directory the repository will be cloned into.

java.lang.String getRef()

Gets the ref to checkout if checkout is set to true.

java.lang.String getRemote()

Gets the name used to track the upstream repository.

java.lang.String getTag()

Gets the simple name of the tag to checkout if checkout is set to true.

java.lang.String getUri()

Gets the URI of the repo to clone.

void setBare(boolean bare)

Sets whether the repository will be bare.

void setBranch(java.lang.Object branch)

Sets the branch to checkout if checkout is set to true.

void setBranchesToClone(java.util.Collection branchesToClone)

Sets branches to clone if cloneAllBranches is set to false.

void setCheckout(boolean checkout)

Sets whether or not to checkout the specified branch.

void setCloneAllBranches(boolean cloneAllBranches)

Sets whether all branches should be cloned.

void setCredentials(PasswordCredentials credentials)

Sets the credentials to use when cloning the repo.

void setDestinationPath(java.lang.Object destinationPath)

Sets the path the repository should be clone into.

void setRef(java.lang.Object ref)

Sets the ref to checkout if checkout is set to true.

void setRemote(java.lang.Object remote)

Sets the name used to track the upstream repository.

void setTag(java.lang.Object tag)

Sets the tag to checkout if checkout is set to true.

void setUri(java.lang.Object uri)

Sets the URI of the repo to clone.

 

Method Detail

branchesToClone

public void branchesToClone(java.lang.Object... branches)
Adds branches to clone if cloneAllBranches is set to false.
Parameters:
branches - the branches to clone


cloneRepo

tion
	public
public void cloneRepo()
Clones a Git repository as configured.


credentials

ssWarnings("rawtypes")
	public
public void credentials(groovy.lang.Closure closure)
Configured the credentials to be used when cloning the repo. This will be passed a PasswordCredentials instance.
Parameters:
closure - the configuration closure


getBare

@Input
	public
public boolean getBare()
Gets whether the repository will be bare.
Returns:
whether the repo will be bare


getBranch

public java.lang.String getBranch()
Gets the simple name of the branch to checkout if checkout is set to true.
Returns:
the branch to checkout or null if ref is not a branch
See Also:
getRef()


getBranchesToClone

@Input
	public
public java.util.Collection getBranchesToClone()
Gets the branches to clone if cloneAllBranches is set to false. If not set, it will default to branch.
Returns:
the branches to clone


getCheckout

@Input
	public
public boolean getCheckout()
Gets whether or not to checkout the specified branch. Defaults to true.
Returns:
whether or not to checkout the branch


getCloneAllBranches

@Input
	public
public boolean getCloneAllBranches()
Gets whether all branches should be cloned.
Returns:
whether all branches should be cloned


getCredentials

@Input
	@Option
al
	public
public PasswordCredentials getCredentials()
Gets the credentials to be used when cloning the repo.
Returns:
the credentials


getDestinationDir

Directory
	public
public java.io.File getDestinationDir()
Gets the destination directory the repository will be cloned into.
Returns:
the path to clone into


getRef

@Input
	public
public java.lang.String getRef()
Gets the ref to checkout if checkout is set to true. Defaults to "refs/heads/master".
Returns:
the ref to checkout
Since:
0.5.0


getRemote

@Input
	public
public java.lang.String getRemote()
Gets the name used to track the upstream repository. Defaults to "origin" if not set.
Returns:
the remote name


getTag

public java.lang.String getTag()
Gets the simple name of the tag to checkout if checkout is set to true.
Returns:
the tag to checkout or null if ref is not a tag
See Also:
getRef()
Since:
0.5.0


getUri

@Input
	public
public java.lang.String getUri()
Gets the URI of the repo to clone.
Returns:
the uri


setBare

public void setBare(boolean bare)
Sets whether the repository will be bare.
Parameters:
bare - whether the repo will be bare


setBranch

public void setBranch(java.lang.Object branch)
Sets the branch to checkout if checkout is set to true.
Parameters:
branch - the branch to checkout
See Also:
setRef(Object)


setBranchesToClone

ssWarnings("unchecked")
	public
public void setBranchesToClone(java.util.Collection branchesToClone)
Sets branches to clone if cloneAllBranches is set to false.
Parameters:
branchesToClone - the branches to clone


setCheckout

public void setCheckout(boolean checkout)
Sets whether or not to checkout the specified branch.
Parameters:
checkout - whether or not to checkout the branch


setCloneAllBranches

public void setCloneAllBranches(boolean cloneAllBranches)
Sets whether all branches should be cloned.
Parameters:
cloneAllBranches - whether all branches should be cloned


setCredentials

public void setCredentials(PasswordCredentials credentials)
Sets the credentials to use when cloning the repo.
Parameters:
credentials - the credentials


setDestinationPath

public void setDestinationPath(java.lang.Object destinationPath)
Sets the path the repository should be clone into. Will be evaluated using org.gradle.api.Project#file(Object).
Parameters:
destinationPath - the path to clone into


setRef

public void setRef(java.lang.Object ref)
Sets the ref to checkout if checkout is set to true.
Parameters:
ref - the ref to checkout
Since:
0.5.0


setRemote

public void setRemote(java.lang.Object remote)
Sets the name used to track the upstream repository.
Parameters:
remote - the remote name


setTag

public void setTag(java.lang.Object tag)
Sets the tag to checkout if checkout is set to true. This will set the ref.
Parameters:
tag - the tag to checkout
See Also:
setRef(Object)
Since:
0.5.0


setUri

public void setUri(java.lang.Object uri)
Sets the URI of the repo to clone.
Parameters:
uri - the uri


 

Groovy Documentation