Interface PluginManager
PluginAware object.- Since:
- 2.3
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionvoidApplies the given plugin.voidApplies the plugin with the given ID.findPlugin(String id) Returns the information about the plugin that has been applied with the given ID, or null if no plugin has been applied with the given ID.booleanReturnstrueif a plugin with the given ID has already been applied, otherwisefalse.voidwithPlugin(String id, Action<? super AppliedPlugin> action) Executes the given action when the specified plugin is applied.
- 
Method Details- 
applyApplies the plugin with the given ID. Does nothing if the plugin has already been applied.Plugins in the "org.gradle"namespace can be applied directly via name. That is, the following two lines are equivalent…pluginManager.apply "org.gradle.java" pluginManager.apply "java" - Parameters:
- pluginId- the ID of the plugin to apply
- Since:
- 2.3
 
- 
applyApplies the given plugin. Does nothing if the plugin has already been applied.The given class should implement the Plugininterface, and be parameterized for a compatible type ofthis.The following two lines are equivalent… pluginManager.apply org.gradle.api.plugins.JavaPlugin pluginManager.apply "org.gradle.java" - Parameters:
- type- the plugin class to apply
- Since:
- 2.3
 
- 
findPluginReturns the information about the plugin that has been applied with the given ID, or null if no plugin has been applied with the given ID.Plugins in the "org.gradle"namespace (that is, core Gradle plugins) can be specified by either name (e.g."java") or ID"org.gradle.java". All other plugins must be queried for by their full ID (e.g."org.company.some-plugin").Some Gradle plugins have not yet migrated to fully qualified plugin IDs. Such plugins can be detected with this method by simply using the unqualified ID (e.g. "some-third-party-plugin".- Parameters:
- id- the plugin ID
- Returns:
- information about the applied plugin, or nullif no plugin has been applied with the given ID
- Since:
- 2.3
 
- 
hasPluginReturnstrueif a plugin with the given ID has already been applied, otherwisefalse.- Parameters:
- id- the plugin ID. See- findPlugin(String)for details about this parameter.
- Returns:
- trueif the plugin has been applied
- Since:
- 2.3
 
- 
withPluginExecutes the given action when the specified plugin is applied.If a plugin with the specified ID has already been applied, the supplied action will be executed immediately. Otherwise, the action will executed immediately after a plugin with the specified ID is applied. The given action is always executed after the plugin has been applied. - Parameters:
- id- the plugin ID. See- findPlugin(String)for details about this parameter.
- action- the action to execute if/when the plugin is applied
- Since:
- 2.3
 
 
-