1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-24 17:45:50 +01:00

Reduce number of git commits on nightly changelog

- Include last 100 commits
- Ignore weblate commits

The changelog_git is still being accidentally included into release
builds. It currently takes 6kb compressed.
This commit is contained in:
José Rebelo 2023-09-17 15:40:14 +01:00
parent 294d45f6c3
commit f6ff357a6b

View File

@ -36,12 +36,22 @@ def buildGitChangelog = {
}
def commitVersionCode = getVersionCode()
def includedCommits = 0
def changelogNode = new Node(null, 'changelog')
stdout.toString().trim().eachLine { line ->
if (includedCommits > 100) {
return true;
}
def (commitHash, commitMessage) = line.split(" ", 2)
if (commitMessage.contains("Translated using Weblate")) {
return true;
}
def releaseNode = new Node(changelogNode, 'release', [version: commitHash, versioncode: commitVersionCode--])
def _ = new Node(releaseNode, 'change', [:], commitMessage)
includedCommits++
}
def changelogFile = new File("${project.rootDir}/app/build/generated/res/changelog/xml/changelog_git.xml")