Class ChangelogFormat
- java.lang.Object
-
- com.github.koraktor.mavanagaiata.mojo.ChangelogFormat
-
- Direct Known Subclasses:
ChangelogDefaultFormat
public class ChangelogFormat extends Object
Base class for formatting changelog outputIndividual properties can be overridden in the configuration of the
changelogmojo.- Author:
- Sebastian Staudt
- See Also:
ChangelogMojo,ChangelogDefaultFormat,ChangelogMarkdownFormat
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classChangelogFormat.Formats
-
Field Summary
Fields Modifier and Type Field Description (package private) StringbaseUrl(package private) StringbranchThe format for the branch line(package private) StringbranchLinkThe format for the link to the history from the last tag to the current branch on GitHub(package private) StringbranchOnlyLinkThe format for the link to the branch history on GitHub(package private) StringcommitPrefixThe string to prepend to every commit message(package private) BooleancreateLinks(package private) StringdateFormat(package private) SimpleDateFormatdateFormatter(package private) BooleanescapeHtmlWhether to escape HTML(package private) StringheaderThe header to print above the changelog(package private) PrintStreamprintStream(package private) StringseparatorTHe separator to print between different sections of the changelog(package private) StringtagThe format for a tag line(package private) StringtagLinkThe format for the link to the tag history on GitHub
-
Constructor Summary
Constructors Constructor Description ChangelogFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) ChangelogFormatapply(ChangelogFormat format)Create a new format instance using this instance as base and override with (non-null) properties of the given format(package private) voidenableCreateLinks(String baseUrl)Enable creation of links using the given base URL(package private) voidprepare()Prepare the format strings for use(package private) voidprintBranch(String branchName)Print a section header for a branch(package private) voidprintCommit(GitCommit currentCommit)Print a single line for a commit(package private) voidprintCompareLink(String currentRef, String lastRef, boolean isBranch)Generates a link to the GitHub compare / commits view and inserts it into the changelog(package private) voidprintHeader()Print a header for the changelog(package private) voidprintSeparator()Print a separator between sections(package private) voidprintTag(GitTag currentTag)Print a section header for a tag
-
-
-
Field Detail
-
baseUrl
String baseUrl
-
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
-
dateFormatter
SimpleDateFormat dateFormatter
-
dateFormat
String dateFormat
-
commitPrefix
String commitPrefix
The string to prepend to every commit message
-
createLinks
Boolean createLinks
-
escapeHtml
Boolean escapeHtml
Whether to escape HTML
-
header
String header
The header to print above the changelog
-
printStream
PrintStream printStream
-
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
-
-
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 changelogIf 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 changeloglastRef- The last tag or branch in the changelogisBranch- 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
-
-