The binary plugin

Binary plugins are classes that implement the Plugin interface, which you can embed into the build script. Alternatively, you can create a separate project, package it into a jar file and add that jar file as a classpath entry to a project. The second approach makes it more reusable. Each binary plugin has one ID to uniquely identify it. To use a binary plugin, you need to include it using the apply plugin statement:

apply plugin: '<pluginid>'

For example, to use the Java plugin, you can write the following code:

apply plugin: 'java'

You can also use the class type to add plugins. For example, if you are creating a custom class, DisplayPlugin, as a plugin, you can apply the following code:

apply plugin: DisplayPlugin

Before using this approach make sure you import this class in the build file using the import statement. All the Gradle core plugins are available to you by default. You do not need any additional configuration to use them. For third-party or community plugins, you need to make sure they are available in the classpath before you use them. You can do this by adding the plugin in the classpath using the buildscript{} closure. When you apply any plugin to a build file, all the tasks that are part of the plugin are automatically added. You can directly use the task with the default configurations or you can customize the task configuration, if needed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.51.36