ExtensionAware (Gradle API 2.9)
Date: 2015-11-17

org.gradle.api.plugins

## Interface ExtensionAware

- All Known Subinterfaces:
    ObjectFilesToBinary, Project, Task
  All Known Implementing Classes:
    AbstractArchiveTask, AbstractCompile, AbstractCopyTask, AbstractExecTask, AbstractJettyRunTask, AbstractNativeCompileTask, AbstractNativePCHCompileTask, AbstractNativeSourceCompileTask, AbstractPublishToMaven, AbstractReportTask, AbstractScalaCompile, org.gradle.api.internal.AbstractTask, AntlrTask, AntTarget, Assemble, BrowserEvaluate, CCompile, CoffeeScriptCompile, CompareGradleBuilds, ComponentReport, org.gradle.api.internal.ConventionTask, Copy, CppCompile, CppPreCompiledHeaderCompile, CPreCompiledHeaderCompile, CreateStartScripts, DefaultTask, Delete, DependencyReportTask, Exec, GenerateBuildDashboard, GenerateCUnitLauncher, GenerateIvyDescriptor, GenerateMavenPom, GeneratorTask, GradleBuild, GroovyCompile, Groovydoc, HtmlDependencyReportTask, Jar, JavaCompile, Javadoc, JavaExec, JavaScriptMinify, JettyRun, JettyRunWar, JettyStop, JsHint, ModelReport, ObjectiveCCompile, ObjectiveCppCompile, ObjectiveCppPreCompiledHeaderCompile, ObjectiveCPreCompiledHeaderCompile, PlatformJavaCompile, PlatformScalaCompile, PlayCoffeeScriptCompile, PlayRun, PrefixHeaderFileGenerateTask, ProcessResources, ProjectReportTask, PropertiesGeneratorTask, PropertyReportTask, PublishToIvyRepository, PublishToMavenLocal, PublishToMavenRepository, RhinoShellExec, RoutesCompile, ScalaCompile, ScalaDoc, SonarRunner, SourceTask, Sync, Tar, TaskReportTask, Test, TestReport, TwirlCompile, Upload, WindowsResourceCompile, Wrapper, XmlGeneratorTask, Zip

      public interface ExtensionAware

  Objects that can be extended at runtime with other objects.

       // Extensions are just plain objects, there is no interface/type
       class MyExtension {
         String foo

         MyExtension(String foo) {
           this.foo = foo
         }
       }

       // Add new extensions via the extension container
       project.extensions.create('custom', MyExtension, "bar")
       //                       («name»,   «type»,       «constructor args», …)

       // extensions appear as properties on the target object by the given name
       assert project.custom instanceof MyExtension
       assert project.custom.foo == "bar"

       // also via a namespace method
       project.custom {
         assert foo == "bar"
         foo = "other"
       }
       assert project.custom.foo == "other"

       // Extensions added with the extension container's create method are themselves extensible
       assert project.custom instanceof ExtensionAware
       project.custom.extensions.create("nested", MyExtension, "baz")
       assert project.custom.nested.foo == "baz"

       // All extension aware objects have a special “ext” extension of type ExtraPropertiesExtension
       assert project.hasProperty("myProperty") == false
       project.ext.myProperty = "myValue"

       // Properties added to the “ext” extension are promoted to the owning object
       assert project.myProperty == "myValue"

  Many Gradle objects are extension aware. This includes; projects, tasks, configurations, dependencies etc.

  For more on adding & creating extensions, see `ExtensionContainer`.

  For more on extra properties, see `ExtraPropertiesExtension`.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ExtensionContainer` | `getExtensions()` The container of extensions.

- - ### Method Detail

    - #### getExtensions

          ExtensionContainer getExtensions()

      The container of extensions.