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. --- shell/test/EXPRESSIONS | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'shell/test') diff --git a/shell/test/EXPRESSIONS b/shell/test/EXPRESSIONS index 2b9a62e..2a99876 100644 --- a/shell/test/EXPRESSIONS +++ b/shell/test/EXPRESSIONS @@ -1,5 +1,9 @@ { "test-action": { "vars": ["name", "test.sh", "ATTEMPT"] + , "imports": + { "artifacts_list": ["./", "../..", "field_artifacts_list"] + , "runfiles_list": ["./", "../..", "field_runfiles_list"] + } , "expression": { "type": "let*" , "bindings": @@ -39,23 +43,13 @@ , "$1": { "type": "++" , "$1": - [ { "type": "foreach" - , "var": "dep" - , "range": {"type": "FIELD", "name": "deps"} - , "body": - { "type": "DEP_RUNFILES" - , "dep": {"type": "var", "name": "dep"} - } - } - , { "type": "foreach" - , "var": "dep" - , "range": {"type": "FIELD", "name": "deps"} - , "body": - { "type": "DEP_ARTIFACTS" - , "dep": {"type": "var", "name": "dep"} - } - } - ] + { "type": "let*" + , "bindings": [["fieldname", "deps"]] + , "body": + [ {"type": "CALL_EXPRESSION", "name": "runfiles_list"} + , {"type": "CALL_EXPRESSION", "name": "artifacts_list"} + ] + } } } } -- cgit v1.2.3