Gradle release & version management plugin.
Groovy
Latest commit c143976 Jan 17, 2017 @adamdubiel adamdubiel committed on GitHub refactor tag retrieval and add tag ordering by version

README.md

axion-release-plugin

gradle release and version management plugin

Join the chat at https://gitter.im/allegro/axion-release-plugin Build Status Coverage Status readthedocs Maven Central

Releasing versions in Gradle is very different from releasing in Maven. Maven came with maven-release-plugin which did all the dirty work. Gradle has no such tool and probably doesn't need it anyway. Evolution of software craft came to the point, when we start thinking about SCM as ultimate source of truth about project version. Version should not be hardcoded in pom.xml or build.gradle.

axion-release-plugin embraces this philosophy. Instead of reading project version from buildfile, it is derived from nearest tag in SCM (or set to default if nothing was tagged). If current commit is tagged commit, project has a release version. If there were any commits after last tag, project is in SNAPSHOT version. This very simple and intuitive philosophy, alongside with Semantic Versioning rules, makes it a lot easier to manage project versions along SCM tag versions.

Basic usage

plugins {
    id 'pl.allegro.tech.build.axion-release' version '1.4.1'
}

scmVersion {
    tag {
        prefix = 'my-project-name'
    }
}

project.version = scmVersion.version

Documentation

Documentation is available at axion-release read the docs.

Why write new plugin?

There are a few plugins that try to do the same - question is do we need another one?

What I needed was plugin that exposes version taken from nearest tag (like build-version-plugin) which at the same time will be easily integrated with maven-publish and signing. It also needs to be Continuous Integration-aware.

License

axion-release-plugin is published under Apache License 2.0.