Package io.github.diltdicker.codelog
Class CodelogTemplate
java.lang.Object
io.github.diltdicker.codelog.CodelogTemplate
Helper class
-
Constructor Summary
ConstructorsConstructorDescriptionCodelog Template constructor, initializes a the JTE template engine with precompiled templates for CHANGELOG.md -
Method Summary
Modifier and TypeMethodDescriptiongenerateHeader(String projectName) Generates the constant header at the top of the CHANGELOG.md filegenerateNextRelease(String releaseVersion, String releaseDate, String releaseSummary, boolean hideIds, List<Change> newChanges, List<Change> fixChanges, List<Change> changeChanges, List<Change> docChanges, List<Change> breakChanges) Generates the next release section of the CHANGELOG.md filevoidwriteChangelogMd(Path path, String content) Overwrites entire CHANGELOG.md file with new content
-
Constructor Details
-
CodelogTemplate
public CodelogTemplate()Codelog Template constructor, initializes a the JTE template engine with precompiled templates for CHANGELOG.md
-
-
Method Details
-
generateHeader
Generates the constant header at the top of the CHANGELOG.md file- Parameters:
projectName- artifactId directly pulled from the pom.xml- Returns:
- Multi-line string containing the header text for the CHANGELOG.md
-
generateNextRelease
public String generateNextRelease(String releaseVersion, String releaseDate, String releaseSummary, boolean hideIds, List<Change> newChanges, List<Change> fixChanges, List<Change> changeChanges, List<Change> docChanges, List<Change> breakChanges) Generates the next release section of the CHANGELOG.md file- Parameters:
releaseVersion- Version number for the release. Specified by params when executing pluginreleaseDate- Date string for the release. Specified by params when executing pluginreleaseSummary- General release notes. Specified by params when executing pluginhideIds- Flag for showing/hiding the issue ids for changes in the release. Specified by params when executing plugin. default falsenewChanges- List of changes categorized under NEWfixChanges- List of changes categorized under FIXchangeChanges- List of changes categorized under CHANGEdocChanges- List of changes categorized under DOCUMENTATIONbreakChanges- List of changes categorized under BREAK- Returns:
- Multi-line string containing the latest release notes
-
writeChangelogMd
Overwrites entire CHANGELOG.md file with new content- Parameters:
path- Path of CHANGELOG.md. Will always be {root}/CHANGELOG.mdcontent- Complete contents of the new file. HEADER + NEW-RELEASE + OLD-RELEASES- Throws:
Exception- General exception if error trying to overwrite file
-