If we are working on a Java project, and we apply the Java plugin to our project, we will get an empty task, named check
. This is a dependency task for the build
task. This means that when we execute the build
task, the check
task is executed as well. We can write our own tasks to check something in our project and make it a dependency task for the check
task. So if the check
task is executed, our own task is executed as well. Not only the tasks that we write ourselves, but also the plugins can add new dependency tasks to the check
task.
In this chapter, we will see that most plugins will add one or more tasks as a dependency task to the check
task. This means that we can apply a plugin to our project, and when we invoke the check
or build
task, the extra tasks of the plugin are executed automatically.
Also, the check
task is dependent on the test
task. Gradle will always make sure that the test
task is executed before the check
task, so we know that all source...