How to understand new gradle plugins?

How do I know what new plugins are available?

How do I know what tasks are available for those plugins?

what are the build conventions for those plugins?

Build Init plug in is documented here

Base plugin is documented here

Java plugin is documented here

Eclipse plugin is documented here

Life Cycle tasks are explained here

They define steps in a particular build flow

Like template/hook pattern they are the template steps

By attaching many plugin tasks that are specific and work horses to these lifecycle tasks they are executed in a particular order

A plugin can define its own life cycle tasks to make sense of its specific build needs.

How are plugins loaded in Gradle?

Search for: How are plugins loaded in Gradle?

Gradle at its core intentionally provides very little for real world automation. All of the useful features, like the ability to compile Java code, are added by plugins. Plugins add new tasks (e.g. JavaCompile), domain objects (e.g. SourceSet), conventions (e.g. Java source is located at src/main/java) as well as extending core objects and objects from other plugins.

Primary document on using Plugins is here


buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:0.4.1"
    }
}

apply plugin: "com.jfrog.bintray"

Here is the plugin script block explained

Here is the source cod eof plugins {} script delegate: PluginRequestCollector.java

How to search github projects for grepping: SOF discussion

Here is an explanation of scripts and their respective delegates

Interesting how the above doc is constructed from this XML authoring: dsl.xml!!


PluginUseScriptBlockMetadataExtractor  repo:gradle/gradle

This will grep for "PluginUseScriptBlockMetadataExtractor" in the repo path "repo:gradle/gradle"

See this source code for InitialPassStatementTransformer.java for special treatment of this script block

the above class is called from DefaultScriptPluginFactory

This goes into what parts of the script is first processed. It is suprizingly involved.

At the end of the line : plugins {} is treated special and different from the start

Here is the full list of plugins