Summary

In this chapter, we discussed that it is easy to use code analysis tools in a Gradle project. We can use Checkstyle, PMD, JDepend, and FindBugs for Java projects. For Groovy projects, we can use CodeNarc. All the plugins of these tools add new tasks to our project for each source set to do the analysis. Each of these tasks is a dependency task for the check task. So when we apply the plugin in a normal build, the code analysis will take place. We also discussed that the usage and syntax are mostly identical for each plugin.

In the next chapter, we will take a look at how to write our own custom task and plugin. We'll also discuss how to make it reusable in other Gradle builds.

Get Gradle Effective Implementations Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.