semver-git icon indicating copy to clipboard operation
semver-git copied to clipboard

Run without git executable (contains link to fork)

Open xenoterracide opened this issue 7 years ago • 4 comments

Hi, I like the idea of your plugin, but unfortunately my CI, which runs in a docker container, doesn't have git installed. So I forked the concept here: I imagine you don't wish to move to Java Code, and perhaps even JGit, however feel fee to borrow from any of that if you want. Also feel free to close after you've reviewed this.

https://bitbucket.org/xenoterracide/gradle-plugin-bundle/src/master/src/main/java/com/xenoterracide/gradle/plugin/SemVerPlugin.java

https://bitbucket.org/xenoterracide/gradle-plugin-bundle/src/master/src/test/java/com/xenoterracide/gradle/plugin/SemVerPluginTest.java

xenoterracide avatar Jun 23 '18 01:06 xenoterracide

The idea of a pure-java version does actually sound pretty appealing! (Even more so when you think about all the process management we wouldn't have to do)

I'll see if I can find a clean way to extend the plugin without sacrificing the current simplicity

deepy avatar Jun 25 '18 20:06 deepy

I'm just using JGit technically gradle has an internal version of it already, but since it's marked internal... and its Git object behaves like running the porcelain command, so should be easy to translate it.

xenoterracide avatar Jun 25 '18 20:06 xenoterracide

Looking at DescribeCommand I feel kinda underwhelmed, it doesn't seem to offer anything similar to --exact-match (--candidates=0), --abbrev, ~~or --dirty~~. Which unfortunately has all the information we need. Though I guess I can work my way around most of these without too much hassle

deepy avatar Jun 25 '18 21:06 deepy

dirty flag can be checked via git.status().call().isClean View GitVersionPlugin.kt#L19 as an example

ArcticLampyrid avatar Jul 21 '21 02:07 ArcticLampyrid