In one of my projects, I make extensive use of Gradle’s module system. I even have modules nested within other modules. This has proved to be very useful. However, it’s very awkward to register these modules within Gradle. For example, imagine a module structure something like this:
- a
- b
-c
- x
- y
- z
In this example, the registering those modules looks like this:
import "a",
"a:b",
"a:b:c",
"a:b:c:x",
"a:b:c:y",
"a:b:c:z",
This is pretty repetitive and makes changing a module’s name very awkward. My immediate thought was to add a settings.gradle
in each module that would define its direct children, but that doesn’t seem to be supported. In my application, I ended up defining the module structure within a series of maps and using some Groovy to parse that out into the flattened version. However, this feels pretty icky. Is there a better way?