diff options
Diffstat (limited to 'java/base.go')
-rw-r--r-- | java/base.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/java/base.go b/java/base.go index cf3b3d510..53f0f52c2 100644 --- a/java/base.go +++ b/java/base.go @@ -169,6 +169,8 @@ type CommonProperties struct { Output_params []string } + // If true, then jacocoagent is automatically added as a libs dependency so that + // r8 will not strip instrumentation classes out of dexed libraries. Instrument bool `blueprint:"mutated"` // If true, then the module supports statically including the jacocoagent // into the library. @@ -787,6 +789,9 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { } else if j.shouldInstrumentStatic(ctx) { ctx.AddVariationDependencies(nil, staticLibTag, "jacocoagent") } + if j.shouldInstrument(ctx) { + ctx.AddVariationDependencies(nil, libTag, "jacocoagent") + } if j.useCompose() { ctx.AddVariationDependencies(ctx.Config().BuildOSCommonTarget.Variations(), kotlinPluginTag, |