I asked this and this question a long time ago, and now that I have (I have no choice) I have worked my way through the creation 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 auxiliary modules depend on the previous one, for example, Z1 depends on X1 ... B1 depends on the same A1 as for the series {X} 2.
Since I have several projects that depend on the same top libraries (Z2, Z1), I would like to save me agony and text and avoid as much duplication of the following projects as possible:
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') }
This makes sense (assuming that it is doable, as in Eclipse / Maven / other dependencies), that if I add the best libraries to the application in the Z1, Z2 libraries, the remaining nested dependencies in the hierarchy of subprojects will allow each of them to be indicated literally for each of my best projects.
Is this possible with Gradle? How do I approach this with Gradle?