Convert JavaInfoProvider to *JavaInfo

Convert JavaInfoProvider to return a *JavaInfo instead of a JavaInfo.
This will reduce copying when reading the provider, and also allows
JavaInfo to recursively contain a depset of JavaInfos from
dependencies.

Bug: 308016794
Test: go test ./java/...
Flag: EXEMPT refactor
Change-Id: Ibf6d9b797f760ad1fe815d59839839fdfad91733
This commit is contained in:
Colin Cross
2024-07-18 15:36:32 -07:00
parent d40aac1340
commit 7727c7f096
9 changed files with 54 additions and 44 deletions

View File

@@ -162,8 +162,9 @@ func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleConte
var jars android.Paths
ctx.VisitDirectDepsWithTag(systemModulesLibsTag, func(module android.Module) {
dep, _ := android.OtherModuleProvider(ctx, module, JavaInfoProvider)
jars = append(jars, dep.HeaderJars...)
if dep, ok := android.OtherModuleProvider(ctx, module, JavaInfoProvider); ok {
jars = append(jars, dep.HeaderJars...)
}
})
system.headerJars = jars