api / org.gradle.plugin.use / PluginDependenciesSpec

PluginDependenciesSpec

@Incubating interface PluginDependenciesSpec

The DSL for declaring plugins to use in a script.

In a build script, the plugins {} script block API is of this type. That is, you can use this API in the body of the plugins script block to declare plugins to be used for the script.

Relationship with the apply() method

The plugins {} block serves a similar purpose to the org.gradle.api.plugins.PluginAware#apply(java.util.Map) method that can be used to apply a plugin directly to a Project object or similar. A key difference is that plugins applied via the plugins {} block are conceptually applied to the script, and by extension the script target. At this time there is no observable practical difference between the two approaches with regard to the end result. The plugins {} block is a new, incubating, Gradle feature that will evolve to offer benefits over the apply() approach.

Strict Syntax

The plugins {} block only allows a strict subset of the full build script programming language. Only the API of this type can be used, and values must be literal (e.g. constant strings, not variables). Moreover, the plugins {} block must be the first code of a build script. There is one exception to this, in that the buildscript {} block (used for declaring script dependencies) must precede it.

This implies the following constraints:

Available Plugins Core Plugins

Core Gradle plugins are able to be applied using the plugins {} block. Core plugins must be specified without a version number, and can have a qualified or unqualified id. That is, the java plugin can be used via:

 plugins { id 'java' } 

Or via:

 plugins { id 'org.gradle.java' } 

Core Gradle plugins use the org.gradle namespace.

For the list of available core plugins for a particular Gradle version, please consult the User Guide.

Community Plugins

Non-core plugins are available from the Gradle Plugin Portal. These plugins are contributed by users of Gradle to extend Gradle's functionality. Visit plugins.gradle.org to browse the available plugins and versions.

To use a community plugin, the fully qualified id must be specified along with a version.

Functions

id

abstract fun id(id: String): PluginDependencySpec

Add a dependency on the plugin with the given id.

 plugins { id "org.company.myplugin" } 
Further constraints (e.g. version number) can be specified by the methods of the return value.
 plugins { id "org.company.myplugin" version "1.3" } 
Plugins are automatically applied to the current script by default. This can be disabled using the apply false option:
 plugins { id "org.company.myplugin" version "1.3" apply false } 
This is useful to reuse task classes from a plugin or to apply it to some other target than the current script.

Extension Properties

announce

val PluginDependenciesSpec.announce: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.announce.AnnouncePlugin.

antlr

val PluginDependenciesSpec.antlr: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.antlr.AntlrPlugin.

application

val PluginDependenciesSpec.application: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.ApplicationPlugin.

assembler

val PluginDependenciesSpec.assembler: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.assembler.plugins.AssemblerPlugin.

assembler-lang

val PluginDependenciesSpec.assembler-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.assembler.plugins.AssemblerLangPlugin.

base

val PluginDependenciesSpec.base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.BasePlugin.

binary-base

val PluginDependenciesSpec.binary-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.platform.base.plugins.BinaryBasePlugin.

build-announcements

val PluginDependenciesSpec.build-announcements: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.announce.BuildAnnouncementsPlugin.

build-dashboard

val PluginDependenciesSpec.build-dashboard: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.reporting.plugins.BuildDashboardPlugin.

build-init

val PluginDependenciesSpec.build-init: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.buildinit.plugins.BuildInitPlugin.

build-scan

val PluginDependenciesSpec.build-scan: PluginDependencySpec

The build-scan plugin.

c

val PluginDependenciesSpec.c: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.c.plugins.CPlugin.

c-lang

val PluginDependenciesSpec.c-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.c.plugins.CLangPlugin.

checkstyle

val PluginDependenciesSpec.checkstyle: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.CheckstylePlugin.

clang-compiler

val PluginDependenciesSpec.clang-compiler: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.plugins.ClangCompilerPlugin.

codenarc

val PluginDependenciesSpec.codenarc: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.CodeNarcPlugin.

coffeescript-base

val PluginDependenciesSpec.coffeescript-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.javascript.coffeescript.CoffeeScriptBasePlugin.

compare-gradle-builds

val PluginDependenciesSpec.compare-gradle-builds: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.buildcomparison.gradle.CompareGradleBuildsPlugin.

component-base

val PluginDependenciesSpec.component-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.platform.base.plugins.ComponentBasePlugin.

component-model-base

val PluginDependenciesSpec.component-model-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.base.plugins.ComponentModelBasePlugin.

cpp

val PluginDependenciesSpec.cpp: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppPlugin.

cpp-application

val PluginDependenciesSpec.cpp-application: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppApplicationPlugin.

cpp-lang

val PluginDependenciesSpec.cpp-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppLangPlugin.

cpp-library

val PluginDependenciesSpec.cpp-library: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppLibraryPlugin.

cpp-unit-test

val PluginDependenciesSpec.cpp-unit-test: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.cpp.plugins.CppUnitTestPlugin.

cunit

val PluginDependenciesSpec.cunit: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.cunit.plugins.CUnitConventionPlugin.

cunit-test-suite

val PluginDependenciesSpec.cunit-test-suite: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.cunit.plugins.CUnitPlugin.

distribution

val PluginDependenciesSpec.distribution: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.distribution.plugins.DistributionPlugin.

ear

val PluginDependenciesSpec.ear: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.ear.EarPlugin.

eclipse

val PluginDependenciesSpec.eclipse: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.ide.eclipse.EclipsePlugin.

eclipse-wtp

val PluginDependenciesSpec.eclipse-wtp: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.ide.eclipse.EclipseWtpPlugin.

embedded-kotlin

val PluginDependenciesSpec.embedded-kotlin: PluginDependencySpec

The embedded-kotlin plugin.

envjs

val PluginDependenciesSpec.envjs: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.javascript.envjs.EnvJsPlugin.

findbugs

val PluginDependenciesSpec.findbugs: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.FindBugsPlugin.

gcc-compiler

val PluginDependenciesSpec.gcc-compiler: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.plugins.GccCompilerPlugin.

google-test

val PluginDependenciesSpec.google-test: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.googletest.plugins.GoogleTestConventionPlugin.

google-test-test-suite

val PluginDependenciesSpec.google-test-test-suite: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.googletest.plugins.GoogleTestPlugin.

groovy

val PluginDependenciesSpec.groovy: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.GroovyPlugin.

groovy-base

val PluginDependenciesSpec.groovy-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.GroovyBasePlugin.

help-tasks

val PluginDependenciesSpec.help-tasks: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.HelpTasksPlugin.

idea

val PluginDependenciesSpec.idea: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.ide.idea.IdeaPlugin.

ivy-publish

val PluginDependenciesSpec.ivy-publish: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.publish.ivy.plugins.IvyPublishPlugin.

jacoco

val PluginDependenciesSpec.jacoco: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.testing.jacoco.plugins.JacocoPlugin.

java

val PluginDependenciesSpec.java: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaPlugin.

java-base

val PluginDependenciesSpec.java-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaBasePlugin.

java-gradle-plugin

val PluginDependenciesSpec.java-gradle-plugin: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugin.devel.plugins.JavaGradlePluginPlugin.

java-lang

val PluginDependenciesSpec.java-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.java.plugins.JavaLanguagePlugin.

java-library

val PluginDependenciesSpec.java-library: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaLibraryPlugin.

java-library-distribution

val PluginDependenciesSpec.java-library-distribution: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaLibraryDistributionPlugin.

javascript-base

val PluginDependenciesSpec.javascript-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.javascript.base.JavaScriptBasePlugin.

jdepend

val PluginDependenciesSpec.jdepend: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.JDependPlugin.

jshint

val PluginDependenciesSpec.jshint: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.javascript.jshint.JsHintPlugin.

junit-test-suite

val PluginDependenciesSpec.junit-test-suite: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.jvm.plugins.JUnitTestSuitePlugin.

jvm-component

val PluginDependenciesSpec.jvm-component: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.jvm.plugins.JvmComponentPlugin.

jvm-resources

val PluginDependenciesSpec.jvm-resources: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.jvm.plugins.JvmResourcesPlugin.

kotlin-dsl

val PluginDependenciesSpec.kotlin-dsl: PluginDependencySpec

The kotlin-dsl plugin.

language-base

val PluginDependenciesSpec.language-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.base.plugins.LanguageBasePlugin.

lifecycle-base

val PluginDependenciesSpec.lifecycle-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.base.plugins.LifecycleBasePlugin.

maven

val PluginDependenciesSpec.maven: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.MavenPlugin.

maven-publish

val PluginDependenciesSpec.maven-publish: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.publish.maven.plugins.MavenPublishPlugin.

microsoft-visual-cpp-compiler

val PluginDependenciesSpec.microsoft-visual-cpp-compiler: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.plugins.MicrosoftVisualCppCompilerPlugin.

native-component

val PluginDependenciesSpec.native-component: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.plugins.NativeComponentPlugin.

native-component-model

val PluginDependenciesSpec.native-component-model: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.plugins.NativeComponentModelPlugin.

objective-c

val PluginDependenciesSpec.objective-c: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.objectivec.plugins.ObjectiveCPlugin.

objective-c-lang

val PluginDependenciesSpec.objective-c-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.objectivec.plugins.ObjectiveCLangPlugin.

objective-cpp

val PluginDependenciesSpec.objective-cpp: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.objectivecpp.plugins.ObjectiveCppPlugin.

objective-cpp-lang

val PluginDependenciesSpec.objective-cpp-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.objectivecpp.plugins.ObjectiveCppLangPlugin.

osgi

val PluginDependenciesSpec.osgi: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.osgi.OsgiPlugin.

play

val PluginDependenciesSpec.play: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.play.plugins.PlayPlugin.

play-application

val PluginDependenciesSpec.play-application: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.play.plugins.PlayApplicationPlugin.

play-coffeescript

val PluginDependenciesSpec.play-coffeescript: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.play.plugins.PlayCoffeeScriptPlugin.

play-ide

val PluginDependenciesSpec.play-ide: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.play.plugins.ide.PlayIdePlugin.

play-javascript

val PluginDependenciesSpec.play-javascript: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.play.plugins.PlayJavaScriptPlugin.

pmd

val PluginDependenciesSpec.pmd: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.PmdPlugin.

project-report

val PluginDependenciesSpec.project-report: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.ProjectReportsPlugin.

project-reports

val PluginDependenciesSpec.project-reports: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.ProjectReportsPlugin.

publishing

val PluginDependenciesSpec.publishing: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.publish.plugins.PublishingPlugin.

reporting-base

val PluginDependenciesSpec.reporting-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.ReportingBasePlugin.

rhino

val PluginDependenciesSpec.rhino: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.javascript.rhino.RhinoPlugin.

scala

val PluginDependenciesSpec.scala: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.scala.ScalaPlugin.

scala-base

val PluginDependenciesSpec.scala-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.scala.ScalaBasePlugin.

scala-lang

val PluginDependenciesSpec.scala-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.scala.plugins.ScalaLanguagePlugin.

signing

val PluginDependenciesSpec.signing: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.signing.SigningPlugin.

standard-tool-chains

val PluginDependenciesSpec.standard-tool-chains: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.internal.plugins.StandardToolChainsPlugin.

swift-application

val PluginDependenciesSpec.swift-application: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.swift.plugins.SwiftApplicationPlugin.

swift-library

val PluginDependenciesSpec.swift-library: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.swift.plugins.SwiftLibraryPlugin.

swiftpm-export

val PluginDependenciesSpec.swiftpm-export: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.swiftpm.plugins.SwiftPackageManagerExportPlugin.

visual-studio

val PluginDependenciesSpec.visual-studio: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.ide.visualstudio.plugins.VisualStudioPlugin.

war

val PluginDependenciesSpec.war: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.WarPlugin.

windows-resource-script

val PluginDependenciesSpec.windows-resource-script: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.rc.plugins.WindowsResourceScriptPlugin.

windows-resources

val PluginDependenciesSpec.windows-resources: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.rc.plugins.WindowsResourcesPlugin.

wrapper

val PluginDependenciesSpec.wrapper: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.buildinit.plugins.WrapperPlugin.

xcode

val PluginDependenciesSpec.xcode: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.ide.xcode.plugins.XcodePlugin.

xctest

val PluginDependenciesSpec.xctest: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.xctest.plugins.XCTestConventionPlugin.

Extension Functions

kotlin

fun PluginDependenciesSpec.kotlin(module: String): PluginDependencySpec

Applies the given Kotlin plugin module.

Inheritors

PluginDependenciesSpecScope

class PluginDependenciesSpecScope : PluginDependenciesSpec

Receiver for the plugins block.