2016-02-19 90 views
1

我是gradle.i的新手,我想用gradle脚本签出远程仓库。 可以运行shell命令内部gradle任务来使用日期时间戳shell命令来克隆远程存储库。使用gradle脚本结账

回答

1

下面是我们如何做到这一点的例子:

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 
}