Closed stealthrabbi closed 4 years ago
I tried changing to variant.name.contains('item1Debug`), since that's what a :AndroidApp:lint reports as variants, but that did not work.
it seems that doing a variant filter on ebug
works to pick up capitalized Debug
for moduels with flavors, and also includes debug
builds for non-flavored modules. Or I can just remove the variant inclusion stuff completely. Is that the right way to do this?
If you remove variant filter, then the checks are going to run for all variants. This will essentially take much more time. If you're ok with checking only 1 variant, the execution will be faster. Keep in mind that checking only 1 variant can also cause issues being missed in the 2nd variant of their code is too diverged.
includeVariants
takes a predicate. It is up to you to decide how are you going to filter. Variant is the official Android Gradle plugin variants. Apart from name
, there should be other properties coming from variant that you can use to filter (e.g debuggable == true)
I have a static-analysis.gradle file similar to the example projects. Since adding build flavors, analysis isn't running on my app module for checkstyle, pmd, and spotbugs. It does run lint. Analysis is still running fully on other library modules I have in my multi-module project. I can't tell if it's somethign with my
includeVariants
or something else I need to do in the app module. Is there an example of how to use this plugin with build flavors? How do I know what my variants are?flavor config: