I've asked this and this questions a long time ago, and now that I have the time(don't have a choice) I've worked my way through the setting up of some of my projects.
The structure is similar to the one in the previous question but with a twist...
┌Just a folder
│
├── Project 1 - (Pure Java Modules)
│ │
│ ├── Module A1
│ ├── Module B1
│ :
│ └── Module Z1
│
├── Project 2 - (Android Libraries Modules)
│ │
│ ├── Module A2
│ ├── Module B2
│ :
│ └── Module Z2
│
└── Actual Android Project
That all the sub modules depends on the previous one e.g. Z1 depends on X1 ... B1 depends on A1 same goes for the {X}2 Series.
Since I have multiple projects which depends on the same top libraries(Z2,Z1), I would like to save me agony and text and avoid as much as possible duplicating the following across projects:
In the settings file:
include ':project1', ':project1:A1', ':project1:B1',..., ':project1:Z1'
include ':project2', ':project2:A2', ':project2:B2',..., ':project2:Z2'
project(':project1').projectDir = new File(settingsDir, '../somepath1/project1')
project(':project2').projectDir = new File(settingsDir, '../somepath2/project2')
project(':project2:A2').projectDir = new File(settingsDir, '../somepath2/project2/A2')
...
... etc...
In the build file:
evaluationDependsOn(':Project1')
evaluationDependsOn(':Project2')
dependencies {
compile project(':Project1:A1')
compile project(':Project1:B1')
...
compile project(':Project1:Z1')
compile project(':Project2:A2')
compile project(':Project2:B2')
...
compile project(':Project2:Z2')
}
It makes sense (assuming this is doable like in Eclipse/Maven/other dependencies) that if I'll add the top libraries projects Z1,Z2 to the application the rest of the nested dependencies within the hierarchy of sub projects would resolve without the need to literally specify each and every one on each of my top projects.
Is this possible with Gradle? How would I approach this with Gradle?