bp2build: Add support for export_.*headers props
Soong supports export_.*_headers properties, the libraries contained in
this list must also be within a shared/static/whole_static/header libs
property. For bp2build, we eliminate this duplication. The libraries
not listed in an export_.*_headers property will migrate to an attribute
prepended with implementation_, those in export_.*_headers will not have
a prefix.
Test: build/bazel/ci/bp2build.sh
Test: build/bazel/ci/mixed_libc.sh
Bug: 198241472
Change-Id: I3eb84c983ec5d241c8a568e411dfd5619d3184a7
diff --git a/bp2build/cc_library_shared_conversion_test.go b/bp2build/cc_library_shared_conversion_test.go
index 52a07cc..3dcfbd7 100644
--- a/bp2build/cc_library_shared_conversion_test.go
+++ b/bp2build/cc_library_shared_conversion_test.go
@@ -149,10 +149,6 @@
"-Dflag1",
"-Dflag2",
],
- dynamic_deps = [
- ":shared_lib_1",
- ":shared_lib_2",
- ],
export_includes = [
"export_include_dir_1",
"export_include_dir_2",
@@ -161,6 +157,10 @@
":header_lib_1",
":header_lib_2",
],
+ implementation_dynamic_deps = [
+ ":shared_lib_1",
+ ":shared_lib_2",
+ ],
local_includes = [
"local_include_dir_1",
"local_include_dir_2",
@@ -201,7 +201,7 @@
}`,
expectedBazelTargets: []string{`cc_library_shared(
name = "foo_shared",
- dynamic_deps = select({
+ implementation_dynamic_deps = select({
"//build/bazel/platforms/arch:arm64": [":shared_dep"],
"//conditions:default": [],
}),
@@ -232,7 +232,7 @@
}`,
expectedBazelTargets: []string{`cc_library_shared(
name = "foo_shared",
- dynamic_deps = select({
+ implementation_dynamic_deps = select({
"//build/bazel/platforms/os:android": [":shared_dep"],
"//conditions:default": [],
}),
@@ -269,7 +269,7 @@
}`,
expectedBazelTargets: []string{`cc_library_shared(
name = "foo_shared",
- dynamic_deps = [":shared_dep"] + select({
+ implementation_dynamic_deps = [":shared_dep"] + select({
"//build/bazel/platforms/arch:arm64": [":shared_dep3"],
"//conditions:default": [],
}) + select({