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

Commit 0b264fe1 authored by Jaewoong Jung's avatar Jaewoong Jung Committed by Automerger Merge Worker
Browse files

Merge "Collect JNI coverage data only for first target." into rvc-dev am:...

Merge "Collect JNI coverage data only for first target." into rvc-dev am: aeb9e6ff am: dc05e132 am: 769feee3

Change-Id: Idca653d1382bca74ebe13fbef07f16683594f4d9
parents b921a53b 769feee3
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -385,9 +385,20 @@ func (a *AndroidApp) jniBuildActions(jniLibs []jniLib, ctx android.ModuleContext
			TransformJniLibsToJar(ctx, jniJarFile, jniLibs, a.useEmbeddedNativeLibs(ctx))
			for _, jni := range jniLibs {
				if jni.coverageFile.Valid() {
					// Only collect coverage for the first target arch if this is a multilib target.
					// TODO(jungjw): Ideally, we want to collect both reports, but that would cause coverage
					// data file path collisions since the current coverage file path format doesn't contain
					// arch-related strings. This is fine for now though; the code coverage team doesn't use
					// multi-arch targets such as test_suite_* for coverage collections yet.
					//
					// Work with the team to come up with a new format that handles multilib modules properly
					// and change this.
					if len(ctx.Config().Targets[android.Android]) == 1 ||
						ctx.Config().Targets[android.Android][0].Arch.ArchType == jni.target.Arch.ArchType {
						a.jniCoverageOutputs = append(a.jniCoverageOutputs, jni.coverageFile.Path())
					}
				}
			}
		} else {
			a.installJniLibs = jniLibs
		}