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

Commit 33b6654e authored by Jiyong Park's avatar Jiyong Park
Browse files

Turn on the instrumentation by default for the java code in APEXes

Bug: 149353192
Test:  DIST_DIR=dist_dir TARGET_BUILD_VARIANT=userdebug
EMMA_INSTRUMENT=true NATIVE_COVERAGE=true
TARGET_BUILD_APPS="com.android.media"
vendor/google/build/build_unbundled_coverage_mainline_module.sh and
check that jacoco-report-classes.jar is created.
Change-Id: I28e3dc82b7913f60b2278126fca255306e48a424
parent 2d743b54
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1459,6 +1459,11 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
		j.headerJarFile = j.implementationJarFile
	}

	// Force enable the instrumentation for java code that is built for APEXes
	if android.DirectlyInAnyApex(ctx, ctx.ModuleName()) && !j.IsForPlatform() {
		j.properties.Instrument = true
	}

	if j.shouldInstrument(ctx) {
		outputFile = j.instrument(ctx, flags, outputFile, jarName)
	}