Merge changes from topic "proto-include-dir-py" into main

* changes:
  Handle proto.include_dirs in bp2build for py
  Add proto.local_include_dirs support in bp2build
  Add manual tag to proto_library at the root package
This commit is contained in:
Spandan Das
2023-08-24 20:57:47 +00:00
committed by Gerrit Code Review
3 changed files with 79 additions and 2 deletions

View File

@@ -33,6 +33,12 @@ type bazelPythonLibraryAttributes struct {
type bazelPythonProtoLibraryAttributes struct {
Deps bazel.LabelListAttribute
// A list of proto_library targets that the proto_library in `deps` depends on
// This list is overestimation.
// Overestimation is necessary since Soong includes other protos via proto.include_dirs and not
// a specific .proto file module explicitly.
Transitive_deps bazel.LabelListAttribute
}
type baseAttributes struct {
@@ -81,7 +87,8 @@ func (m *PythonLibraryModule) makeArchVariantBaseAttributes(ctx android.TopDownM
}, android.CommonAttributes{
Name: pyProtoLibraryName,
}, &bazelPythonProtoLibraryAttributes{
Deps: bazel.MakeLabelListAttribute(protoInfo.Proto_libs),
Deps: bazel.MakeLabelListAttribute(protoInfo.Proto_libs),
Transitive_deps: bazel.MakeLabelListAttribute(protoInfo.Transitive_proto_libs),
})
attrs.Deps.Add(bazel.MakeLabelAttribute(":" + pyProtoLibraryName))