KeepRules

Added in 7.3.0

@Incubating
interface KeepRules


DSL object for external library dependencies keep rules configurations.

Summary

Public functions

Unit

This function is deprecated. Renamed to ignoreFromAllExternalDependencies

Unit

This function is deprecated. Renamed to ignoreFrom

Unit

Ignore keep rules from listed external dependencies.

Unit

Ignore keep rules from all the external dependencies.

Public properties

SetProperty<File>

Keep rules files set

Boolean

This flag will include default keep rules that enables shrinking, obfuscation, and optimization of bytecode when optimization.enable is on.

Public functions

ignoreAllExternalDependencies

Added in 7.3.0
Deprecated in 8.4.0
@Incubating
fun ignoreAllExternalDependencies(ignore: Boolean): Unit

ignoreExternalDependencies

Added in 7.3.0
Deprecated in 8.4.0
@Incubating
fun ignoreExternalDependencies(vararg ids: String): Unit

ignoreFrom

Added in 8.4.0
@Incubating
fun ignoreFrom(vararg ids: String): Unit

Ignore keep rules from listed external dependencies. External dependencies can be specified via GAV coordinates(e.g. "groupId:artifactId:version") or in the format of "groupId:artifactId" in which case dependencies are ignored as long as they match groupId & artifactId.

ignoreFromAllExternalDependencies

Added in 8.4.0
@Incubating
fun ignoreFromAllExternalDependencies(ignore: Boolean): Unit

Ignore keep rules from all the external dependencies.

Public properties

files

Added in 8.13.0
val filesSetProperty<File>

Keep rules files set

includeDefault

Added in 9.1.0-alpha09
var includeDefaultBoolean

This flag will include default keep rules that enables shrinking, obfuscation, and optimization of bytecode when optimization.enable is on.

Default value is true. When merging the values from build types and product flavors, if any have this as false, it will be false in the eventual variant.

It's the equivalent of using getDefaultProguardFile("proguard-android-optimize.txt")