Open sciwhiz12 opened 1 year ago
This might need a toggle/override. If the configuration cache is enabled, then we are not allowed to execute commands like git for versioning.
you can run external processes by using ExecOperations - and/or a custom ValueSource on a Provider
You can't at the moment because the projects version property does not support it.....
Even jgit currently throws up the error as it turns out. Because it invokes git as well
I'm not fully sure what you mean by what isn't supported by the Project.version
property?
Although the project version property isn't a full Property<String>
, it is somewhat flexible because it's actually stored as an Object
which is toString
ed on use. I don't remember where I did it, but I recall having using that flexibility to set the project version to a GitVersion
object, which lazily calculates the version when it's toString
ed.
This might need a toggle/override. If the configuration cache is enabled, then we are not allowed to execute commands like git for versioning.
If the configuration cache is enabled, using the git cli is isn't that hard - just use a ValueSource or two that takes an ExecOperations and call it a day. I'd recommend switching entirely to the git cli - if you use jgit sometimes and the git cli other times you risk inconsistent behavior causing weirdness
JGit has some feature holes/defects -- in particular, it lacks support for git work-trees and has so for a long time.
This PR adds support for using the
git
CLI when it is available, with support for falling back to JGit when not. This means features like work-trees are recognized and work properly.TODO
GitProvider
as wellGradleUtils
, due to removing the use of JGit classes.@CompileStatic
@CompileStatic
to more places in the project