Stay organized with collections
Save and categorize content based on your preferences.
Builder
@Incubating class Builder
Creates a Builder to instance to create a DslExtension containing all desired extension
points to the Android Gradle Plugin DSL.
Summary
Public constructors
|
Creates a Builder to instance to create a DslExtension containing all desired extension
points to the Android Gradle Plugin DSL.
|
Public constructors
<init>
Builder(dslName: String)
Creates a Builder to instance to create a DslExtension containing all desired extension
points to the Android Gradle Plugin DSL.
Parameters |
dslName: String |
the extension point name as it appears in build files. |
Public methods
extendProjectWith
fun extendProjectWith(typeExtension: Class<out Any>): DslExtension.Builder
Registers an extension point for the module's DSL, it will be available under the
android block.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# DslExtension.Builder\n\nBuilder\n=======\n\n```\n@Incubating class Builder\n```\n\n|---|---------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [com.android.build.api.variant.DslExtension.Builder](#) |\n\nCreates a [Builder](#) to instance to create a [DslExtension](/reference/tools/gradle-api/7.1/com/android/build/api/variant/DslExtension) containing all desired extension\npoints to the Android Gradle Plugin DSL.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [\u003cinit\u003e](#%3Cinit%3E(kotlin.String))`(`dslName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Creates a [Builder](#) to instance to create a [DslExtension](/reference/tools/gradle-api/7.1/com/android/build/api/variant/DslExtension) containing all desired extension points to the Android Gradle Plugin DSL. |\n\n| ### Public methods ||\n|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [DslExtension](/reference/tools/gradle-api/7.1/com/android/build/api/variant/DslExtension) | [build](#build())`()` Builds the final [DslExtension](/reference/tools/gradle-api/7.1/com/android/build/api/variant/DslExtension) instance that can be used with the [AndroidComponentsExtension.registerExtension](/reference/tools/gradle-api/7.1/com/android/build/api/variant/AndroidComponentsExtension#registerExtension(com.android.build.api.variant.DslExtension,%20kotlin.Function1)) API |\n| [DslExtension.Builder](#) | [extendBuildTypeWith](#extendBuildTypeWith(java.lang.Class))`(`typeExtension:` `[Class](http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html)\u003cout` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)\u003e`)` Registers an extension point for the [com.android.build.api.dsl.BuildType](../dsl/BuildType.html#) |\n| [DslExtension.Builder](#) | [extendProductFlavorWith](#extendProductFlavorWith(java.lang.Class))`(`typeExtension:` `[Class](http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html)\u003cout` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)\u003e`)` Registers an extension point for the [com.android.build.api.dsl.ProductFlavor](../dsl/ProductFlavor.html#) |\n| [DslExtension.Builder](#) | [extendProjectWith](#extendProjectWith(java.lang.Class))`(`typeExtension:` `[Class](http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html)\u003cout` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)\u003e`)` Registers an extension point for the module's DSL, it will be available under the android block. |\n\nPublic constructors\n-------------------\n\n### \\\u003cinit\\\u003e\n\n```\nBuilder(dslName: String)\n```\n\nCreates a [Builder](#) to instance to create a [DslExtension](/reference/tools/gradle-api/7.1/com/android/build/api/variant/DslExtension) containing all desired extension\npoints to the Android Gradle Plugin DSL.\n\n| Parameters ||\n|-------------------------------------------------------------------------------------------|--------------------------------------------------------|\n| dslName: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the extension point name as it appears in build files. |\n\nPublic methods\n--------------\n\n### build\n\n```\nfun build(): DslExtension\n```\n\nBuilds the final [DslExtension](/reference/tools/gradle-api/7.1/com/android/build/api/variant/DslExtension) instance that can be used with the\n[AndroidComponentsExtension.registerExtension](/reference/tools/gradle-api/7.1/com/android/build/api/variant/AndroidComponentsExtension#registerExtension(com.android.build.api.variant.DslExtension,%20kotlin.Function1)) API \n\n### extendBuildTypeWith\n\n```\nfun extendBuildTypeWith(typeExtension: Class\u003cout Any\u003e): DslExtension.Builder\n```\n\nRegisters an extension point for the [com.android.build.api.dsl.BuildType](../dsl/BuildType.html#) \n\n### extendProductFlavorWith\n\n```\nfun extendProductFlavorWith(typeExtension: Class\u003cout Any\u003e): DslExtension.Builder\n```\n\nRegisters an extension point for the [com.android.build.api.dsl.ProductFlavor](../dsl/ProductFlavor.html#) \n\n### extendProjectWith\n\n```\nfun extendProjectWith(typeExtension: Class\u003cout Any\u003e): DslExtension.Builder\n```\n\nRegisters an extension point for the module's DSL, it will be available under the\nandroid block."]]