July 2015
Intermediate to advanced
284 pages
5h 41m
English
In this section, we will discuss how to create a custom plugin. A plugin can be created by implementing the org.gradle.api.Plugin<T> interface. This interface has one method named apply(T target), which must be implemented in the plugin class. Typically, we write a plugin for the Gradle projects. In that situation, T becomes the Project. However, T can be any type of object.
The class that implements the plugin interface can be placed in various locations, such as:
buildSrc directoryThis is similar to creating a custom task that we discussed in the last chapter. When we define a plugin in the same build file, the scope is limited to the defining project only. This means, this plugin cannot ...
Read now
Unlock full access