Support proto modules with external references.

Bug: 236055697
Test: Manual testing and adding new unit tests.
Change-Id: I984c0ecb93f0023727a39a3af3921820337bf8c7
This commit is contained in:
Yu Liu
2022-09-01 11:54:47 -07:00
parent 8c6f4576ef
commit 2aa806b52d
7 changed files with 291 additions and 73 deletions

View File

@@ -178,7 +178,7 @@ func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs baze
var ret bp2buildProtoDeps
protoInfo, ok := android.Bp2buildProtoProperties(ctx, &m.ModuleBase, protoSrcs)
if !ok {
if !ok || protoInfo.Proto_libs.IsEmpty() {
return ret
}
@@ -201,9 +201,8 @@ func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs baze
dep := android.BazelLabelForModuleDepSingle(ctx, depName)
ret.protoDep = &bazel.LabelAttribute{Value: &dep}
protoLabel := bazel.Label{Label: ":" + protoInfo.Name}
var protoAttrs protoAttributes
protoAttrs.Deps.SetValue(bazel.LabelList{Includes: []bazel.Label{protoLabel}})
protoAttrs.Deps.SetValue(protoInfo.Proto_libs)
name := m.Name() + suffix