org.gradle.api.plugins
Interface ExtensionAware

All Known Subinterfaces:
Project, Task
All Known Implementing Classes:
AbstractArchiveTask, AbstractCompile, AbstractCopyTask, AbstractJettyRunTask, AbstractReportTask, org.gradle.api.internal.AbstractTask, AntlrTask, AntTarget, Checkstyle, CodeNarc, Compile, org.gradle.api.internal.ConventionTask, Copy, DefaultTask, Delete, DependencyReportTask, Exec, GeneratorTask, GradleBuild, GroovyCompile, Groovydoc, Javadoc, JavaExec, JettyRun, JettyRunWar, JettyStop, ProjectReportTask, PropertyReportTask, ScalaCompile, ScalaDoc, SourceTask, Sync, Tar, TaskReportTask, Test, Upload, Wrapper, XmlGeneratorTask, Zip

public interface 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(String, Object) 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.


Method Summary
 ExtensionContainer getExtensions()
          Returns the set of extensions applied to this object.
 

Method Detail

getExtensions

ExtensionContainer getExtensions()
Returns the set of extensions applied to this object.