I am new to gradle.I want to checkout remote repository using gradle script. It is possible to run shell command Inside gradle task to clone remote repository with datetime stamp shell commands.
Asked
Active
Viewed 1,172 times
2 Answers
3
Yes, you can use a gradle Exec type task to execute any arbitrary command in the OS shell. See documentation and examples here.
You didn't say what type of repo you're using, but there is a gradle git plugin to do git operations including checkout.

RaGe
- 22,696
- 11
- 72
- 104
1
Here's an example of how we do it:
project.tasks.create(
name: "checkOutCurrent", group: "Server", type:Exec,
description: "Checks out the current commit on the remote server.") {
workingDir project.rootDir
commandLine 'git', 'checkout', this.commit
}

Michael Hobbs
- 1,663
- 1
- 15
- 26