gn2bp: properly forward genrule dependency
I checked, for //base:base, all outputs have the same extension (it
would be terrible it this were not the case). Also, //base:base seems
to only generated .h files right now.
Test: //base:base
Change-Id: I2e5e7b51408a072c28fabaf51213c4f0c7b4f7e7
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index 75266ab..1422b69 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -677,8 +677,8 @@
arg_string = ' '.join(target.args)
module.cmd = '$(location %s) %s' % (script, arg_string)
- # TODO: is this correct?
- module.tool_files.extend(':' + label_to_module_name(it) for it in target.deps)
+ if all(os.path.splitext(it)[1] == '.h' for it in target.outputs):
+ module.genrule_headers.add(bp_module_name)
# For gn actions, sources and inputs are treated equally.
# TODO: there should be a label_to_path function that takes a set / list.