Fix build when git is not installed

This commit is contained in:
José Rebelo
2026-04-26 20:00:13 +01:00
parent 89b7a19ba0
commit c1aee648a0
+9 -1
View File
@@ -31,9 +31,17 @@ tasks.register("buildGitChangelog"){
outputs.file(changelogFile)
doLast {
final def allCommits = providers.exec {
final def allCommits
try {
allCommits = providers.exec {
commandLine('git', 'log', '--pretty=format:%h %s')
}.standardOutput.asText.get()
} catch (ignored) {
logger.warn("Skipping git changelog: git is not available")
changelogFile.getParentFile().mkdirs()
changelogFile.write(groovy.xml.XmlUtil.serialize(new Node(null, 'changelog')))
return
}
def commitVersionCode = getVersionCode()
def includedCommits = 0