configWithAndroidVariants

fun <T : Any> configWithAndroidVariants(defaultValue: T, defaultAndroidValue: T): ReadOnlyProperty<Rule, T>

Creates a delegated read-only property that can be used in ConfigAware objects. The name of the property is the key that is used during configuration lookup. The value of the property is evaluated only once.

Parameters

defaultValue

the value that the property evaluates to when there is no key with the name of the property in the config. Although T is defined as Any, only String, Int, Boolean and List are supported.

defaultAndroidValue

the value that the property evaluates to when there is no key with the name of the property in the config and there is a configuration property in the rule set named "android" that is set to true.


fun <T : Any, U : Any> configWithAndroidVariants(defaultValue: T, defaultAndroidValue: T, transformer: (T) -> U): ReadOnlyProperty<Rule, U>

Creates a delegated read-only property that can be used in ConfigAware objects. The name of the property is the key that is used during configuration lookup. The value of the property is evaluated and transformed only once.

Parameters

defaultValue

the value that the property evaluates to when there is no key with the name of the property in the config. Although T is defined as Any, only String, Int, Boolean and List are supported.

defaultAndroidValue

the value that the property evaluates to when there is no key with the name of the property in the config and there is a configuration property in the rule set named "android" that is set to true.

transformer

a function that transforms the value from the configuration (or the default) into its final value.