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
This commit is contained in:
Colin Cross
2017-11-22 13:49:43 -08:00
parent e909e1e079
commit cb9335932f
7 changed files with 221 additions and 34 deletions

View File

@@ -54,6 +54,8 @@ type androidAppProperties struct {
// list of directories relative to the Blueprints file containing
// Android resources
Resource_dirs []string
Instrumentation_for *string
}
type AndroidApp struct {
@@ -119,6 +121,10 @@ func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) {
// a.properties.Proguard.Enabled = true
//}
if String(a.appProperties.Instrumentation_for) == "" {
a.properties.Instrument = true
}
a.Module.compile(ctx)
aaptPackageFlags := append([]string(nil), aaptFlags...)