Using gradle submodules instead of different branches.
bangarharshit opened this issue · 4 comments
It is a pretty useful project but switching branch can be a lot of effort. Why not just use different gradle submodules to demo different part of projects?
Hey @bangarharshit sounds like a good idea,
Do you have a rough module structure in mind for this or more insights? Thanks
How about just 6 different top-level modules?
dagger-android / master : Pokemon app using dagger-android (With Tests, Fragments)
dagger-android-dependent-comp : dagger-android with Dependent Component
dagger-android-dependent-comp-kotlin : In Kotlin
subcomponent : UserComponent as subcomponent
dependent-component : UserComponent as dependent component
dependent-component-kotlin : In Kotlin
To manage the dependency hell, you can use dependencies.gradle
as seen in AutoDispose
@bangarharshit Wouldn't that lead to a lot of code duplication within a single Android Studio project. dependencies.gradle
makes total sense but any ideas how can we reduce duplicated code. Suggestions welcome for such a modular structure / architecture which will be able to rectify code-duplication issue plud also accommodate kotlin samples.
Maintaining it would be even more difficult, in the current scenario I am able to cherry-pick common commits but in the case of different modules, I would need to make the change manually to all the projects. 🤔
@ragdroid that is a very good point. It also leads to multiple version of same classes in the ide. One way to keep common logic out is in a common module.
I think it is too big of a change and not worth the effort. The current project structure is really good. Feel free to close unless you have any other idea to modularize. 👍