I'm having few different variants and for each variant I'm having different module into my project but now I got a new requirement where I'll have to use an existing module in a new build variant. It means if any changes happen in code of variant1 the changes should be reflected in the apps of variant1 and variant3. Hope my query is clear.

In above image,
- main is the common module for each type of variant
- verify is the module which is completely different
- wallet is the module what I want to use in a new module i.e.
companion
Please guide me if there is a good solution to use it. Currently I'm copying whole files of wallet into companion which is not feasible solution for future.
let's assume we have
moduleAandmoduleB, to accessmoduleBinside ofmoduleAaddimplementation project(":moduleB")tomoduleAbuild.gradlefile.Note that all files inside
moduleBwill be available tomoduleAbut files insidemoduleAaren't available tomoduleBbe sure to declare your modules in settings.gradle
include ':moduleA'include ':moduleB'