Sorry if this is obvious, I'm new to Gradle and I'd like to include the latest git commit tag in my builds.
So far I have this task that simply outputs the string I want to save.
tasks.register<Exec>("get-git-latest") {
executable("git")
args("log", "--oneline", "-1", "--format=format:%h", ".")
}
Ideally I'd like to get this output into a variable that can be reused by other Gradle tasks, what is the best way to do this with Kotlin DSL? Any suggestions are welcome.