Table of Contents
API Documentation: | DynatraceExtension |
---|
The dynatrace
extension for specifying the auto-instrumentor configuration.
Property | Description |
configurations | Specifies multiple variant-specific configurations, where each variant-specific configuration can be applied to multiple Android build variants. |
pluginEnabled | Specifies if the plugin should be enabled. |
strictMode | Specifies if the build should fail, when the current variant has no variant-specific configuration. |
Block | Description |
configurations | Specifies multiple variant-specific configurations, where each variant-specific configuration can be applied to multiple Android build variants. |
NamedDomainObjectContainer
<VariantConfiguration
>
configurations
NamedDomainObjectContainer
<VariantConfiguration
>Specifies multiple variant-specific configurations, where each variant-specific configuration can be applied to multiple Android build variants.
Specifies if the plugin should be enabled.
If set to false, the plugin is applied but it does not insert the auto-instrumentation task into the Android build and it does not verify if the configuration of the extension is valid. It provides an easy way to temporarily deactivate the plugin.
The default value is true.
Specifies multiple variant-specific configurations, where each variant-specific configuration can be applied to multiple Android build variants.
The association is determined by the regex, that is specified in the variantFilter
property, and the
variant name of the Android build variant. The regex is case sensitivity and if no product flavor is
defined, the build type in the variant name is lower case. If multiple variant-specific configurations match the
same variant, then the first specified configuration is selected and applied.
For example, you can have an app that has two product flavors 'demo' and 'paid' and the two default build types
'debug' and 'release'. The Dynatrace Android Gradle plugin allows you to specify a variant-specific configuration
for all debug build variants ('demoDebug' and 'paidRelease') and another two variant-specific configurations for
your variants 'demoRelease' and 'paidRelease'. The sample below shows how to specify the variant-specific
configuration in the dynatrace
block.
dynatrace { configurations { dev { variantFilter "Debug" // build type name is upper case because a product flavor is used // other variant-specific properties } demo { variantFilter "demo" // the first product flavor name is always lower case // other variant-specific properties } prod { variantFilter "Release" // build type name is upper case because a product flavor is used // other variant-specific properties } } }
The association between variant-specific configurations from the Dynatrace Android Gradle plugin and the Android
build variants can be printed with the task printVariantAffiliation
. For example, the sample below
shows you the console output for the above example.
> Task :app:printVariantAffiliation Variant 'demoDebug' will use configuration 'dev' Variant 'demoRelease' will use configuration 'demo' Variant 'paidDebug' will use configuration 'dev' Variant 'paidRelease' will use configuration 'prod'
- Delegates to:
fromNamedDomainObjectContainer
<VariantConfiguration
>configurations