Introduce product variables to select Java code coverage paths in Soong.

Introduce product variables `JavaCoveragePaths` and
`JavaCoverageExcludePaths` (resp. populated from environment variables
`JAVA_COVERAGE_PATHS` and `JAVA_COVERAGE_EXCLUDE_PATHS`). Use them to
control which Java modules are candidate for instrumentation based on
their source path. By default (when `JavaCoveragePaths` is empty),
have all Java module be candidate for instrumentation, to preserve the
existing behavior.

Test: export EMMA_INSTRUMENT=true \
        && export EMMA_INSTRUMENT_FRAMEWORK=true \
        && export JAVA_COVERAGE_PATHS=art \
        && m
Bug: 158212027
Bug: 156284897
Merged-In: Ibe9c1f41ed6110867411952689c5a7ad6536f277
Change-Id: Ibe9c1f41ed6110867411952689c5a7ad6536f277
This commit is contained in:
Roland Levillain
2020-06-09 13:07:36 +01:00
committed by Oliver Nguyen
parent 0c9a2d0768
commit 583691a060
3 changed files with 27 additions and 1 deletions

View File

@@ -253,6 +253,9 @@ type productVariables struct {
SamplingPGO *bool `json:",omitempty"`
JavaCoveragePaths []string `json:",omitempty"`
JavaCoverageExcludePaths []string `json:",omitempty"`
NativeLineCoverage *bool `json:",omitempty"`
Native_coverage *bool `json:",omitempty"`
ClangCoverage *bool `json:",omitempty"`