All Projects → JetBrains → Gradle Changelog Plugin

JetBrains / Gradle Changelog Plugin

Licence: apache-2.0
Plugin for parsing and managing the Changelog in a "keep a changelog" style.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Gradle Changelog Plugin

gradle-cleaner-intellij-plugin
Force clear delaying & no longer needed Gradle tasks.
Stars: ✭ 26 (-74.51%)
Mutual labels:  gradle, intellij, gradle-plugin, intellij-plugin
Texify Idea
LaTeX support for the IntelliJ platform by JetBrains.
Stars: ✭ 436 (+327.45%)
Mutual labels:  jetbrains, intellij, intellij-plugin, intellij-platform
sourcegraph-jetbrains
Sourcegraph for JetBrains IDEs (IntelliJ)
Stars: ✭ 34 (-66.67%)
Mutual labels:  intellij, jetbrains, intellij-plugin, intellij-platform
JetBrainsCopilot
✈️ IDE plugin for the IntelliJ platform which adds GitHub Copilot support. (VERY WIP)
Stars: ✭ 155 (+51.96%)
Mutual labels:  intellij, jetbrains, intellij-plugin, intellij-platform
Runconfigurationasaction
Provides a way to use IntelliJ run configurations as buttons
Stars: ✭ 17 (-83.33%)
Mutual labels:  jetbrains, intellij, intellij-plugin, intellij-platform
Intellij Sdk Docs
IntelliJ SDK Platform Documentation
Stars: ✭ 913 (+795.1%)
Mutual labels:  jetbrains, intellij, intellij-plugin, intellij-platform
Intellij Sdk Code Samples
Mirror of the IntelliJ SDK Docs Code Samples
Stars: ✭ 217 (+112.75%)
Mutual labels:  jetbrains, intellij, intellij-plugin, intellij-platform
interstellar
Dark editor theme for JetBrains IDEs
Stars: ✭ 26 (-74.51%)
Mutual labels:  intellij, jetbrains, intellij-plugin
Magento2 Phpstorm Plugin
PHPStorm Plugin for Magento 2
Stars: ✭ 294 (+188.24%)
Mutual labels:  jetbrains, intellij, intellij-plugin
Idea Php Laravel Plugin
Laravel Framework Plugin for PhpStorm / IntelliJ IDEA
Stars: ✭ 537 (+426.47%)
Mutual labels:  jetbrains, intellij, intellij-plugin
SideMirror
An Android Studio plugin to mirror your android devices with scrcpy directly from Android Studio.
Stars: ✭ 49 (-51.96%)
Mutual labels:  intellij, jetbrains, intellij-plugin
Intellij Rainbow Fart
🌈一个在你编程时持续夸你写的牛逼的扩展,可以根据代码关键字播放贴近代码意义的真人语音。Inspired by vscode-rainbow-fart
Stars: ✭ 391 (+283.33%)
Mutual labels:  intellij, intellij-plugin, intellij-platform
Intellij Platform Plugin Template
Template repository for creating plugins for IntelliJ Platform
Stars: ✭ 637 (+524.51%)
Mutual labels:  intellij, intellij-plugin, intellij-platform
intellij-autohotkey
AutoHotkey plugin for the Jetbrain's IntelliJ platform
Stars: ✭ 30 (-70.59%)
Mutual labels:  intellij, jetbrains, intellij-plugin
intellij-neos
Support for the Neos CMS in Intellij IDEA / PhpStorm
Stars: ✭ 37 (-63.73%)
Mutual labels:  intellij, jetbrains, intellij-plugin
Acejump
🅰️ single character search, select, and jump
Stars: ✭ 786 (+670.59%)
Mutual labels:  intellij, intellij-plugin, intellij-platform
Idea Php Symfony2 Plugin
IntelliJ IDEA / PhpStorm Symfony Plugin
Stars: ✭ 797 (+681.37%)
Mutual labels:  jetbrains, intellij, intellij-plugin
Idea Gradle Dependencies Formatter
Gradle dependencies formatter for IntelliJ IDEA
Stars: ✭ 156 (+52.94%)
Mutual labels:  gradle, intellij, intellij-plugin
Minecraftdev
Plugin for IntelliJ IDEA that gives special support for Minecraft modding projects.
Stars: ✭ 645 (+532.35%)
Mutual labels:  gradle, jetbrains, intellij
Gradle Intellij Plugin
Plugin for building plugins for IntelliJ IDEs
Stars: ✭ 912 (+794.12%)
Mutual labels:  gradle, intellij, intellij-platform

Gradle Changelog Plugin

official JetBrains project Twitter Follow Gradle Plugin Build Slack

This project requires Gradle 6.6 or newer

TIP: Upgrade Gradle Wrapper with ./gradlew wrapper --gradle-version 6.8.2

A Gradle plugin that provides tasks and helper methods to simplify working with a changelog that is managed in the keep a changelog style.

Table of contents

Usage

Kotlin:

import org.jetbrains.changelog.closure
import org.jetbrains.changelog.date

plugins {
    id("org.jetbrains.changelog") version "1.1.1"
}

tasks {
    // ...

    patchPluginXml {
        changeNotes(closure { changelog.getUnreleased().toHTML() })
    }
}

changelog {
    version = "1.0.0"
    path = "${project.projectDir}/CHANGELOG.md"
    header = closure { "[$version] - ${date()}" }
    itemPrefix = "-"
    keepUnreleasedSection = true
    unreleasedTerm = "[Unreleased]"
    groups = listOf("Added", "Changed", "Deprecated", "Removed", "Fixed", "Security")
}

Groovy:

import org.jetbrains.changelog.ExtensionsKt

plugins {
    id 'org.jetbrains.changelog' version '1.1.1'
}

apply plugin: 'org.jetbrains.changelog'

intellij {
    // ...

    patchPluginXml {
        changeNotes({ changelog.getUnreleased().toHTML() })
    }
}

changelog {
    version = "1.0.0"
    path = "${project.projectDir}/CHANGELOG.md"
    header = { "[$version] - ${ExtensionsKt.date()}" }
    headerParserRegex = ~/\d+\.\d+/
    itemPrefix = "-"
    keepUnreleasedSection = true
    unreleasedTerm = "[Unreleased]"
    groups = ["Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"]
}

Note: closure is a wrapper for the KotlinClosure0 class and can be used directly as following:

import org.gradle.kotlin.dsl.KotlinClosure0

changeNotes(KotlinClosure0({ changelog.getUnreleased() }))

Configuration

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 Closure that returns current header value. { "[$version]" }
headerParserRegex Regex/Pattern/String used to extract version from the header string. null, fallbacks to Changelog#semVerRegex
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 support.

Tasks

The plugin introduces the following tasks:

Task Description
getChangelog Retrieves changelog for the specified version.
initializeChangelog Creates new changelog file with Unreleased section and empty groups.
patchChangelog Updates the unreleased section to the given version. Requires unreleased section to be present in the changelog file.

initializeChangelog

Examples

$ ./gradlew initializeChangelog
$ cat CHANGELOG.md

## [Unreleased]
### Added
- Example item

### Changed

### Deprecated

### Removed

### Fixed

### Security

getChangelog

Options

Option Description
--no-header Skips the first version header line in the output.
--unreleased Returns Unreleased change notes.

Examples

$ ./gradlew getChangelog --console=plain -q --no-header

### Added
- Initial project scaffold
- GitHub Actions to automate testing and deployment
- Kotlin support

Extension Methods

All the methods are available via the changelog extension and allow for reading the changelog file within the Gradle tasks to provide the latest (or specific) change notes.

Note: Following methods depend on the changelog extension, which is set in the Configuration build phase. To make it running properly, it's required to place the configuration before the fist usage of such a method. Alternatively, you can pass the Gradle closure to the task, which will postpone the method invocation.

get

The method returns a Changelog.Item object for the specified version. Throws MissingVersionException if the version is not available.

It is possible to specify the unreleased section with setting the ${changelog.unreleasedTerm} value.

Parameters

Parameter Type Description Default value
version String Change note version. ${changelog.version}

Examples

Kotlin:

tasks {
    patchPluginXml {
        changeNotes(closure { changelog.get("1.0.0").toHTML() })
    }
}

Groovy:

tasks {
    patchPluginXml {
        changeNotes({ changelog.get("1.0.0").toHTML() })
    }
}

getUnreleased

The method returns a Changelog.Item object for the unreleased version.

Examples

Kotlin:

tasks {
    patchPluginXml {
        changeNotes(closure { changelog.getUnreleased().toHTML() })
    }
}

Groovy:

tasks {
    patchPluginXml {
        changeNotes({ changelog.getUnreleased().toHTML() })
    }
}

getLatest

The method returns the latest Changelog.Item object (first on the list).

Examples

Kotlin:

tasks {
    patchPluginXml {
        changeNotes(closure { changelog.getLatest().toHTML() })
    }
}

Groovy:

tasks {
    patchPluginXml {
        changeNotes({ changelog.getLatest().toHTML() })
    }
}

getAll

The method returns all available Changelog.Item objects.

Examples

Kotlin:

extension.getAll().values.map { it.toText() }

Groovy:

extension.getAll().values().each { it.toText() }

has

The method checks if the given version exists in the changelog.

Examples

Kotlin:

tasks {
    patchPluginXml {
        closure { changelog.has("1.0.0") }
    }
}

Groovy:

tasks {
    patchPluginXml {
        { changelog.has("1.0.0") }
    }
}

Changelog.Item

Methods described in the above section return Changelog.Item object, which is a representation of the single changelog section for the specific version.

It provides a couple of properties and methods that allow altering the output form of the change notes:

Properties

Name Type Description
version String Change note version.

Methods

Name Description Returned type
noHeader() Excludes header part. this
noHeader(Boolean) Includes/excludes header part. this
getHeader() Returns header text. String
toText() Generates Markdown output. String
toPlainText() Generates Plain Text output. String
toString() Generates Markdown output. String
toHTML() Generates HTML output. String

Gradle Closure in Kotlin DSL

To produce Gradle-specific closure in Kotlin DSL, required by some third-party plugins, like gradle-intellij-plugin it is required to wrap the Kotlin Unit with KotlinClosure0 class:

KotlinClosure0({ changelog.get("1.0.0") })

There is also a neater method available:

import org.jetbrains.changelog.closure

closure { changelog.get("1.0.0") }

Helper Methods

Name Description Returned type
closure(function: () -> T) Produces Gradle-specific Closure for Kotlin DSL. Closure<T>
date(pattern: String = "yyyy-MM-dd") Shorthand for retrieving the current date in the given format. String
markdownToHTML(input: String) Converts given Markdown content to HTML output. String
markdownToPlainText(input: String) Converts given Markdown content to Plain Text output. String

Note: To use package-level Kotlin functions in Groovy, you need to import the containing file as a class:

import org.jetbrains.changelog.ExtensionsKt

changelog {
  header = { "[$version] - ${ExtensionsKt.date('yyyy-MM-dd')}" }
}

Usage Examples

Contributing

Integration tests

To perform integration tests with an existing project, bind the gradle-changelog-plugin sources in the Gradle settings file:

settings.gradle:

rootProject.name = "IntelliJ Platform Plugin Template"

includeBuild '/Users/hsz/Projects/JetBrains/gradle-changelog-plugin'

settings.gradle.kts:

rootProject.name = "IntelliJ Platform Plugin Template"

includeBuild("/Users/hsz/Projects/JetBrains/gradle-changelog-plugin")
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].