Class ChangelogFormat

    • Field Detail

      • branch

        String branch
        The format for the branch line
      • branchLink

        String branchLink
        The format for the link to the history from the last tag to the current branch on GitHub
      • branchOnlyLink

        String branchOnlyLink
        The format for the link to the branch history on GitHub
      • dateFormat

        String dateFormat
      • commitPrefix

        String commitPrefix
        The string to prepend to every commit message
      • escapeHtml

        Boolean escapeHtml
        Whether to escape HTML
      • header

        String header
        The header to print above the changelog
      • separator

        String separator
        THe separator to print between different sections of the changelog
      • tag

        String tag
        The format for a tag line
      • tagLink

        String tagLink
        The format for the link to the tag history on GitHub
    • Constructor Detail

      • ChangelogFormat

        public ChangelogFormat()
    • Method Detail

      • apply

        ChangelogFormat apply​(ChangelogFormat format)
        Create a new format instance using this instance as base and override with (non-null) properties of the given format
        Parameters:
        format - Format to apply settings from
        Returns:
        A new format with applied settings
      • enableCreateLinks

        void enableCreateLinks​(String baseUrl)
        Enable creation of links using the given base URL
        Parameters:
        baseUrl - The base URL to link to
      • prepare

        void prepare()
        Prepare the format strings for use
      • printBranch

        void printBranch​(String branchName)
        Print a section header for a branch
        Parameters:
        branchName - The name of the branch
      • printCommit

        void printCommit​(GitCommit currentCommit)
        Print a single line for a commit
        Parameters:
        currentCommit - The commit to print
      • printCompareLink

        void printCompareLink​(String currentRef,
                              String lastRef,
                              boolean isBranch)
        Generates a link to the GitHub compare / commits view and inserts it into the changelog

        If no current ref is provided, the generated text will link to the commits view, listing all commits of the latest tag or the whole branch. Otherwise the text will link to the compare view, listing all commits that are in the current ref, but not in the last one.

        Parameters:
        currentRef - The current tag or branch in the changelog
        lastRef - The last tag or branch in the changelog
        isBranch - Whether the current ref is a branch
      • printHeader

        void printHeader()
        Print a header for the changelog
      • printSeparator

        void printSeparator()
        Print a separator between sections
      • printTag

        void printTag​(GitTag currentTag)
        Print a section header for a tag
        Parameters:
        currentTag - The tag