Better Soong namespace support in the RBC runtime.
Includes: * Defining namespace again should have no effect * Allow appending to a variable defined in a namespace * Consistent naming * Print namespace variable assignments even if they are empty Bug: 200297238 Test: rbcrun make/build/tests/run.rbc Change-Id: I64aa22c4498ae89e4bc3a077d6206ad37d5c7c38
This commit is contained in:
@@ -23,12 +23,11 @@
|
||||
### PRODUCT_PACKAGES += dev_after
|
||||
### PRODUCT_COPY_FILES += $(call find-copy-subdir-files,audio_platform_info*.xml,device/google/redfin/audio,$(TARGET_COPY_OUT_VENDOR)/etc) xyz:/etc/xyz
|
||||
### PRODUCT_COPY_FILES += $(call copy-files,x.xml y.xml,/etc)
|
||||
### $(call add_soong_namespace,NS1)
|
||||
### $(call add_soong_config_var_value,NS1,v1,abc)
|
||||
### $(call add_soong_config_var_value,NS1,v2,def)
|
||||
### $(call add_soong_namespace,NS2)
|
||||
### $(call add_soong_config_namespace,NS1)
|
||||
### $(call soong_config_append,NS1,v1,abc)
|
||||
### $(call soong_config_append,NS1,v2,def)
|
||||
### $(call add_soong_config_var_value,NS2,v3,abc)
|
||||
### $(call add_soong_config_var_value,NS2,v3,xyz)
|
||||
### $(call soong_config_set,NS2,v3,xyz)
|
||||
|
||||
load("//build/make/core:product_config.rbc", "rblf")
|
||||
load(":part1.rbc", _part1_init = "init")
|
||||
@@ -50,10 +49,9 @@ def init(g, handle):
|
||||
cfg["PRODUCT_COPY_FILES"] += rblf.copy_files("x.xml y.xml", "/etc")
|
||||
cfg["PRODUCT_COPY_FILES"] += rblf.copy_files(["from/sub/x", "from/sub/y"], "to")
|
||||
|
||||
rblf.add_soong_config_namespace(g, "NS1")
|
||||
rblf.add_soong_config_var_value(g, "NS1", "v1", "abc")
|
||||
rblf.add_soong_config_var_value(g, "NS1", "v2", "def")
|
||||
rblf.add_soong_config_namespace(g, "NS2")
|
||||
rblf.add_soong_config_var_value(g, "NS2", "v3", "abc")
|
||||
rblf.add_soong_config_var_value(g, "NS2", "v3", "xyz")
|
||||
rblf.soong_config_namespace(g, "NS1")
|
||||
rblf.soong_config_append(g, "NS1", "v1", "abc")
|
||||
rblf.soong_config_append(g, "NS1", "v2", "def")
|
||||
rblf.soong_config_set(g, "NS2", "v3", "abc")
|
||||
rblf.soong_config_set(g, "NS2", "v3", "xyz")
|
||||
|
||||
|
@@ -26,3 +26,5 @@ def init(g, handle):
|
||||
cfg["PRODUCT_COPY_FILES"] += ["part_from:part_to"]
|
||||
rblf.setdefault(handle, "PRODUCT_PRODUCT_PROPERTIES")
|
||||
cfg["PRODUCT_PRODUCT_PROPERTIES"] += ["part_properties"]
|
||||
rblf.soong_config_namespace(g, "NS1")
|
||||
rblf.soong_config_append(g, "NS1", "v1", "abc_part1")
|
||||
|
@@ -80,7 +80,7 @@ ns = globals["$SOONG_CONFIG_NAMESPACES"]
|
||||
assert_eq(
|
||||
{
|
||||
"NS1": {
|
||||
"v1": "abc",
|
||||
"v1": "abc abc_part1",
|
||||
"v2": "def"
|
||||
},
|
||||
"NS2": {
|
||||
|
Reference in New Issue
Block a user