gn2bp: fix include dir denylist
This makes it work for both common and arch-dependent include dirs.
Test: none
Change-Id: I96e4c083b7b72b947886f6d3e1c95973003d756c
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index 4103270..07b4e11 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -1086,6 +1086,10 @@
module.local_include_dirs.update([gn_utils.label_to_path(d)
for d in include_dirs
if not re.match('^//out/.*', d)])
+ # Remove prohibited include directories
+ module.local_include_dirs = [d for d in module.local_include_dirs
+ if d not in local_include_dirs_denylist]
+
def create_modules_from_target(blueprint, gn, gn_target_name):
"""Generate module(s) for a given GN target.
@@ -1192,10 +1196,6 @@
if lib in static_library_allowlist:
module.add_android_static_lib(android_lib)
- # Remove prohibited include directories
- module.local_include_dirs = [d for d in module.local_include_dirs
- if d not in local_include_dirs_denylist]
-
# If the module is a static library, export all the generated headers.
if module.type == 'cc_library_static':
module.export_generated_headers = module.generated_headers