Calculate and apply automatic CalVer commits and tags to your project.
Using the plugins DSL:
plugins {
id("io.github.anvell.versioning.gradle.plugin") version "2024.06.01"
}
configureVersioning {
// Default is 'origin'
remote.set("your-remote-name")
// Set 'true' to push automatically
autoPush.set(true)
// Specify version catalog to use
versionCatalog.set(file("gradle/project.versions.toml"))
}
In order to create new version launch Gradle task:
$ ./gradlew publishVersion
This will increment latest version from version catalog found in VCS history according to CalVer rules, create commit and optionally push it to the remote.
$ ./gradlew publishVersionTag
Plugin will attempt to parse latest tag and increment version according to CalVer rules. Using different variants
allows to tag the same version for different environments.
Feel free to open a issue or submit a pull request for any bugs/improvements.
This project uses Kotlin gradle plugin template.