Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f3386e4 authored by Chris Gross's avatar Chris Gross Committed by Gerrit Code Review
Browse files

Merge "Use a default exclude filter for JaCoCo in Soong."

parents 3d88ad68 2f748692
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1052,7 +1052,7 @@ func (c *deviceConfig) SamplingPGO() bool {
// represents any path.
func (c *deviceConfig) JavaCoverageEnabledForPath(path string) bool {
	coverage := false
	if c.config.productVariables.JavaCoveragePaths == nil ||
	if len(c.config.productVariables.JavaCoveragePaths) == 0 ||
		InList("*", c.config.productVariables.JavaCoveragePaths) ||
		HasAnyPrefix(path, c.config.productVariables.JavaCoveragePaths) {
		coverage = true
+2 −1
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@ var (
	DefaultLambdaStubsLibrary     = "core-lambda-stubs"
	SdkLambdaStubsPath            = "prebuilts/sdk/tools/core-lambda-stubs.jar"

	DefaultJacocoExcludeFilter = []string{"org.junit.*", "org.jacoco.*", "org.mockito.*"}
	DefaultMakeJacocoExcludeFilter = []string{"org.junit.*", "org.jacoco.*", "org.mockito.*"}
	DefaultJacocoExcludeFilter     = []string{"org.junit.**", "org.jacoco.**", "org.mockito.**"}

	InstrumentFrameworkModules = []string{
		"framework",
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
	ctx.Strict("ZIPSYNC", "${ZipSyncCmd}")

	ctx.Strict("JACOCO_CLI_JAR", "${JacocoCLIJar}")
	ctx.Strict("DEFAULT_JACOCO_EXCLUDE_FILTER", strings.Join(DefaultJacocoExcludeFilter, ","))
	ctx.Strict("DEFAULT_JACOCO_EXCLUDE_FILTER", strings.Join(DefaultMakeJacocoExcludeFilter, ","))

	ctx.Strict("EXTRACT_JAR_PACKAGES", "${ExtractJarPackagesCmd}")

+3 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import (
	"github.com/google/blueprint/proptools"

	"android/soong/android"
	"android/soong/java/config"
)

var (
@@ -76,7 +77,8 @@ func (j *Module) jacocoModuleToZipCommand(ctx android.ModuleContext) string {
	if err != nil {
		ctx.PropertyErrorf("jacoco.include_filter", "%s", err.Error())
	}
	excludes, err := jacocoFiltersToSpecs(j.properties.Jacoco.Exclude_filter)
	// Also include the default list of classes to exclude from instrumentation.
	excludes, err := jacocoFiltersToSpecs(append(j.properties.Jacoco.Exclude_filter, config.DefaultJacocoExcludeFilter...))
	if err != nil {
		ctx.PropertyErrorf("jacoco.exclude_filter", "%s", err.Error())
	}