Gradle Wrapper controlling gradle.init?


(Phil Swenson) #1

Gradle Wrapper and gradle.init file. Has anyone done anything with controlling the gradle.init via the gradle wrapper? Any plans/thoughts on this?


(Luke Daley) #2

Can you elaborate on what you want to achieve?

By controlling, do you mean specifying an init.gradle file to use for every build?


(Phil Swenson) #3

Sorry for not being clear. The ideal would be anyone could sync from source control, run gradlew and everything would be set up automatically - including the init.gradle.

We will have dozens of projects, so we would like to have a global init.gradle available via a URL.


(Luke Daley) #4

You could simply edit the gradlew and gradlew.bat scripts to implicitly add the -I option and point it at a file in your build. So you’d end up with transparent application of the file.

The only thing would be that you’d have to reapply your changes to the wrapper script when you upgrade the wrapper, but that wouldn’t be very difficult at all as these scripts change rarely.

As an aside, this is an area that we are trying to create a more robust solution for but it will be post 1.0.