AndroidTestBuilder

Added in 8.3.1

interface AndroidTestBuilder : DeviceTestBuilder


Summary

Public properties

Boolean

Set to true if the variant's has any android tests, false otherwise.

Boolean?

Sets whether multi-dex is enabled for this variant.

Inherited properties

From com.android.build.api.variant.DeviceTestBuilder
Boolean

Specifies host test code coverage data collection by configuring the JacocoPlugin.

From com.android.build.api.variant.GeneratesApkBuilder
Int?

Sets the target SDK Version for this variant as an integer API level.

String?

Sets the target SDK Version for this variant as an integer API level.

From com.android.build.api.variant.GeneratesTestApkBuilder
Boolean

Sets the Test APK debuggable flag.

Public properties

enable

Added in 8.3.1
var enableBoolean

Set to true if the variant's has any android tests, false otherwise. Value is Boolean#True by default.

enableMultiDex

Added in 8.3.1
Deprecated in 8.3.1
var enableMultiDexBoolean?

Sets whether multi-dex is enabled for this variant.

This can be null, in which case the default value is used.

It is not safe to read the value of this property as other plugins that were applied later can change this value so there is no guarantee you would get the final value. To get the final value, use the AndroidComponentsExtension.onVariants API :

onVariants { variant ->
variant.dexing.isMultiDexEnabled
}

Note the a RuntimeException will be thrown at Runtime if a java or groovy code tries to read the property value.