Gradle plugin that provides Semantic Versioning with auto-increment features.
Add it in your project build.gradle.kts
at the end of plugins.
Using the plugins DSL:
plugins {
id("com.sherepenko.gradle.plugin-build-version") version "x.y.z"
}
Using legacy plugin application:
buildscript {
repositories {
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath("com.sherepenko.gradle.plugin-build-version:x.y.z")
}
}
apply(plugin = "com.sherepenko.gradle.plugin-build-version")
Given a version number MAJOR.MINOR.PATCH
, increment the:
MAJOR
version when you make incompatible API changes,MINOR
version when you add functionality in a backward compatible manner, andPATCH
version when you make backward compatible bug fixes.
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH
format.
incrementMajor
will increment theMAJOR
and set theMINOR
andPATCH
versions to0
;incrementMinor
will increment theMINOR
and set thePATCH
version to0
;incrementPatch
will increment thePATCH
version;prepareReleaseVersion
will prepare release version by trimming pre-release and build metadata