Skip to content

Latest commit

 

History

History
69 lines (57 loc) · 2.75 KB

README.md

File metadata and controls

69 lines (57 loc) · 2.75 KB

Git changelog gradle plugin

Plugin for automatic generation of changelog from git repository

Actions Status Actions Status codecov

Usage example

plugins {
    id 'com.a65apps.changelog' version '1.1.10'
}

changelog {
    def token = System.getenv().get("TOKEN")      // PAT token for access to a Git repository if repository is private
    
    currentVersion = '1.1'                        // Current release name, default is 'Unreleased'
    lastReleaseBranch = "releases/1"              // Last release branch, required field
    templateFile = "template/changelog.mustache"  // Template for render changelog.md, required field
    accessToken = token                           // Token for access to a Git repository, default is empty
    userName = "my_user_name"                     // Optional user name for Git access
    developBranch = 'master'                      // Develop branch, default is 'develop'
}

Template example

# Changelog

## {{title}}
{{#entries}}
{{message}}
{{/entries}}

## Folded
{{#shortEntries}}
{{foldId}}
{{/shortEntries}}
field description
title currentVersion value
entries log entries list
message short message from git commit
shortEntries folded entries list
foldId taskId(first 8 commit hash symbols)

Run task

./gradlew changelog

Output result should be in build/outputs/changelog.md by default

Other configurations

changelog {
    currentReleaseBranch = "releases/2"  // Specify current release branch
    local = true             // Forces to generation on a local copy of the repository
    characterLimit = 10_000  // Limit changelog to this character count
    outputFile = "$buildDir/path/to/changelog.md" // Custom output file path for generated changelog
    entryDash = "*"          // Custom log entry dash, default is '-'
    templateExtraCharactersLength = 29  // Extra character length for fine grained character limit configuration
    order = LogOrder.LAST_TO_FIRST  // Order of log entries. Default is LogOrder.FIRST_TO_LAST
    minEntryCount = 10      // Minimal entry count
}