Stay organized with collections
Save and categorize content based on your preferences.
DslExtension
@Incubating class DslExtension
Third party DSL extension configuration.
When a third party plugins needs to extend the Android Gradle Plugin DSL, it needs to indicate the location of these extension elements.
Currently, we support extending :
- [com.android.build.api.dsl.DefaultConfig]
- [com.android.build.api.dsl.BuildType]
- [com.android.build.api.dsl.ProductFlavor]
A plugin can choose to extend one or more of these elements by calling the appropriate methods on the Builder
like Builder.extendBuildTypeWith
to extend com.android.build.api.dsl.BuildType
.
Because the number of instances of each extension point is determined during evaluation phase, Gradle will be creating those instances on demand. See full documentation at : https://docs.gradle.org/current/userguide/custom_plugins.html#sec:getting_input_from_the_build
Summary
Public properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# DslExtension\n============\n\n\n```\n@Incubating class DslExtension\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThird party DSL extension configuration.\n\nWhen a third party plugins needs to extend the Android Gradle Plugin DSL, it needs to indicate the location of these extension elements.\n\nCurrently, we support extending :\n\n- \\[com.android.build.api.dsl.DefaultConfig\\]\n- \\[com.android.build.api.dsl.BuildType\\]\n- \\[com.android.build.api.dsl.ProductFlavor\\]\n\nA plugin can choose to extend one or more of these elements by calling the appropriate methods on the [Builder](/reference/tools/gradle-api/8.0/com/android/build/api/variant/DslExtension.Builder) like [Builder.extendBuildTypeWith](/reference/tools/gradle-api/8.0/com/android/build/api/variant/DslExtension.Builder#extendBuildTypeWith(java.lang.Class)) to extend [com.android.build.api.dsl.BuildType](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/BuildType).\n\nBecause the number of instances of each extension point is determined during evaluation phase, Gradle will be creating those instances on demand. See full documentation at : https://docs.gradle.org/current/userguide/custom_plugins.html#sec:getting_input_from_the_build\n\nSummary\n-------\n\n| ### Nested types ||\n|------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [DslExtension.Builder](/reference/tools/gradle-api/8.0/com/android/build/api/variant/DslExtension.Builder) | Creates a [Builder](/reference/tools/gradle-api/8.0/com/android/build/api/variant/DslExtension.Builder) to instance to create a [DslExtension](/reference/tools/gradle-api/8.0/com/android/build/api/variant/DslExtension) containing all desired extension points to the Android Gradle Plugin DSL. |\n\n| ### Public properties ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [Class](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html)`\u003c`[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`\u003e?` | [buildTypeExtensionType](/reference/tools/gradle-api/8.0/com/android/build/api/variant/DslExtension#buildTypeExtensionType()) |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [dslName](/reference/tools/gradle-api/8.0/com/android/build/api/variant/DslExtension#dslName()) |\n| [Class](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html)`\u003c`[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`\u003e?` | [productFlavorExtensionType](/reference/tools/gradle-api/8.0/com/android/build/api/variant/DslExtension#productFlavorExtensionType()) |\n| [Class](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html)`\u003c`[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`\u003e?` | [projectExtensionType](/reference/tools/gradle-api/8.0/com/android/build/api/variant/DslExtension#projectExtensionType()) |\n\nPublic properties\n-----------------\n\n### buildTypeExtensionType\n\n```\nval buildTypeExtensionType: Class\u003cAny\u003e?\n``` \n\n### dslName\n\n```\nval dslName: String\n``` \n\n### productFlavorExtensionType\n\n```\nval productFlavorExtensionType: Class\u003cAny\u003e?\n``` \n\n### projectExtensionType\n\n```\nval projectExtensionType: Class\u003cAny\u003e?\n```"]]