I’m trying to change the Gradle cache (where the downloaded dependencies are stored) from the user home directory, to the workspace of our project. I realize this is possible with setting an environment variable, specifying -Duser.home.dir on the CLI, or using an init script. The problem with these solutions are that none of them can be checked into our source code. They all require developers to remember to set an ENV variable, write something extra on the CLI, or have an external file stored in their user home directory.
I discovered today that you can override the cache directory from within an init.gradle script, however, it doesn’t appear possible to have this file live within our workspace. Unless of course, we specify -I on the command line…
Is there a directory alongside the build.gradle, that I can place an init.gradle script and have Gradle automatically load it?