gn2bp: Use aprotoc in protoc_wrapper.py
Test: ./update_result.sh
Change-Id: I050ca54ca3f98a0fc6ced1f603b1db502c0a189c
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index 3811c3a..33d1b71 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -856,6 +856,12 @@
# Specifying file under $(genDir) so that parent directory exists.
# If this file is used by other module, we may need to add this file to the outputs.
target.args[2] = '$(genDir)/' + target.args[2].split('/')[-1]
+ elif target.script == "//tools/protoc_wrapper/protoc_wrapper.py":
+ # Use protoc in the android
+ module.tools.add("aprotoc")
+ for i, val in enumerate(target.args):
+ if val == '--protoc':
+ target.args[i + 1] = '$(location aprotoc)'
script = gn_utils.label_to_path(target.script)
module.tool_files.add(script)