I’ve tried similar things. The problem is that it is too late by then - other tasks not in my control have already been configured with incorrect versions by then. Even though I can (and did) reconfigure, say the jar
task, other tasks that reference it have already been “tainted” by no version at all…
Also, I was looking for something more pure Gradle and less Git aware. Determining if .git folder changed in a relevant way isn’t trivial. Simple checks may yield many false positives and non-trivial checks may be as “expensive”. A little bit of clarification - when I got tasks
to execute within 4-6 seconds (other than the first launch), saving another quarter to half second becomes meaningful.