Merge "Only generate kythe xrefs on the primary module" into main am: 6ace4cf906

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3126514

Change-Id: Id836a095e7f3c3f22fca1ed470b832da6677fb59
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Sam Saccone 2024-06-11 23:17:50 +00:00 committed by Automerger Merge Worker
commit 695908cf6d
2 changed files with 3 additions and 3 deletions

View file

@ -485,7 +485,7 @@ func transformSourceToObj(ctx ModuleContext, subdir string, srcFiles, noTidySrcs
coverageFiles = make(android.Paths, 0, len(srcFiles))
}
var kytheFiles android.Paths
if flags.emitXrefs {
if flags.emitXrefs && ctx.Module() == ctx.PrimaryModule() {
kytheFiles = make(android.Paths, 0, len(srcFiles))
}
@ -664,7 +664,7 @@ func transformSourceToObj(ctx ModuleContext, subdir string, srcFiles, noTidySrcs
})
// Register post-process build statements (such as for tidy or kythe).
if emitXref {
if emitXref && ctx.Module() == ctx.PrimaryModule() {
kytheFile := android.ObjPathWithExt(ctx, subdir, srcFile, "kzip")
ctx.Build(pctx, android.BuildParams{
Rule: kytheExtract,

View file

@ -1857,7 +1857,7 @@ func (j *Module) compileJavaClasses(ctx android.ModuleContext, jarName string, i
classes := android.PathForModuleOut(ctx, "javac", jarName).OutputPath
TransformJavaToClasses(ctx, classes, idx, srcFiles, srcJars, annoSrcJar, flags, extraJarDeps)
if ctx.Config().EmitXrefRules() {
if ctx.Config().EmitXrefRules() && ctx.Module() == ctx.PrimaryModule() {
extractionFile := android.PathForModuleOut(ctx, kzipName)
emitXrefRule(ctx, extractionFile, idx, srcFiles, srcJars, flags, extraJarDeps)
j.kytheFiles = append(j.kytheFiles, extractionFile)