Run without git executable (contains link to fork)
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
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
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.
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
dirty flag can be checked via git.status().call().isClean
View GitVersionPlugin.kt#L19 as an example