Runtime support for dist-for-goals.

Convert dist-for-goals.

Bug: 198496782
Test: rbcrun build/make/tests/run.rbc
Change-Id: I46ef9e897143aecf8bd28ad8569d48e74530b0e5
This commit is contained in:
Sasha Smundak
2021-11-18 11:20:34 -08:00
parent 351cd2e489
commit 91fc734100
3 changed files with 40 additions and 0 deletions

View File

@@ -55,6 +55,9 @@ def init(g, handle):
rblf.soong_config_set(g, "NS2", "v3", "abc")
rblf.soong_config_set(g, "NS2", "v3", "xyz")
rblf.mkdist_for_goals(g, "goal", "dir1/file1:out1 dir1/file2:out2")
rblf.mkdist_for_goals(g, "goal", "dir2/file2:")
if rblf.board_platform_in(g, "board1 board2"):
cfg["PRODUCT_PACKAGES"] += ["bad_package"]
g["TARGET_BOARD_PLATFORM"] = "board1"

View File

@@ -102,3 +102,11 @@ assert_eq(30, globals["PLATFORM_SDK_VERSION"])
assert_eq("xyz", rblf.soong_config_get(globals, "NS2", "v3"))
assert_eq(None, rblf.soong_config_get(globals, "NS2", "nonexistant_var"))
goals = globals["$dist_for_goals"]
assert_eq(
{
"goal": [("dir1/file1", "out1"), ("dir1/file2", "out2"), ("dir2/file2", "file2")]
},
{ k:v for k,v in sorted(goals.items()) }
)