git-commit-id-gradle-plugin is a plugin quite similar to git-commit-id-maven-plugin but for gradle! For those who don't know the plugin, it basically helps you with the following tasks and answers related questions
- Which version had the bug? Is that deployed already?
- Make your distributed deployment aware of versions
- Validate if properties are set as expected
The plugin unreleased!
To make use of the plugin you must apply the plugin in your build.gradle
as mentioned in the gradle documentation:
plugins {
id 'java'
id 'io.github.git-commit-id.git-commit-id-gradle-plugin'
}
or if you want to use a specific version of the plugin via:
plugins {
id 'java'
id 'io.github.git-commit-id.git-commit-id-gradle-plugin' version 'MAJOR.MINOR.PATCH'
}
This plugin follows the Semantic Versioning that roughly can be
summarized as a version number MAJOR.MINOR.PATCH
, increment the:
MAJOR
version when you make incompatible API changesMINOR
version when you add functionality in a backwards compatible mannerPATCH
version when you make backwards compatible bug fixes
This plugin comes with a sensible set of default of configurations and settings. However, there might be cases where a default doesn't fit your project needs. Gradle allows user to configure with Modeling DSL-like APIs. Perhaps one additional item you need to know about configuration is that the plugin makes use of gradle's Lazy Configuration which is gradle's way to manage growing build complexity.
In short the plugin can be configured by adding a block like this to your build.gradle
:
gitCommitId {
skip.set(false)
}
Refer to TODO for all the settings and in-depth explanations what the individual configurations are there for.
The current version is unreleased
This project requires at least java 11 and will rely on gradle's convention for configuration. You also will need at least a gradle 5.3* installation to be able to use this plugin.
In case you are interested here are more details about the specifics for the version requirements:
- The git-commit-id-plugin-core which provides the core functions for gathering the git information relies on JGit that is a pure Java library implementing the Git version control file access routines. With version 6.0 this library requires Java 11 to run.
- With Gradle's Compatibility Matrix the minimum supported gradle version is 5.0.
- This plugin relies on conventions that had been introduced as part of the Lazy Configuration. Such conventions had been made available with gradle 5.1
- The GitCommitIdPluginExtension is made abstract and uses an
Injection
annotation that only works with gradle 5.3 and onwards. For more details refer to gradle/gradle#24947.
This project is currently maintained thanks to: @TheSnoozer
- @ktoso (founder) for the initial idea of the git-commit-id-maven-plugin
- @jbellmann for starting the initiative to make the maven plugin available for gradle (see here)
this plugin is released under the GNU Lesser General Public License 3.0.
You're free to use it as you wish, the full license text is attached in the LICENSE file.
The best way to ask for features / improvements is via the Issues section on GitHub