diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-01-26 13:23:44 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-01-26 13:23:44 +0100 |
commit | 3979ba259fe932c408844c5b43a9fdf77067230d (patch) | |
tree | 6910ed5af149f2905a6ca5505eeb644a8b35a059 /rules/CC/foreign/EXPRESSIONS | |
parent | 0c688f4d31025cae297c3b806269ba9999d0ca6e (diff) | |
parent | 0257363b76a05ed2f12dec689bd5dbc5b4e5b0e6 (diff) | |
download | rules-cc-3979ba259fe932c408844c5b43a9fdf77067230d.tar.gz |
Merge commit '0257363b76a05ed2f12dec689bd5dbc5b4e5b0e6' into rules-cc
Diffstat (limited to 'rules/CC/foreign/EXPRESSIONS')
-rw-r--r-- | rules/CC/foreign/EXPRESSIONS | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/rules/CC/foreign/EXPRESSIONS b/rules/CC/foreign/EXPRESSIONS new file mode 100644 index 0000000..2cc1ac9 --- /dev/null +++ b/rules/CC/foreign/EXPRESSIONS @@ -0,0 +1,34 @@ +{ "strip-prefix": + { "doc": + [ "Returns list of artifact maps (each map contains a single artifact)" + , "with the given prefix being stripped from their path." + ] + , "vars": ["artifacts", "paths", "prefix"] + , "vars_doc": + { "artifacts": ["A single map containing all artifacts."] + , "paths": ["List of (unprefixed) artifacts paths to consider."] + , "prefix": ["Prefix to strip from the artifact's path."] + } + , "expression": + { "type": "foreach" + , "var": "path" + , "range": {"type": "var", "name": "paths"} + , "body": + { "type": "singleton_map" + , "key": {"type": "var", "name": "path"} + , "value": + { "type": "lookup" + , "key": + { "type": "join" + , "separator": "/" + , "$1": + [ {"type": "var", "name": "prefix"} + , {"type": "var", "name": "path"} + ] + } + , "map": {"type": "var", "name": "artifacts"} + } + } + } + } +} |