Use BuildService as provider of Grgit #160
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a BuildService, which serves as a provider of
Grgit
instance. It replacesgrgit-gradle
plugin and instead of usingGrgit
from extension property and closing it inbuildFinished
listener allows gradle to manage it's lifecycle and close when closing build service. This addresses the issue reported at ajoberstar/grgit#333 and ajoberstar/grgit#322, but since grgit is no longer actively maintained (as per readme), I decided to implement this change here.The biggest downside is that build services have been introduced only in Gradle 6.1, so this would require raising minimal supported version, which is represented in updated tests.
I'm using
reckon
in my projects and really like the results and appreciate the work, that has been done. I would really like to hear feedback on this and adjust my changes accordingly.