Stay organized with collections
Save and categorize content based on your preferences.
FlavoredComponentActionRegistrar
@Incubating interface FlavoredComponentActionRegistrar<ComponentT> : BuildTypedComponentActionRegistrar<ComponentT> where ComponentT : ActionableComponentObject, ComponentT : ComponentIdentity
Allows registering Actions on ComponentT, with the ability to include
filters to target sub sets of ComponentT.
This registrar only offers product flavors and build type of ComponentIdentity as filters.
Calls can be chained to include more than one filters, though in some cases, selecting a
particular filter can reduce the list of available filters in the chain.
Summary
Public methods
|
abstract BuildTypedComponentActionRegistrar<ComponentT> |
Filters ComponentT instances using a build type reference.
|
abstract Unit |
Specifies the build type this filter should apply when filtering variants.
|
abstract Unit |
Filters ComponentT instances using a build type reference and run a lambda of all the filtered
instances.
|
Public methods
withBuildType
abstract fun withBuildType(
buildType: String,
action: Action<ComponentT>
): Unit
Specifies the build type this filter should apply when filtering variants.
withBuildType
abstract fun withBuildType(
buildType: String,
action: ComponentT.() -> Unit
): Unit
Filters ComponentT instances using a build type reference and run a lambda of all the filtered
instances.
Parameters |
buildType: String |
to filter ComponentT on |
action: ComponentT.() -> Unit |
lambda function to run on filtered ComponentT |
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,["# FlavoredComponentActionRegistrar\n================================\n\n```\n@Incubating interface FlavoredComponentActionRegistrar\u003cComponentT\u003e : BuildTypedComponentActionRegistrar\u003cComponentT\u003e where ComponentT : ActionableComponentObject, ComponentT : ComponentIdentity\n```\n\n|-----------------------------------------------------------------------|\n| [com.android.build.api.component.FlavoredComponentActionRegistrar](#) |\n\nAllows registering Actions on ComponentT, with the ability to include\nfilters to target sub sets of ComponentT.\n\nThis registrar only offers product flavors and build type of [ComponentIdentity](/reference/tools/gradle-api/4.1/com/android/build/api/component/ComponentIdentity) as filters.\n\nCalls can be chained to include more than one filters, though in some cases, selecting a\nparticular filter can reduce the list of available filters in the chain.\n\nSummary\n-------\n\n| ### Public methods ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [BuildTypedComponentActionRegistrar](/reference/tools/gradle-api/4.1/com/android/build/api/component/BuildTypedComponentActionRegistrar)\\\u003cComponentT\\\u003e | [withBuildType](#withBuildType(kotlin.String))`(`buildType:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Filters ComponentT instances using a build type reference. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [withBuildType](#withBuildType(kotlin.String,%20org.gradle.api.Action))`(`buildType:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `action:` `[Action](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html)\u003cComponentT\u003e`)` Specifies the build type this filter should apply when filtering variants. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [withBuildType](#withBuildType(kotlin.String,%20kotlin.Function1))`(`buildType:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `action:` `ComponentT.()` `-\u003e` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` Filters ComponentT instances using a build type reference and run a lambda of all the filtered instances. |\n\n| ### Inherited functions ||\n|---|---|\n| From class [BuildTypedComponentActionRegistrar](/reference/tools/gradle-api/4.1/com/android/build/api/component/BuildTypedComponentActionRegistrar) |------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [withFlavor](/reference/tools/gradle-api/4.1/com/android/build/api/component/BuildTypedComponentActionRegistrar#withFlavor(kotlin.Pair,%20org.gradle.api.Action))`(`flavorToDimension:` `[Pair](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html)\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html),` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)\u003e`, `action:` `[Action](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html)\u003cComponentT\u003e`)` Filters ComponentT instances with a flavor \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [withFlavor](/reference/tools/gradle-api/4.1/com/android/build/api/component/BuildTypedComponentActionRegistrar#withFlavor(kotlin.Pair,%20kotlin.Function1))`(`flavorToDimension:` `[Pair](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html)\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html),` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)\u003e`, `action:` `ComponentT.()` `-\u003e` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` Filters ComponentT instances with a flavor \u003cbr /\u003e | | [BuildTypedComponentActionRegistrar](/reference/tools/gradle-api/4.1/com/android/build/api/component/BuildTypedComponentActionRegistrar)\u003cComponentT\u003e | [withFlavor](/reference/tools/gradle-api/4.1/com/android/build/api/component/BuildTypedComponentActionRegistrar#withFlavor(kotlin.Pair))`(`flavorToDimension:` `[Pair](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html)\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html),` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)\u003e`)` Filters ComponentT instances with a flavor, and return the same filter instance for further product flavor filtering. \u003cbr /\u003e | ||\n\nPublic methods\n--------------\n\n### withBuildType\n\n```\nabstract fun withBuildType(buildType: String): BuildTypedComponentActionRegistrar\u003cComponentT\u003e\n```\n\nFilters ComponentT instances using a build type reference.\n\n| Parameters ||\n|---------------------------------------------------------------------------------------------|-------------------------|\n| buildType: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | to filter ComponentT on |\n\n| Return ||\n|---|---|\n| an instance of [BuildTypedComponentActionRegistrar](/reference/tools/gradle-api/4.1/com/android/build/api/component/BuildTypedComponentActionRegistrar) to further filter variants. ||\n\n### withBuildType\n\n```\nabstract fun withBuildType(\n buildType: String, \n action: Action\u003cComponentT\u003e\n): Unit\n```\n\nSpecifies the build type this filter should apply when filtering variants. \n\n### withBuildType\n\n```\nabstract fun withBuildType(\n buildType: String, \n action: ComponentT.() -\u003e Unit\n): Unit\n```\n\nFilters ComponentT instances using a build type reference and run a lambda of all the filtered\ninstances.\n\n| Parameters ||\n|--------------------------------------------------------------------------------------------------------|-----------------------------------------------|\n| buildType: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | to filter ComponentT on |\n| action: ComponentT.() -\\\u003e [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | lambda function to run on filtered ComponentT |"]]