vanniktech/gradle-code-quality-tools-plugin

FindBugs is unable to find classes in a multiflavored project

budnyjj opened this issue · 5 comments

Hi @vanniktech, thanks for the great plugin! I believe it will become very popular soon.
There some issues, however, that prevent us from use it in production. Here is one of them.

Our project has a number of ABI flavors, like "arm" and "x86".
We found that it's not possible to perform FindBugs check on it:

./gradlew findbugs
... assembles all flavours ...
:app:assemble
:app:findbugs FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:findbugs'.
> No classes configured for FindBugs analysis.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

That's because it searches for classes to analyze in hardcoded place:
https://github.com/vanniktech/gradle-code-quality-tools-plugin/blob/master/src/main/groovy/com/vanniktech/code/quality/tools/CodeQualityToolsPlugin.groovy#L158 , but in our project these classes are placed in
a build/intermediates/classes/arm/debug .

Let's split this issue up into two.

  • Making the build directory configurable (you can do this via the extension)
  • Generating tasks per flavor (this is something I'm not really eager to get since I'm not using any flavors at all)

In any case PRs are welcome.

Created a separate issue: #68

Making the build directory configurable (you can do this via the extension)

Not sure since this path is hardcoded into plugin's code.

Yes which is why you want to make it configurable via the extension (e.g. look at toolVersion or any other of the extension properties).

Closing this. Have a look at #75 for the reasoning behind this.