A plugin to generate semantic version information and apply it to the project based on git tags. It makes use of the git-version plugin.
As this plugin wraps git-version, it offers the same features for versioning.
Additionally it adds:
- versionCode - version code for Android based on semantic versioning (MMmmPP)
- featureVersionCode - version code for Android based on timestamps (MMddHHmm)
- versionInfo - prints all information about the current version
Add the following to your project module build.gradle/build.gradle.kts
file:
plugins {
id("eu.bitfunk.gradle.plugin.tool.versioning")
}
To print current version information:
./gradlew versionInfo
To access the version information, use this project extensions:
version()
- version as StringversionCleaned
- version where-SNAPSHOT
got removedversionCode()
- versionCode as IntversionCodeFeature()
- versionCodeFeature as Int