Groovy Documentation

org.gradle.api.plugins
Interface ProjectPluginsContainer

org.gradle.api.plugins.PluginContainer
  org.gradle.api.plugins.PluginCollection
      org.gradle.api.DomainObjectCollection
          org.gradle.api.plugins.ProjectPluginsContainer
All Superinterfaces:
PluginContainer, PluginCollection, DomainObjectCollection

interface ProjectPluginsContainer
extends PluginContainer

A ProjectPluginsContainer is used by a project to use plugins against the project and manage the plugins that have been used. Plugins can be specified by id or type. The id of a plugin is specified in the plugin.properties file in GRADLE_HOME. Only the plugin specified there have an id. The name of a plugin is either its id. In the case a plugin does not has an id, its name is the fully qualified class name.

author:
Hans Dockter


Method Summary
Plugin getPlugin(java.lang.String id)

Returns a plugin with the specified id if this plugin has been used in the project.

Plugin getPlugin(java.lang.Class type)

Returns a plugin with the specified type if this plugin has been used in the project.

Plugin usePlugin(java.lang.String id, Project project)

Has the same behavior as { is specified via its id.

T usePlugin(java.lang.Class type, Project project)

Uses a plugin against a particular project.

 
Methods inherited from interface PluginContainer
findPlugin, findPlugin, hasPlugin, hasPlugin
 
Methods inherited from interface PluginCollection
allPlugins, allPlugins, getAt, getByName, matching, whenPluginAdded, whenPluginAdded, withType
 
Methods inherited from interface DomainObjectCollection
allObjects, allObjects, findAll, findByName, getAll, getAsMap, getAt, getByName, getByName, matching, whenObjectAdded, whenObjectAdded, whenObjectRemoved, withType
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from class java.lang.Object
hashCode, getClass, equals, toString, wait, wait, wait, notify, notifyAll
 

Method Detail

getPlugin

public Plugin getPlugin(java.lang.String id)
Returns a plugin with the specified id if this plugin has been used in the project.
param:
id The id of the plugin


getPlugin

public Plugin getPlugin(java.lang.Class type)
Returns a plugin with the specified type if this plugin has been used in the project.
param:
type The type of the plugin


usePlugin

public Plugin usePlugin(java.lang.String id, Project project)
Has the same behavior as #usePlugin(Class, org.gradle.api.Project) except that the the plugin is specified via its id. Not all plugins have an id.
param:
id The id of the plugin to be used
param:
project The project against the plugin should be used
return:
The plugin which has been used against the project.


usePlugin

public T usePlugin(java.lang.Class type, Project project)
Uses a plugin against a particular project. This usually means that the plugin uses the project API to add and modify the state of the project. This method can be called an arbitrary number of time for a particular plugin type. The plugin will be actually used only the first time this method is called.
param:
type The type of the plugin to be used
param:
project The project against the plugin should be used
return:
The plugin which has been used against the project.


 

Groovy Documentation