diff options
| author | 2020-02-25 07:02:33 +0000 | |
|---|---|---|
| committer | 2020-02-25 07:02:33 +0000 | |
| commit | 139fa4320ff5d43591bee411d6ea3f5f10bdea63 (patch) | |
| tree | 03a860a3b7ee495ff5dc041a273725ed793dc1a8 /java/java.go | |
| parent | 4483601b58de2d4d272106002b8e24b9506166d2 (diff) | |
| parent | 93e57a0b862beabdd11b8dac342167ea7f7c7b76 (diff) | |
Merge changes Ibaf383c4,I2b1c0736
* changes:
Expect added members for instrumented modules
Reland "Turn on the instrumentation by default for the java code in APEXes"
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go index 462dba809..b3aca4989 100644 --- a/java/java.go +++ b/java/java.go @@ -1519,6 +1519,14 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) { j.headerJarFile = j.implementationJarFile } + // Force enable the instrumentation for java code that is built for APEXes ... + // except for the jacocoagent itself (because instrumenting jacocoagent using jacocoagent + // doesn't make sense) + isJacocoAgent := ctx.ModuleName() == "jacocoagent" + if android.DirectlyInAnyApex(ctx, ctx.ModuleName()) && !isJacocoAgent && !j.IsForPlatform() { + j.properties.Instrument = true + } + if j.shouldInstrument(ctx) { outputFile = j.instrument(ctx, flags, outputFile, jarName) } |