API Documentation: | ExtensionAware |
---|
Represents an object that is able to accept DSL extensions. A DSL extension is basically a custom namespace in the DSL.
To add an extension to this object, you call ExtensionContainer.add()
on this
object's ExtensionContainer
, passing the extension object. The extension becomes a dynamic property of this target object:
extensions.add('custom', new MyPojo()) // Extension is available as a property custom.someProperty = 'value' // And as a script block custom { someProperty = 'value' } class MyPojo { String someProperty }
Extensions can also be added using a dynamic property accessor on the extension container:
project.extensions.myExtension = myPojo
is the same as project.extensions.add('myExtension', myPojo)
.
Many Gradle types implement this interface, either statically or dynamically at runtime.
Property | Description |
extensions | The set of extensions applied to this object. |
ExtensionContainer
extensions
(read-only)
The set of extensions applied to this object.