gn2bp: fix proto parsing
GnUtils and gen_android_bp already have support for proto targets.
It looks pretty generic and quite a bit more evolved than what we have
done so far.
Test: //net:net
Change-Id: I1ca0d004650b4dc5e09fae4a0f4159699b4de96b
diff --git a/tools/gn2bp/gn_utils.py b/tools/gn2bp/gn_utils.py
index 1aa352e..589b12a 100644
--- a/tools/gn2bp/gn_utils.py
+++ b/tools/gn2bp/gn_utils.py
@@ -353,10 +353,10 @@
gen_desc = self.gn_desc_.get('%s_gen%s' % (name, toolchain))
if gen_desc is None or gen_desc['type'] != 'action':
return None, None
- args = gen_desc.get('args', [])
- if '/protoc' not in args[0]:
+ if gen_desc['script'] != '//tools/protoc_wrapper/protoc_wrapper.py':
return None, None
plugin = 'proto'
+ args = gen_desc.get('args', [])
for arg in (arg for arg in args if arg.startswith('--plugin=')):
# |arg| at this point looks like:
# --plugin=protoc-gen-plugin=gcc_like_host/protozero_plugin