From 3f4d142cd2224db15ff2b6599edbf8287b8455c9 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. --- rules/shell/test/EXPRESSIONS | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'rules/shell/test') diff --git a/rules/shell/test/EXPRESSIONS b/rules/shell/test/EXPRESSIONS index 2b9a62e7..2a998765 100644 --- a/rules/shell/test/EXPRESSIONS +++ b/rules/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