TestVariant

interface TestVariant : GeneratesTestApk, Variant


Variant for test-only modules.

Summary

Public properties

Property<String>

Variant's application ID as present in the final manifest file of the APK.

Provider<String>

The application of the app under tests.

Inherited functions

From class com.android.build.api.variant.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 class com.android.build.api.variant.HasAndroidResources
ResValue.Key
makeResValueKey(type: String, name: String)

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

From class com.android.build.api.variant.Variant
T?
<T : Any?> getExtension(type: Class<T>)

Returns an extension object registered via the VariantBuilder.registerExtension API or null if none were registered under the passed type.

@Incubating Unit
missingDimensionStrategy(
    dimension: String,
    vararg requestedValues: String
)

Set up a new matching request for a given flavor dimension and value.

Inherited properties

From class 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.

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.

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.

From class com.android.build.api.variant.GeneratesApk
AndroidResources

Variant's android resources processing configuration, initialized by the corresponding global DSL element.

ApkPackaging

Variant's packagingOptions, initialized by the corresponding global DSL element.

Renderscript?

Variant specific settings for the renderscript compiler.

AndroidVersion

Target SDK version for this variant.

AndroidVersion

This property is deprecated. Replaced with targetSdk, will be removed in 9.0

From class com.android.build.api.variant.GeneratesTestApk
Property<Boolean>

The functionalTest value to use to run the tests.

Property<Boolean>

The handleProfiling value to use to run the tests.

Property<String>

The instrumentationRunner to use to run the tests.

MapProperty<StringString>

The instrumentationRunnerArguments to use to run the tests.

Property<String?>

The test label.

From class 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.

From class com.android.build.api.variant.Variant
MapProperty<StringBuildConfigField<Serializable>>

Variant's BuildConfigField which will be generated in the BuildConfig class.

List<Component>

List containing this variant and all of its nestedComponents

MapProperty<StringAny>

Additional per variant experimental properties.

ExternalNativeBuild?

Variant's cmake ExternalNativeBuild, initialized by merging the product flavor values or null if no cmake external build is configured for this variant.

MapProperty<StringString>

MapProperty of the variant's manifest placeholders.

Int?

Gets the maximum supported SDK Version for this variant.

Int?

This property is deprecated. Will be removed in v9.0

AndroidVersion

Gets the minimum supported SDK Version for this variant.

AndroidVersion

This property is deprecated. Will be removed in v9.0

List<Component>

List of the components nested in this variant, the returned list will contain:

ListProperty<RegularFile>

List of proguard configuration files for this variant.

UnitTest?

This property is deprecated. Will be removed in v9.0

Public properties

applicationId

val applicationIdProperty<String>

Variant's application ID as present in the final manifest file of the APK.

testedApplicationId

val testedApplicationIdProvider<String>

The application of the app under tests.