gradle-git-version
gradle-git-version copied to clipboard
Cache gitVersion() result
if you do
allprojects {
version gitVersion()
}
you will compute version for every subproject even though they're in the same repo. This increases the runtime by around ~0.5s per subproject. We should cache the result since it won't change across projects.
We should cache the result since it won't change across projects.
It is a bit more complex than this. Consider the following use 2 cases:
- some composite projects may reside in multiple repos, and will have different versions
- in such case we can cache the version per repo-root.
- the build may create tags internally
- which means that we need a way to invalidate the cache
- ideally there should be a cheap check (cheaper than describing the tag) to detect that the repo has been modified and invalidate automatically