TestFixtures

Added in 7.0.0

@Incubating
interface TestFixtures : GeneratesAar, HasAndroidResources, Component


Model for Test Fixtures components that contains build-time properties

This object is accessible on subtypes of Variant that implement HasTestFixtures, via HasTestFixtures.testFixtures. It is also part of Variant.nestedComponents.

The presence of this component in a variant is controlled by HasTestFixturesBuilder.enableTestFixtures which is accessible on subtypes of VariantBuilder that implement HasTestFixturesBuilder

Summary

Inherited functions

From com.android.build.api.variant.Component
String
@Incubating
computeTaskName(action: String, subject: String)

Utility method to create unique task name for component.

Unit

This function is deprecated. Will be removed in v9.0, use the instrumentation block.

Unit
<ParamT : InstrumentationParameters> transformClassesWith(
    classVisitorFactoryImplClass: Class<AsmClassVisitorFactory<ParamT>>,
    scope: InstrumentationScope,
    instrumentationParamsConfig: (ParamT) -> Unit
)

This function is deprecated. Will be removed in v9.0, use the instrumentation block.

From com.android.build.api.variant.HasAndroidResources
ResValue.Key
makeResValueKey(type: String, name: String)

Make a ResValue.Key to interact with resValues's MapProperty

Inherited properties

From com.android.build.api.variant.Component
Configuration

Access to the variant's annotation processor Configuration; for example, the debugAnnotationProcessor Configuration for the debug variant.

Artifacts

Access to the variant's buildable artifacts for build customization.

FileCollection

Access to the variant's compile classpath.

Configuration

Access to the variant's compile Configuration; for example, the debugCompileClasspath Configuration for the debug variant.

Boolean

Whether the produced artifacts will be debuggable

Instrumentation

Access to the variant's instrumentation options.

JavaCompilation

Access to the variant's java compilation options.

LifecycleTasks

Provides access to the LifecycleTasks created for this component.

Provider<String>

The namespace of the generated R and BuildConfig classes.

Configuration

Access to the variant's runtime Configuration; for example, the debugRuntimeClasspath Configuration for the debug variant.

Sources

Access to variant's source files.

From com.android.build.api.variant.ComponentIdentity
String?

Build type name.

String?

The multi-flavor name of the variant.

String

Component's name.

List<Pair<StringString>>

List of flavor names.

From com.android.build.api.variant.GeneratesAar
AarMetadata

Variant's aar metadata, initialized by merging the corresponding com.android.build.api.dsl.AarMetadata DSL elements.

From com.android.build.api.variant.HasAndroidResources
Property<Boolean>

Variant's is pseudo locales enabled, initialized by the corresponding DSL elements.

MapProperty<ResValue.KeyResValue>

Variant's ResValue which will be generated.