Для использования в качестве номера сборки приложения.
Код: Выделить всё
def getCommitCount = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', '--count', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim().toInteger()
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... t-for-exec