Class ChangelogGenerator
java.lang.Object
io.github.duckasteroid.gradle.versioning.releaseflow.ChangelogGenerator
Turns a list of commit messages into grouped Markdown release notes, the same idea implemented by
tools like conventional-changelog and git-cliff: group by the
CommitAnalyzer.Bump each
commit resolves to (using the same typeRules the version bump itself uses), not by the
raw commit type word, so a custom majorTypes entry (e.g. security) ends up under
Breaking Changes exactly like a !-marked commit would, and a noBumpTypes entry
(docs/chore/etc.) is omitted exactly like it doesn't affect the version.
A non-conforming commit (see CommitAnalyzer) still gets a PATCH-bump classification
(and still prints its stderr warning, since CommitAnalyzer.analyzeOne(String, Map) is
what's called here) - it appears under Bug Fixes using its raw first line as the description,
consistent with it having actually bumped the version.
A plain class with no Gradle dependency, like CommitAnalyzer and
io.github.duckasteroid.gradle.versioning.VersionResolver - see that class's
commitMessagesForChangelog for how the commit list itself is obtained.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringEquivalent togenerate(List, Map)withCommitAnalyzer.DEFAULT_TYPE_RULES.static String
-
Method Details
-
generate
Equivalent togenerate(List, Map)withCommitAnalyzer.DEFAULT_TYPE_RULES. -
generate
public static String generate(List<String> messages, Map<CommitAnalyzer.Bump, Set<String>> typeRules) - Parameters:
messages- full commit messages (subject + body/footer), typically fromVersionResolver.commitMessagesForChangelogtypeRules- seeCommitAnalyzer.DEFAULT_TYPE_RULES; should be the same rules used for the version bump itself so the changelog and the version agree
-