Class CodelogTemplate

java.lang.Object
io.github.diltdicker.codelog.CodelogTemplate

public class CodelogTemplate extends Object
Helper class
  • Constructor Details

    • CodelogTemplate

      public CodelogTemplate()
      Codelog Template constructor, initializes a the JTE template engine with precompiled templates for CHANGELOG.md
  • Method Details

    • generateHeader

      public String generateHeader(String projectName)
      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 plugin
      releaseDate - Date string for the release. Specified by params when executing plugin
      releaseSummary - General release notes. Specified by params when executing plugin
      hideIds - Flag for showing/hiding the issue ids for changes in the release. Specified by params when executing plugin. default false
      newChanges - List of changes categorized under NEW
      fixChanges - List of changes categorized under FIX
      changeChanges - List of changes categorized under CHANGE
      docChanges - List of changes categorized under DOCUMENTATION
      breakChanges - List of changes categorized under BREAK
      Returns:
      Multi-line string containing the latest release notes
    • writeChangelogMd

      public void writeChangelogMd(Path path, String content) throws Exception
      Overwrites entire CHANGELOG.md file with new content
      Parameters:
      path - Path of CHANGELOG.md. Will always be {root}/CHANGELOG.md
      content - Complete contents of the new file. HEADER + NEW-RELEASE + OLD-RELEASES
      Throws:
      Exception - General exception if error trying to overwrite file