Propagate intermediateCacheFiles in java modules and filegroup

This change propagates the intermediateCacheFiles generated by the
aconfig_declarations to the static rdeps that are java modules or the
rdeps that are filegroups.

Test: m nothing
Bug: 329284345
Change-Id: I02431336c1aa0378d03248f3bb6edf2f57ec3b7f
This commit is contained in:
Jihoon Kang
2024-03-13 01:21:16 +00:00
parent f11f786571
commit 705e63e362
3 changed files with 53 additions and 24 deletions

View File

@@ -15,6 +15,7 @@
package android
import (
"maps"
"strings"
"github.com/google/blueprint"
@@ -97,6 +98,25 @@ func (fg *fileGroup) GenerateAndroidBuildActions(ctx ModuleContext) {
}
SetProvider(ctx, blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: fg.srcs.Strings()})
CollectDependencyAconfigFiles(ctx, &fg.mergedAconfigFiles)
var aconfigDeclarations []string
var intermediateCacheOutputPaths Paths
var srcjars Paths
modeInfos := make(map[string]ModeInfo)
ctx.VisitDirectDeps(func(module Module) {
if dep, ok := OtherModuleProvider(ctx, module, CodegenInfoProvider); ok {
aconfigDeclarations = append(aconfigDeclarations, dep.AconfigDeclarations...)
intermediateCacheOutputPaths = append(intermediateCacheOutputPaths, dep.IntermediateCacheOutputPaths...)
srcjars = append(srcjars, dep.Srcjars...)
maps.Copy(modeInfos, dep.ModeInfos)
}
})
SetProvider(ctx, CodegenInfoProvider, CodegenInfo{
AconfigDeclarations: aconfigDeclarations,
IntermediateCacheOutputPaths: intermediateCacheOutputPaths,
Srcjars: srcjars,
ModeInfos: modeInfos,
})
}
func (fg *fileGroup) Srcs() Paths {