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

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

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

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.