AndroidTest

public interface AndroidTest extends GeneratesTestApk, TestComponent, HasAndroidResources


Properties for the android test Variant of a module.

Summary

Public methods

abstract @NonNull Property<@NonNull String>

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

abstract @NonNull MapProperty<@NonNull String, @NonNull BuildConfigField<@NonNull Serializable>>

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

abstract @NonNull ListProperty<@NonNull RegularFile>

List of proguard configuration files for this variant.

abstract SigningConfig

Variant's signingConfig, initialized by the corresponding DSL element.

Inherited methods

From com.android.build.api.variant.Component
abstract @NonNull Configuration

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

abstract @NonNull Artifacts

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

abstract @NonNull FileCollection

Access to the variant's compile classpath.

abstract @NonNull Configuration

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

abstract @NonNull Instrumentation

Access to the variant's instrumentation options.

abstract @NonNull JavaCompilation

Access to the variant's java compilation options.

abstract @NonNull Provider<@NonNull String>

The namespace of the generated R and BuildConfig classes.

abstract @NonNull Configuration

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

abstract @NonNull Sources

Access to variant's source files.

abstract void

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

abstract void
<ParamT extends InstrumentationParameters> transformClassesWith(
    @NonNull Class<@NonNull AsmClassVisitorFactory<@NonNull ParamT>> classVisitorFactoryImplClass,
    @NonNull InstrumentationScope scope,
    @NonNull Function1<@NonNull ParamT, Unit> instrumentationParamsConfig
)

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

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

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

abstract String

The multi-flavor name of the variant.

abstract @NonNull String

Component's name.

abstract @NonNull List<@NonNull Pair<@NonNull String, @NonNull String>>

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

From com.android.build.api.variant.GeneratesApk
abstract @NonNull AndroidResources

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

abstract @NonNull ApkPackaging

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

abstract Renderscript

Variant specific settings for the renderscript compiler.

abstract @NonNull AndroidVersion

Target SDK version for this variant.

abstract @NonNull AndroidVersion
From com.android.build.api.variant.GeneratesTestApk
abstract @NonNull Property<@NonNull Boolean>

The functionalTest value to use to run the tests.

abstract @NonNull Property<@NonNull Boolean>

The handleProfiling value to use to run the tests.

abstract @NonNull Property<@NonNull String>

The instrumentationRunner to use to run the tests.

abstract @NonNull MapProperty<@NonNull String, @NonNull String>

The instrumentationRunnerArguments to use to run the tests.

abstract @NonNull Property<String>

The test label.

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

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

abstract @NonNull MapProperty<@NonNull ResValue.Key, @NonNull ResValue>

Variant's ResValue which will be generated.

abstract @NonNull ResValue.Key

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

From com.android.build.api.variant.TestComponent
abstract @NonNull MapProperty<@NonNull String, @NonNull String>

MapProperty of the test component's manifest placeholders.

Public methods

getApplicationId

abstract @NonNull Property<@NonNull StringgetApplicationId()

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

getBuildConfigFields

abstract @NonNull MapProperty<@NonNull String, @NonNull BuildConfigField<@NonNull Serializable>> getBuildConfigFields()

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

getProguardFiles

abstract @NonNull ListProperty<@NonNull RegularFilegetProguardFiles()

List of proguard configuration files for this variant. The list is initialized from the corresponding DSL element, and cannot be queried at configuration time. At configuration time, you can only add new elements to the list.

getSigningConfig

abstract SigningConfig getSigningConfig()

Variant's signingConfig, initialized by the corresponding DSL element.

Returns
SigningConfig

Variant's config or null if the variant is not configured for signing.