Package org.gradle.plugin.use
Interface PluginDependencySpec
-
public interface PluginDependencySpecA mutable specification of a dependency on a plugin.Can be used to specify the version of the plugin to use.
See
PluginDependenciesSpecfor more information about declaring plugin dependencies.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PluginDependencySpecapply(boolean apply)Specifies whether the plugin should be applied to the current project.PluginDependencySpecversion(java.lang.String version)Specify the version of the plugin to depend on.default PluginDependencySpecversion(Provider<java.lang.String> version)Specify the version of the plugin to depend on.
-
-
-
Method Detail
-
version
PluginDependencySpec version(@Nullable java.lang.String version)
Specify the version of the plugin to depend on.plugins { id "org.company.myplugin" version "1.0" }By default, dependencies have no (i.e.
Core plugins must not include a version number specification. Community plugins must include a version number specification.null) version.- Parameters:
version- the version string (nullfor no specified version, which is the default)- Returns:
- this
-
version
default PluginDependencySpec version(Provider<java.lang.String> version)
Specify the version of the plugin to depend on.plugins { id "org.company.myplugin" version libs.versions.myplugin }- Parameters:
version- the version provider, for example as found in a version catalog- Returns:
- this
- Since:
- 7.2
-
apply
PluginDependencySpec apply(boolean apply)
Specifies whether the plugin should be applied to the current project. Otherwise it is only put on the project's classpath.This is useful when reusing classes from a plugin or to apply a plugin to sub-projects:
plugins { id "org.company.myplugin" version "1.0" apply false } subprojects { if (someCondition) { apply plugin: "org.company.myplugin" } }- Parameters:
apply- whether to apply the plugin to the current project or not. Defaults to true- Returns:
- this
-
-