VariantSelector

Added in 7.0.0

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<StringString>)

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

VariantSelector
withFlavor(dimension: String, flavorName: String)

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

VariantSelector

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

VariantSelector
withName(pattern: Pattern)

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

Public functions

all

Added in 7.0.0
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

Added in 7.0.0
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

Added in 7.0.0
fun withFlavor(flavorToDimension: Pair<StringString>): VariantSelector

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

Parameters
flavorToDimension: Pair<StringString>

Dimension and flavor to filter ComponentIdentity on.

Returns
VariantSelector

VariantSelector instance to further filter instances of ComponentIdentity

withFlavor

Added in 8.1.0
fun withFlavor(dimension: String, flavorName: String): VariantSelector

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

Parameters
dimension: String

dimension name

flavorName: String

flavor name to filter ComponentIdentity on.

Returns
VariantSelector

VariantSelector instance to further filter instances of ComponentIdentity

withName

Added in 7.0.0
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.

withName

Added in 7.0.0
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