Stay organized with collections Save and categorize content based on your preferences.

VariantSelector

interface VariantSelector


Selector to reduce the number of variants that are of interests when calling any of the variant API like AndroidComponentsExtension.beforeVariants.

Summary

Public functions

VariantSelector
all()

Creates a VariantSelector of ComponentIdentity that includes all the variants for the current module.

VariantSelector
withBuildType(buildType: String?)

Returns a new selector for ComponentIdentity objects with a given build type.

VariantSelector
withFlavor(flavorToDimension: Pair<String?, String?>?)

Returns a new selector for ComponentIdentity objects with a given (dimension, flavorName).

VariantSelector
withName(pattern: Pattern?)

Returns a new selector for ComponentIdentity objects with a given name pattern.

VariantSelector
withName(name: String?)

Returns a new selector for ComponentIdentity objects with a given name.

Public functions

all

fun all(): VariantSelector

Creates a VariantSelector of ComponentIdentity that includes all the variants for the current module.

Returns
VariantSelector

a VariantSelector for all variants.

withBuildType

fun withBuildType(buildType: String?): VariantSelector

Returns a new selector for ComponentIdentity objects with a given build type.

Parameters
buildType: String?

Build type to filter ComponentIdentity on.

Returns
VariantSelector

An instance of VariantSelector to further filter variants.

withFlavor

fun withFlavor(flavorToDimension: Pair<String?, String?>?): VariantSelector

Returns a new selector for ComponentIdentity objects with a given (dimension, flavorName).

Parameters
flavorToDimension: Pair<String?, String?>?

Dimension and flavor to filter ComponentIdentity on.

Returns
VariantSelector

VariantSelector instance to further filter instances of ComponentIdentity

withName

fun withName(pattern: Pattern?): VariantSelector

Returns a new selector for ComponentIdentity objects with a given name pattern.

Parameters
pattern: Pattern?

Pattern to apply on the org.gradle.api.Named.getName to filter ComponentIdentity instances on

withName

fun withName(name: String?): VariantSelector

Returns a new selector for ComponentIdentity objects with a given name.

Parameters
name: String?

String to test against the org.gradle.api.Named.getName for equality.