Contents

Use the Groovy Gradle Plugin development plugin to assist Gradle plugin development implemented in Groovy. It configures the project to compile Groovy code, adds the Gradle API dependency as well as a compatible Groovy runtime dependency to the compileOnly configuration, and performs validation of plugin metadata. It is a drop-in replacement for the Gradle java-gradle-plugin and groovy core plugin.

Usage

Example 1. Applying the Groovy Gradle Plugin Development plugin
build.gradle
plugins {
   id 'dev.gradleplugins.groovy-gradle-plugin' version '1.2'
}
build.gradle.kts
plugins {
   id("dev.gradleplugins.groovy-gradle-plugin") version("1.2")
}

Extensions

The plugin provides the following extensions:

gradlePluginDevelopment() on RepositoryHandler

Adds the Gradle API redistribution repository to the project, e.g. https://repo.nokee.dev/release. Reads the redistributed Gradle API section to learn more.

gradleApi(version) on DependencyHandler

Creates a dependency on the Gradle API of the specified version, i.e. dev.gradleplugins:gradle-api:2.14.1. Reads the redistributed Gradle API section to learn more.

compatibility script block on GradlePluginDevelopmentExtension

Configures the Gradle plugin compatibility for the project, e.g. minimum supported Gradle version. Reads the minimum Gradle version section to learn more.

groovy script block on GradlePluginDevelopmentExtension

Configures the additional Javadoc, Groovydoc and source JARs for the project.