-
Notifications
You must be signed in to change notification settings - Fork 10
Home
sarhanm edited this page Dec 16, 2020
·
8 revisions
Gradle Versioner plugin allows you to create semantic based project versions like: 2.1.6.master.d9741b1
The values in the version string are derived from the state of the git repository with a schema of {major}.{minor}.{commits}.{branch}.{commit-hash}
and is fully explained on the com.sarhanm.versioner page.
Having derived project versions allows you to:
- No longer worry about what the project version should be as you switch branches.
- Project version is set based on your branch name so this
- Alleviates issues of updating the version before you push.
- You know where a version of a library came from
- The commit hash is part of the version string so hot fixing is based on the correct commit hash, not from a branch you think is probably the right place to fork from.
There are two plugins that can be applied to your project.
Gradle Version | Compatible Versioner Version |
---|---|
< 2.2.1 | 1.0.58.master.5666bb7 |
2.2.1 - 2.3 | 2.0+ |
>= 2.4 | 2.1+ |
>=5.0 | 4.0+ |
https://plugins.gradle.org/plugin/com.sarhanm.versioner
https://plugins.gradle.org/plugin/com.sarhanm.version-resolver