gn2bp: Prevent collection of source files for testing modules
Test: none
Change-Id: I72a2a23021b01bbf7a78fd458405340349503ea5
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index 2c4dfe2..32c9a2b 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -1825,7 +1825,7 @@
with open(desc_file) as f:
desc = json.load(f)
for target in targets:
- gn.parse_gn_desc(desc, target)
+ gn.parse_gn_desc(desc, target, is_test_target=target in DEFAULT_TESTS)
blueprint = create_blueprint_for_targets(gn, targets)
project_root = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
tool_name = os.path.relpath(os.path.abspath(__file__), project_root)