gn2bp: properly add proto_deps
Test: //components/cronet/android:cronet
Change-Id: I1583db83d3cd51d734c9d7252f0c5ff6194f9131
diff --git a/tools/gn2bp/Android.bp.swp b/tools/gn2bp/Android.bp.swp
index dae4cc5..60ca2f7 100644
--- a/tools/gn2bp/Android.bp.swp
+++ b/tools/gn2bp/Android.bp.swp
@@ -7136,9 +7136,9 @@
cpp_std: "c++20",
}
-// GN: //third_party/protobuf:protoc(//build/toolchain/linux:clang_x64)
+// GN: //third_party/protobuf:protoc
cc_binary {
- name: "cronet_aml_third_party_protobuf_protoc___build_toolchain_linux_clang_x64_",
+ name: "cronet_aml_third_party_protobuf_protoc",
srcs: [
":cronet_aml_buildtools_third_party_libc___libc__",
":cronet_aml_buildtools_third_party_libc__abi_libc__abi",
diff --git a/tools/gn2bp/gn_utils.py b/tools/gn2bp/gn_utils.py
index 31cc2e1..6f3c787 100644
--- a/tools/gn2bp/gn_utils.py
+++ b/tools/gn2bp/gn_utils.py
@@ -280,7 +280,9 @@
target.proto_paths.update(self.get_proto_paths(proto_desc))
target.proto_exports.update(self.get_proto_exports(proto_desc))
target.proto_in_dir = self.get_proto_in_dir(proto_desc)
- target.deps.update(proto_desc.get('deps', []))
+ for gn_proto_deps_name in proto_desc.get('deps', []):
+ dep = self.parse_gn_desc(gn_desc, gn_proto_deps_name)
+ target.deps.add(dep.name)
target.arch[arch].sources.update(proto_desc.get('sources', []))
assert (all(x.endswith('.proto') for x in target.arch[arch].sources))
elif target.type == 'source_set':