diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-04-26 16:51:01 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-04-26 18:24:36 +0200 |
commit | 8bbb5274b2779aae44a0c4f76da8df08cf63da84 (patch) | |
tree | 5787e11a0e441a23c37976f02b92ab6ff96064bd /CC/EXPRESSIONS | |
parent | 6fa381769ea5ac3505cc202ae442eb7fee35f4ce (diff) | |
download | rules-cc-8bbb5274b2779aae44a0c4f76da8df08cf63da84.tar.gz |
rules: Add field_artifacts_list and field_runfiles_list
... which are more efficient if the caller wants to perform
the union manually (because disjointness should be enforced
or additional maps should be added to the union, etc.). As a
positive side effect, code reuse is slightly increased by
consistently calling these newly introduced expressions for
obtaining the artifacts/runfiles from all targets of a
target field.
Diffstat (limited to 'CC/EXPRESSIONS')
-rw-r--r-- | CC/EXPRESSIONS | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/CC/EXPRESSIONS b/CC/EXPRESSIONS index efaf577..b7b755d 100644 --- a/CC/EXPRESSIONS +++ b/CC/EXPRESSIONS @@ -134,6 +134,7 @@ { "deps-fieldnames": ["List of target_field names to collect dependencies from."] } + , "imports": {"runfiles_list": ["./", "..", "field_runfiles_list"]} , "expression": { "type": "disjoint_map_union" , "$1": @@ -156,15 +157,7 @@ , "default": {"type": "empty_map"} } } - , { "type": "foreach" - , "var": "target" - , "range": - {"type": "FIELD", "name": {"type": "var", "name": "fieldname"}} - , "body": - { "type": "DEP_RUNFILES" - , "dep": {"type": "var", "name": "target"} - } - } + , {"type": "CALL_EXPRESSION", "name": "runfiles_list"} ] } } @@ -178,6 +171,7 @@ { "deps-fieldnames": ["List of target_field names to collect dependencies from."] } + , "imports": {"artifacts_list": ["./", "..", "field_artifacts_list"]} , "expression": { "type": "disjoint_map_union" , "$1": @@ -200,15 +194,7 @@ , "default": {"type": "empty_map"} } } - , { "type": "foreach" - , "var": "target" - , "range": - {"type": "FIELD", "name": {"type": "var", "name": "fieldname"}} - , "body": - { "type": "DEP_ARTIFACTS" - , "dep": {"type": "var", "name": "target"} - } - } + , {"type": "CALL_EXPRESSION", "name": "artifacts_list"} ] } } |