idiomatic-gradle
idiomatic-gradle copied to clipboard
Only one Gradle Wrapper in repository root
I noticed there is no Gradle Wrapper in this project. I want to confirm this is intentional.
Personally, I have spent weeks in Gradle Wrapper Version Upgrade Hell because our Big Ball Of Mud Monorepo is riddled with Gradle Wrapper leading to insanity.
My goal is to refactor our Monorepo based on idiomatic-gradle
and remove all Gradle Wrapper along the way. Am I on the right path?
It's intentional that there is only one wrapper in the repository root.
I agree that if you have a mono-repo it does not make sense to have multiple wrappers in there. Unless builds are completely independent. Especially if you want to be able to build things together via includeBuild(...)
you should see that everything is building on the same Gradle version.
But it is a topic were some things are not so smooth right now:
- A technical issue is that if you open a single build in IntelliJ and you have no wrapper, the IDE can't figure out which Gradle version to use. To work around this, you can only have the
gradle/wrapper/grade-wrapper.properties
file (no Jar, no start scripts). And then have some automation to update all "grade-wrapper.properties" files at once. You could e.g. extend the "wrapper" task in your convention plugins to do that. - There is a similar (and more concerning) problem with
gradle.properties
. These should probably also be the same for all builds. But if you want to be able to run the builds independently you need to copy it in all the build roots (i.e. next to eachsettings.gradle
). Unless you put the gradle.properties in the user home or directly into the Gradle distribution.
But to give a short answer: I think you are on the right path. 👍 😃