'Configuring remote Gradle Build Cache on build server

Is it possible to configure a Gradle remote cache from the command line or on the daemon?

Ideally I'd like to configure our build server to use a remote cache without requiring all users of my build server to update all of their settings.gradle files.

I could also inject the required lines into the settings file if it doesn't exist potentially. I can't find any documentation so that leads me to believe this could be a bad idea.



Solution 1:[1]

Likely you'd do this with an init script, specified on the gradle command line with --init-script

See https://docs.gradle.org/current/userguide/init_scripts.html

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Greg Allen