summaryrefslogtreecommitdiff
path: root/bp2build/bzl_conversion_test.go
diff options
context:
space:
mode:
author Liz Kammer <eakammer@google.com> 2021-09-14 11:17:21 -0400
committer Liz Kammer <eakammer@google.com> 2021-09-14 14:41:36 -0400
commit32a0339340092a223efa2abfbe972047864490c6 (patch)
tree2303fad4af6c9afeb383e8df9482e6adee164576 /bp2build/bzl_conversion_test.go
parent4011ebb12d1e474ef6aa2c1895ea32f72b03200f (diff)
Bp2build: handle embedded structs as blueprint
For structs that are embedded, Blueprint does not nest under the embedded name, flattening them into the original struct for blueprint files (e.g. https://cs.android.com/android/_/android/platform/build/blueprint/+/9fd2ed93dfb82baf7688c1b2b29aa4b2cc125721:proptools/unpack_test.go;l=402-431;drc=3adb2409648d6f8b25354ac47f083dae87731f10). We should do the same for bp2build. This will also allow us to embed structs for bp2build conversion allowing more reuse. Test: go test bp2build tests Change-Id: I9ce088462adaf59bffa80bea76cd488e31f98e9d
Diffstat (limited to 'bp2build/bzl_conversion_test.go')
-rw-r--r--bp2build/bzl_conversion_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bp2build/bzl_conversion_test.go b/bp2build/bzl_conversion_test.go
index 9e0c0a1e9..1e78c0ecd 100644
--- a/bp2build/bzl_conversion_test.go
+++ b/bp2build/bzl_conversion_test.go
@@ -92,6 +92,7 @@ custom = rule(
# bazel_module end
"bool_prop": attr.bool(),
"bool_ptr_prop": attr.bool(),
+ "embedded_prop": attr.string(),
"int64_ptr_prop": attr.int(),
# nested_props start
# "nested_prop": attr.string(),
@@ -99,6 +100,7 @@ custom = rule(
# nested_props_ptr start
# "nested_prop": attr.string(),
# nested_props_ptr end
+ "other_embedded_prop": attr.string(),
"string_list_prop": attr.string_list(),
"string_prop": attr.string(),
"string_ptr_prop": attr.string(),
@@ -118,6 +120,7 @@ custom_defaults = rule(
"arch_paths_exclude": attr.string_list(),
"bool_prop": attr.bool(),
"bool_ptr_prop": attr.bool(),
+ "embedded_prop": attr.string(),
"int64_ptr_prop": attr.int(),
# nested_props start
# "nested_prop": attr.string(),
@@ -125,6 +128,7 @@ custom_defaults = rule(
# nested_props_ptr start
# "nested_prop": attr.string(),
# nested_props_ptr end
+ "other_embedded_prop": attr.string(),
"string_list_prop": attr.string_list(),
"string_prop": attr.string(),
"string_ptr_prop": attr.string(),
@@ -144,6 +148,7 @@ custom_test_ = rule(
"arch_paths_exclude": attr.string_list(),
"bool_prop": attr.bool(),
"bool_ptr_prop": attr.bool(),
+ "embedded_prop": attr.string(),
"int64_ptr_prop": attr.int(),
# nested_props start
# "nested_prop": attr.string(),
@@ -151,6 +156,7 @@ custom_test_ = rule(
# nested_props_ptr start
# "nested_prop": attr.string(),
# nested_props_ptr end
+ "other_embedded_prop": attr.string(),
"string_list_prop": attr.string_list(),
"string_prop": attr.string(),
"string_ptr_prop": attr.string(),