Add variant_prepend support for all the properties in bp2build

This is a follow up of aosp/2336916. All the properties that have
variant_prepend tag are supported in bp2build.

Bug: 261644490
Test: TH and modified tests with updated expected behaviors
Change-Id: I13bb5d4d8fcd38bf153fa9083c9c945aec2dfa19
This commit is contained in:
Zi Wang
2023-01-04 11:06:54 -08:00
parent 94682b23c4
commit 9f609db46a
6 changed files with 29 additions and 11 deletions

View File

@@ -1003,6 +1003,8 @@ cc_library_static {
})
}
// generated_headers has "variant_prepend" tag. In bp2build output,
// variant info(select) should go before general info.
func TestCcLibraryStaticArchSrcsExcludeSrcsGeneratedFiles(t *testing.T) {
runCcLibraryStaticTestCase(t, Bp2buildTestCase{
Description: "cc_library_static arch srcs/exclude_srcs with generated files",
@@ -1066,13 +1068,13 @@ cc_library_static {
"//build/bazel/platforms/os:android": [":generated_src_android"],
"//conditions:default": [],
})`,
"hdrs": `["//dep:generated_hdr_other_pkg"] + select({
"//build/bazel/platforms/arch:x86": ["//dep:generated_hdr_other_pkg_x86"],
"//conditions:default": [],
}) + select({
"hdrs": `select({
"//build/bazel/platforms/os:android": ["//dep:generated_hdr_other_pkg_android"],
"//conditions:default": [],
})`,
}) + select({
"//build/bazel/platforms/arch:x86": ["//dep:generated_hdr_other_pkg_x86"],
"//conditions:default": [],
}) + ["//dep:generated_hdr_other_pkg"]`,
"local_includes": `["."]`,
"export_absolute_includes": `["dep"]`,
}),