I'm trying to understand how should I approach the following project setup:
┌Top Android Project
│
├── Project 1 - (Pure Java Modules)
│ │
│ ├── Module A1
│ ├── Module B1
│ :
│ └── Module Z1
│
├── Project 2 - (Android Libraries Modules)
│ │
│ ├── Module A2
│ ├── Module B2
│ :
│ └── Module Z2
│
└── Module - Actual Android Project
In the current setup I have there is a build.gradle in each of the Modules, what I really hate about this setup is that all the content of the build.gradle is duplicated between modules.
Fact is that I would like the same logic in most of them, 'Pure Java Modules' are all infra modules, which I would like to Jar the output, the JavaDoc, and sources, and deploy to some remote repository (* default).
On the other hand, some modules of the 'Pure Java Modules' I would like to have a second agenda, for example, aside from the default* build I would like to deploy a jar with dependencies for a specific project, or something like that.
While building the Actual Android Project, I would like the modules to compile in the default* build, and finally to configure a default build.gradle for all of my Android projects, which are quite a few, and I would not like to duplicate that file.
===============================================================
I guess what I'm looking for is something like Maven parent pom, but since I don't fully understand how Gradle works, I'm opening this to you guys to share your thoughts...
Taking under consideration that duplicating same build file is (I dare say) unacceptable, due to the fact that I might want to change something in all the build logic of all the modules
What would be the best approach to handle this sort of setup?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…