I have a multi-module project with a few Android apps and Android Library modules. It looks something like this:
├── awesomeapp (Android App)
├── coolapp (Android App)
└── modules
├── usefulprojectA (Android Lib)
└── usefulprojectB (Android Lib)
Both awesomeapp
and coolapp
depend on library modules:
implementation project(':modules:usefulprojectA:')
implementation project(':modules:usefulprojectB:')
What I would like to do is be able to say something like:
./gradlew awesomeapp:lint
or even
./gradlew awesomeapp:build
And have the lint task execute on awesomeapp
and on both usefulprojectA
and usefulprojectB
.
Currently the lint task would only apply to the top level project, i.e., awesomeapp
. So if I wanted to Lint the subprojects I'd have to call the lint task on the subproject directly:
./gradlew modules:usefulprojectA:lint
./gradlew modules:usefulprojectB:lint
Plus call the main project:
./gradlew awesomeapp:lint
But that's clumsy and will make my build script longer in both time and size.
So how does one apply the Lint task to subprojects too?