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. Use the instrumentation block.

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

This function is deprecated. 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.

Configuration

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

Sources

Access to variant's source files.

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.

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.