ExtensionAware

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.

Properties

PropertyDescription
extensions

The set of extensions applied to this object.

Property details

ExtensionContainer extensions (read-only)

The set of extensions applied to this object.

Script blocks

No script blocks

Methods

No methods