Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz committed Oct 13, 2021
1 parent 5a4f7d8 commit 9ec05c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ changelog {
version = "1.0.0"
path = "${project.projectDir}/CHANGELOG.md"
header = "[${-> version.get()}] - ${new SimpleDateFormat("yyyy-MM-dd").format(new Date())}"
headerParserRegex = ~/\d+\.\d+/
headerParserRegex = ~/(\d+\.\d+)/
itemPrefix = "-"
keepUnreleasedSection = true
unreleasedTerm = "[Unreleased]"
Expand All @@ -102,17 +102,17 @@ changelog {

Plugin can be configured with the following properties set in the `changelog {}` closure:

| Property | Description | Default value |
| ----------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| **`version`** | **Required.** Current project's version. | |
| `groups` | List of groups created with a new Unreleased section. | `["Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"]` |
| `header` | `String` or `Provider` that returns current header value. | `provider { "[${version.get()}]" }` |
| `headerParserRegex` | `Regex`/`Pattern`/`String` used to extract version from the header string. | `null`, fallbacks to [`ChangelogPluginConstants#SEM_VER_REGEX`][semver-regex] |
| `itemPrefix` | Single item's prefix, allows to customise the bullet sign. | `"-"` |
| `keepUnreleasedSection` | Add Unreleased empty section after patching. | `true` |
| `patchEmpty` | Patches changelog even if no release note is provided. | `true` |
| `path` | Path to the changelog file. | `"${project.projectDir}/CHANGELOG.md"` |
| `unreleasedTerm` | Unreleased section text. | `"[Unreleased]"` |
| Property | Description | Default value |
| ----------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| **`version`** | **Required.** Current project's version. | |
| `groups` | List of groups created with a new Unreleased section. | `["Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"]` |
| `header` | `String` or `Provider` that returns current header value. | `provider { "[${version.get()}]" }` |
| `headerParserRegex` | `Regex`/`Pattern`/`String` used to extract version from the header string. | `null`, fallbacks to [`ChangelogPluginConstants#SEM_VER_REGEX`][semver-regex] |
| `itemPrefix` | Single item's prefix, allows to customise the bullet sign. | `"-"` |
| `keepUnreleasedSection` | Add Unreleased empty section after patching. | `true` |
| `patchEmpty` | Patches changelog even if no release note is provided. | `true` |
| `path` | Path to the changelog file. | `"${project.projectDir}/CHANGELOG.md"` |
| `unreleasedTerm` | Unreleased section text. | `"[Unreleased]"` |

> **Note:** `header` closure has the delegate explicitly set to the extension's context for the sake of the [Configuration cache][configuration-cache] support.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ open class ChangelogPluginExtension @Inject constructor(
@Optional
val headerParserRegex: Property<Any> = objects.property(Any::class.java)

fun getHeaderParserRegex() = when (val value = headerParserRegex.orNull) {
internal fun getHeaderParserRegex() = when (val value = headerParserRegex.orNull) {
is Regex -> value
is String -> value.toRegex()
is Pattern -> value.toRegex()
Expand Down

0 comments on commit 9ec05c7

Please sign in to comment.