1

I have several projects which depend on certain submodules. These dependencies are overlapping, which is why I basically organized all modules in one root folder. So let's say the structure looks like this:

Root
|- M1
|- M2
|- M3
|- M4
|- M5
|- M6
|- ...
|- P1
|- P2
|- P3
|- P4

And let's say the dependencies are:

P1 -> M1, M2, M3
P2 -> M1, M4, M5
P3 -> P1, M6
P4 -> P1, P2

This means that every project has an entry for each used project/module in their respective settings.gradle:

include ':M1'
project(':M1').projectDir = new File(settingsDir, '../M1')

Now this leads to a problem, that those settings.gradle files do not get included transitively. If I look at P4 I would have assumed I can just say:

include ':P1'
project(':P1').projectDir = new File(settingsDir, '../P1')
include ':P2'
project(':P2').projectDir = new File(settingsDir, '../P2')

Unfortunately, I have to include entries for M1-M5 as well, since they are referenced by P1 and P2. Is there a way to structure this better?

T. Marks
  • 21
  • 1

0 Answers0