# Component

# Component

<br />

```
interface Component : ComponentIdentity
```

<br />

Known direct subclasses  
[TestComponent](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/TestComponent),[TestFixtures](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/TestFixtures),[Variant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Variant)  

|---------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|
| [TestComponent](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/TestComponent) |                                             |
| [TestFixtures](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/TestFixtures)   |                                             |
| [Variant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Variant)             | Parent interface for all types of variants. |

Known indirect subclasses  
[AndroidTest](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/AndroidTest),[ApplicationVariant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/ApplicationVariant),[DynamicFeatureVariant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/DynamicFeatureVariant),[LibraryVariant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/LibraryVariant),[TestVariant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/TestVariant),[UnitTest](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/component/UnitTest),[UnitTest](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/UnitTest)  

|-------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| [AndroidTest](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/AndroidTest)                     | Properties for the android test Variant of a module.                                                                                |
| [ApplicationVariant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/ApplicationVariant)       | Properties for the main Variant of an application.                                                                                  |
| [DynamicFeatureVariant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/DynamicFeatureVariant) |                                                                                                                                     |
| [LibraryVariant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/LibraryVariant)               | [Variant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Variant)for Library projects   |
| [TestVariant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/TestVariant)                     | [Variant](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Variant)for test-only modules. |
| [UnitTest](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/component/UnitTest)                         | **This interface is deprecated.**Use the com.android.build.api.variant package                                                      |
| [UnitTest](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/UnitTest)                           |                                                                                                                                     |

*** ** * ** ***

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Public functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | ~~[setAsmFramesComputationMode](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Component#setAsmFramesComputationMode(com.android.build.api.instrumentation.FramesComputationMode))~~`(mode: `[FramesComputationMode](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/instrumentation/FramesComputationMode)`?)` **This function is deprecated.**Use the instrumentation block.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `<ParamT : `[InstrumentationParameters](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/instrumentation/InstrumentationParameters)`?> `~~[transformClassesWith](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Component#transformClassesWith(java.lang.Class,com.android.build.api.instrumentation.InstrumentationScope,kotlin.Function1))~~`(` ` classVisitorFactoryImplClass: `[Class](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html)`<`[AsmClassVisitorFactory](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/instrumentation/AsmClassVisitorFactory)`<ParamT?>?>?,` ` scope: `[InstrumentationScope](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/instrumentation/InstrumentationScope)`?,` ` instrumentationParamsConfig: ((ParamT) `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)?` `)` **This function is deprecated.**Use the instrumentation block. |

|                                                                                                                                                       ### Public properties                                                                                                                                                       ||
|-------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Artifacts](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/artifact/Artifacts)            | [artifacts](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Component#artifacts()) Access to the variant's buildable artifacts for build customization. |
| [Instrumentation](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Instrumentation) | [instrumentation](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Component#instrumentation()) Access to the variant's instrumentation options.         |
| [JavaCompilation](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/JavaCompilation) | [javaCompilation](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Component#javaCompilation()) Access to the variant's java compilation options.        |
| [Sources](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Sources)                 | [sources](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Component#sources()) Access to variant's source files.                                        |

## Public functions

### setAsmFramesComputationMode

```
fun [setAsmFramesComputationMode](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Component#setAsmFramesComputationMode(com.android.build.api.instrumentation.FramesComputationMode))(mode: FramesComputationMode?): Unit
```
| **This function is deprecated.**   
Use the instrumentation block.  

### transformClassesWith

```
fun <ParamT : InstrumentationParameters?> [transformClassesWith](https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/Component#transformClassesWith(java.lang.Class,com.android.build.api.instrumentation.InstrumentationScope,kotlin.Function1))(
    classVisitorFactoryImplClass: Class<AsmClassVisitorFactory<ParamT?>?>?,
    scope: InstrumentationScope?,
    instrumentationParamsConfig: ((ParamT) -> Unit)?
): Unit
```
| **This function is deprecated.**   
| Use the instrumentation block.

## Public properties

### artifacts

```
val artifacts: Artifacts
```

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

### instrumentation

```
val instrumentation: Instrumentation
```

Access to the variant's instrumentation options.  

### javaCompilation

```
val javaCompilation: JavaCompilation
```

Access to the variant's java compilation options.  

### sources

```
val sources: Sources
```

Access to variant's source files.