diff options
author | Colin Cross <ccross@android.com> | 2017-11-22 13:49:43 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-11-22 16:08:53 -0800 |
commit | cb9335932f5bca5082c1cbcd86736c5091694a49 (patch) | |
tree | 0615515d996881d17cf4e302381b145c7f9dc3ad /java/config/config.go | |
parent | e909e1e0796ab87e4ad32ac12d848263186ef77b (diff) | |
download | build_soong-cb9335932f5bca5082c1cbcd86736c5091694a49.tar.gz build_soong-cb9335932f5bca5082c1cbcd86736c5091694a49.tar.bz2 build_soong-cb9335932f5bca5082c1cbcd86736c5091694a49.zip |
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
Diffstat (limited to 'java/config/config.go')
-rw-r--r-- | java/config/config.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/java/config/config.go b/java/config/config.go index 3cd28415..49481be3 100644 --- a/java/config/config.go +++ b/java/config/config.go @@ -28,6 +28,16 @@ var ( DefaultBootclasspathLibraries = []string{"core-oj", "core-libart"} DefaultSystemModules = "core-system-modules" DefaultLibraries = []string{"ext", "framework", "okhttp"} + + DefaultJacocoExcludeFilter = []string{"org.junit.*", "org.jacoco.*", "org.mockito.*"} + + InstrumentFrameworkModules = []string{ + "framework", + "telephony-common", + "services", + "android.car", + "android.car7", + } ) func init() { @@ -74,6 +84,7 @@ func init() { pctx.SourcePathVariable("JarArgsCmd", "build/soong/scripts/jar-args.sh") pctx.HostBinToolVariable("SoongZipCmd", "soong_zip") pctx.HostBinToolVariable("MergeZipsCmd", "merge_zips") + pctx.HostBinToolVariable("Zip2ZipCmd", "zip2zip") pctx.VariableFunc("DxCmd", func(config interface{}) (string, error) { if config.(android.Config).IsEnvFalse("USE_D8") { if config.(android.Config).UnbundledBuild() || config.(android.Config).IsPdkBuild() { @@ -117,4 +128,6 @@ func init() { } return "", nil }) + + pctx.HostJavaToolVariable("JacocoCLIJar", "jacoco-cli.jar") } |