Add Jacoco support
Add support for instrumenting jars with jacoco. Unlike in Make,
Jacoco in Soong is done entirely using jars.
Instrumentation is enabled by EMMA_INSTRUMENT=true, and affects
all apps. If EMMA_INSTRUMENT_FRAMEWORK=true then it also affects
any java libraries listed in InstrumentFrameworkModules.
Bug: 69629238
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false
Change-Id: If699715b277529cd7322ffca67c23b0746e1cccd
diff --git a/java/app.go b/java/app.go
index 05cc975..68e4d5c 100644
--- a/java/app.go
+++ b/java/app.go
@@ -54,6 +54,8 @@
// list of directories relative to the Blueprints file containing
// Android resources
Resource_dirs []string
+
+ Instrumentation_for *string
}
type AndroidApp struct {
@@ -119,6 +121,10 @@
// a.properties.Proguard.Enabled = true
//}
+ if String(a.appProperties.Instrumentation_for) == "" {
+ a.properties.Instrument = true
+ }
+
a.Module.compile(ctx)
aaptPackageFlags := append([]string(nil), aaptFlags...)