Put a file that ends with .gradle in the GRADLE_HOME/init.d/ directory, in the Gradle distribution. This allows you to package up a custom Gradle distribution containing some custom build logic and plugins. You can combine this with the Gradle wrapper as a way to make custom logic available to all builds in your enterprise.
Is there an example of combining this with the gradle wrapper? I am interested in doing this as I am in the process of developing a system-wide configuration and I want to store this (at least for now) with the proof-of-concept project I am developing with gradle. I want to check it into our git repository.
We use this technique where I work. We package every new Gradle version with our own scripts in init.d (setting up the location for our binary repo, typical buildscript dependencies, etc.). When setting up projects, we require that developers point their gradle-wrapper.properties to our internal distribution:
Yes, please, I would like to see your setup. This sounds maybe not quite what I’m looking for. My main development goal here is to develop the global init,gradle within the context of a single multi-project build, with the idea of eventually globalizing it. Since I am also using version control (with very frequent commits!) as an easy way of moving the whole system from my workstation to the server on which the builds and tests run (to which I have only terminal access), I want this file to live (temporarily) WITHIN the project, so it migrates with the rest of the project through the git repo. Much easier/faster than ftp/sftp, etc.
None of the init possibilities I see mentioned seem to handle this case.
The best I am able to come up with so far, is to physically locate this file within the project and specify on the command line where to find it, wrapping all this up in an alias for ease of use.
But it would be nicer if it could somehow be located in the wrapper.
I realize this is an unusual case and one that I don’t even want to be using once I’m done with this phase.
Below is the gist of the build script that repackages Gradle for our internal use (originally provided by @sterling) . I’ve removed 1) stuff that’s specific to our own internal plugins -and- 2) a bunch of Artifactory-related stuff that we use to publish the distribution to our internal repository.