Package-level declarations

Types

Link copied to clipboard
@CacheableTask
abstract class AndroidTestVariantClasspathJar : KeeperJarTask

A KeeperJarTask task that sources from both the androidTest compiled sources and its distinct dependencies (as compared to the appJarsFile). R8's TraceReferences requires no class overlap between the two jars it's comparing, so at copy-time this will compute the unique androidTest dependencies. We need to have them because there may be APIs that they use that are used in the target app runtime, and we want R8 to account for those usages as well.

Link copied to clipboard
@CacheableTask
abstract class InferAndroidTestKeepRules @Inject constructor(execOps: ExecOperations) : DefaultTask

Generates proguard keep rules from the generated androidTestSourceJar and appTargetJar tasks, where the generates rules are based on what classes from appTargetJar are used by androidTestSourceJar.

Link copied to clipboard
abstract class KeeperExtension @Inject constructor(objects: ObjectFactory)

Configuration for the InferAndroidTestKeepRules.

Link copied to clipboard
abstract class KeeperJarTask : DefaultTask
Link copied to clipboard
class KeeperPlugin : Plugin<Project>

A simple Gradle plugin that hooks into Proguard/R8 to add extra keep rules based on what androidTest classes use from the target app's sources. This is necessary because AGP does not factor in androidTest usages of target app sources when running the minification step, which can result in runtime errors if APIs used by tests are removed.

Link copied to clipboard

Register this with VariantBuilder.registerExtension to opt this variant into Keeper.

Link copied to clipboard
abstract class TraceReferences @Inject constructor(objects: ObjectFactory)
Link copied to clipboard
@CacheableTask
abstract class VariantClasspathJar : KeeperJarTask

A simple cacheable task that creates a jar from given allDirectories and allJars. Normally these aren't intended to be cacheable, but in our case it's fine since the resulting jar is an input of a task and not just a transient operation of another plugin.

Functions

Link copied to clipboard

Shorthand to register Keeper on this variant.