Include *.kt files in buildSrc in cache key by schuenadel · Pull Request #274 · actions/setup-java

Hi @vlsi,

Kotlin in buildSrc is used for much more than "versions"

Yes, I was coming from my "personal Android bubble" where I see it mainly being used for dependencies and if for something else, then rather rarely touched and if so it maybe even rectify a cache miss. But I get your point that this may be different for other, maybe more infrastructure related, projects where the refresh would not be desired.

and using Versions.kt in buildSrc is an anti-pattern.

I wasn't aware of that and also don't know why it is (I'd say invalidating the build cache on changes doesn't really count for clean builds on CI, if that's the reason...). But anyway many people use it and I think it would be nice to enable them to also benefit from a working cache mechanism.

I preferred to not hardcode the file names as that forces you to use these specific names in order to make the cache work, but maybe that's the better compromise to not have unwanted cache invalidations (as you pointed out).
So my suggestion would be to use buildSrc/**/Versions.kt and buildSrc/**/Dependencies.kt instead of buildSrc/**/*.kt