Component

interface Component : ComponentIdentity

Known direct subclasses
TestComponent
TestFixtures
Variant

Parent interface for all types of variants.

Known indirect subclasses
AndroidTest

Properties for the android test Variant of a module.

ApplicationVariant

Properties for the main Variant of an application.

DynamicFeatureVariant
LibraryVariant

Variant for Library projects

TestVariant

Variant for test-only modules.

UnitTest

This interface is deprecated. Use the com.android.build.api.variant package

UnitTest

Summary

Public functions

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.

Public properties

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.

Instrumentation

Access to the variant's instrumentation options.

JavaCompilation

Access to the variant's java compilation options.

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.

Inherited properties

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

Build type name, might be replaced with access to locked DSL object once ready.

String?

The multi-flavor name of the variant.

String

Component's name.

List<Pair<StringString>>

List of flavor names, might be replaced with access to locked DSL objects once ready.

Public functions

setAsmFramesComputationMode

fun setAsmFramesComputationMode(mode: FramesComputationMode): Unit

transformClassesWith

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

Public properties

annotationProcessorConfiguration

val annotationProcessorConfigurationConfiguration

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

The returned Configuration should not be resolved until execution time.

artifacts

val artifactsArtifacts

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

compileClasspath

val compileClasspathFileCollection

Access to the variant's compile classpath.

The returned FileCollection should not be resolved until execution time.

compileConfiguration

val compileConfigurationConfiguration

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

The returned Configuration should not be resolved until execution time.

instrumentation

val instrumentationInstrumentation

Access to the variant's instrumentation options.

javaCompilation

val javaCompilationJavaCompilation

Access to the variant's java compilation options.

namespace

val namespaceProvider<String>

The namespace of the generated R and BuildConfig classes. Also, the namespace used to resolve any relative class names that are declared in the AndroidManifest.xml.

runtimeConfiguration

val runtimeConfigurationConfiguration

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

The returned Configuration should not be resolved until execution time.

sources

val sourcesSources

Access to variant's source files.