From 8bbb5274b2779aae44a0c4f76da8df08cf63da84 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Tue, 26 Apr 2022 16:51:01 +0200 Subject: 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. --- proto/RULES | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'proto') diff --git a/proto/RULES b/proto/RULES index 74182a9..5d1b853 100644 --- a/proto/RULES +++ b/proto/RULES @@ -29,6 +29,7 @@ , "\"service library\"." ] } + , "imports": {"artifacts_list": ["./", "..", "field_artifacts_list"]} , "expression": { "type": "let*" , "bindings": @@ -55,13 +56,10 @@ { "type": "disjoint_map_union" , "msg": "Sources have to be conflict free" , "$1": - { "type": "foreach" - , "var": "x" - , "range": {"type": "FIELD", "name": "srcs"} + { "type": "let*" + , "bindings": [["fieldname", "srcs"]] , "body": - { "type": "DEP_ARTIFACTS" - , "dep": {"type": "var", "name": "x"} - } + {"type": "CALL_EXPRESSION", "name": "artifacts_list"} } } } -- cgit v1.2.3