gn2bp: override deps before soong target is created
This may not be correct when filegroups are involved? I am not sure, but
for now let's just not generate the soong target that's being replaced
by a target in builtin_deps.
Test: run script
Change-Id: I0a02eb43152411b85ea5eabed24f3102ba35d7c9
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index 9980983..8983f9e 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -815,6 +815,12 @@
if dep_name.startswith('//buildtools'):
continue
+ # |builtin_deps| override GN deps with Android-specific ones. See the
+ # config in the top of this file.
+ if gn_utils.label_without_toolchain(dep_name) in builtin_deps:
+ builtin_deps[gn_utils.label_without_toolchain(dep_name)](module)
+ continue
+
# Ignore the dependency on the gen_buildflags genrule. That is run
# separately in this generator and the generated file is copied over
# into the repo (see usage of |buildflags_dir| in this script).
@@ -827,11 +833,6 @@
if not module_is_compiled:
continue
- # |builtin_deps| override GN deps with Android-specific ones. See the
- # config in the top of this file.
- if gn_utils.label_without_toolchain(dep_name) in builtin_deps:
- builtin_deps[gn_utils.label_without_toolchain(dep_name)](module)
- continue
# Don't recurse in any other //gn dep if not handled by builtin_deps.
if dep_name.startswith('//gn:'):