Gradle plugin for automating the changelog update process.
This plugin creates a task updateChangelog that can be hooked for example into the Gradle release plugin and update a changelog file based on the released version and the release date.
-
Create a changelog file
echo "# Changelog" > CHANGELOG.md
-
Add a new bullet point below the header:
# Changelog * Initial commit
-
Add the Gradle plugin
- Using the plugins DSL:
In build.gradle.kts
plugins { id("com.tomtom.gradle.updatechangelog") version "<version>" }
In build.gradle
plugins { id "com.tomtom.gradle.updatechangelog" version "<version>" }
-
Configure it in build.gradle
changelog { versionPlaceholder = '# Changelog' changelogFilename = 'CHANGELOG.md' }
-
Run the updateChangelog task
This step is just needed to validate that the update task is working as expected. Once you run it you should revert the changes it did in your changelog file.
./gradlew updateChangelog
This command will update the CHANGELOG.md file with the version provided by the project version property and the current date.
# Changelog **1.0.0** (2018-10-23): * Initial commit
-
In most cases you will hook this plugin under the Gradle release plugin so that the changelog gets updated whenever a new release is done.
preTagCommit.dependsOn updateChangelog
Run a clean build:
./gradlew clean build
This command will clean your workspace, build the code and tests and run the unit and functional tests.
To run only tests use the following command:
./gradlew check