ajoberstar / reckon

Infer a project's version from your Git repository.
Apache License 2.0
191 stars 28 forks source link

Use BuildService as provider of Grgit #160

Closed petertrr closed 2 years ago

petertrr commented 3 years ago

This pull request introduces a BuildService, which serves as a provider of Grgit instance. It replaces grgit-gradle plugin and instead of using Grgit from extension property and closing it in buildFinished listener allows gradle to manage it's lifecycle and close when closing build service. This addresses the issue reported at https://github.com/ajoberstar/grgit/issues/333 and https://github.com/ajoberstar/grgit/issues/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.

kibotu commented 3 years ago

any updates on this one? my team would also appreciate this :)

petertrr commented 3 years ago

any updates on this one? my team would also appreciate this :)

Hey @kibotu , until @ajoberstar reviews this, you can try this change from jitpack.io. By adding a repo maven("https://jitpack.io") and changing dependency to implementation("com.github.ajoberstar.reckon:reckon-gradle:PR160-SNAPSHOT") inside buildSrc/build.gradle.kts or buildscript block, for example.

I tested this manually myself, but would very much like to hear feedback from others. Maybe, if others confirm that it's working, it could speed up review process too :)

ajoberstar commented 2 years ago

As of 0.14.0 both grgit and reckon are configuration cache safe and leverage BuildService to provide the repositories.