summaryrefslogtreecommitdiff
path: root/data/EXPRESSIONS
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-05-05 16:28:14 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-05-06 05:47:40 +0200
commit5146c65928fe0f7c57a669f4c8b7815f3793828b (patch)
tree8d944e93d6ce547186beb9e1eac2bc614b166203 /data/EXPRESSIONS
parent90e9723f27a165f9d0f36b790ba4da8a1d1d8b7e (diff)
downloadrules-cc-5146c65928fe0f7c57a669f4c8b7815f3793828b.tar.gz
["data", "staged"]: support dropping paths
In this way, GLOB constructs can be used more easily. As the dropping happens early, this can also be used to solve staging conflicts, by removing that logical path and later add a consolidated artifact to that path.
Diffstat (limited to 'data/EXPRESSIONS')
-rw-r--r--data/EXPRESSIONS113
1 files changed, 113 insertions, 0 deletions
diff --git a/data/EXPRESSIONS b/data/EXPRESSIONS
new file mode 100644
index 0000000..929eaf8
--- /dev/null
+++ b/data/EXPRESSIONS
@@ -0,0 +1,113 @@
+{ "field_artifacts_without":
+ { "doc":
+ [ "Query and merge artifacts from target_field's targets,"
+ , "leaving out the specified logical paths."
+ ]
+ , "vars": ["fieldname", "transition", "exclude"]
+ , "vars_doc":
+ { "fieldname": ["The name of the target_field to query."]
+ , "transition": ["The optional configuration transition for the targets."]
+ , "exclude": ["The logical paths to exclude"]
+ }
+ , "expression":
+ { "type": "disjoint_map_union"
+ , "msg":
+ [ "artifacts"
+ , {"type": "var", "name": "fieldname"}
+ , "must not overlap after dropping paths"
+ , {"type": "var", "name": "exclude"}
+ ]
+ , "$1":
+ { "type": "foreach"
+ , "var": "x"
+ , "range":
+ {"type": "FIELD", "name": {"type": "var", "name": "fieldname"}}
+ , "body":
+ { "type": "map_union"
+ , "$1":
+ { "type": "foreach_map"
+ , "range":
+ { "type": "DEP_ARTIFACTS"
+ , "dep": {"type": "var", "name": "x"}
+ , "transition":
+ { "type": "var"
+ , "name": "transition"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "body":
+ { "type": "if"
+ , "cond":
+ { "type": "lookup"
+ , "key": {"type": "var", "name": "_"}
+ , "map": {"type": "var", "name": "exclude"}
+ }
+ , "then": {"type": "empty_map"}
+ , "else":
+ { "type": "singleton_map"
+ , "key": {"type": "var", "name": "_"}
+ , "value": {"type": "var", "name": "$_"}
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+, "field_runfiles_without":
+ { "doc":
+ [ "Query and merge runfiles from target_field's targets,"
+ , "leaving out the specified logical paths."
+ ]
+ , "vars": ["fieldname", "transition", "exclude"]
+ , "vars_doc":
+ { "fieldname": ["The name of the target_field to query."]
+ , "transition": ["The optional configuration transition for the targets."]
+ , "exclude": ["The logical paths to exclude"]
+ }
+ , "expression":
+ { "type": "disjoint_map_union"
+ , "msg":
+ [ "artifacts"
+ , {"type": "var", "name": "fieldname"}
+ , "must not overlap after dropping paths"
+ , {"type": "var", "name": "exclude"}
+ ]
+ , "$1":
+ { "type": "foreach"
+ , "var": "x"
+ , "range":
+ {"type": "FIELD", "name": {"type": "var", "name": "fieldname"}}
+ , "body":
+ { "type": "map_union"
+ , "$1":
+ { "type": "foreach_map"
+ , "range":
+ { "type": "DEP_RUNFILES"
+ , "dep": {"type": "var", "name": "x"}
+ , "transition":
+ { "type": "var"
+ , "name": "transition"
+ , "default": {"type": "empty_map"}
+ }
+ }
+ , "body":
+ { "type": "if"
+ , "cond":
+ { "type": "lookup"
+ , "key": {"type": "var", "name": "_"}
+ , "map": {"type": "var", "name": "exclude"}
+ }
+ , "then": {"type": "empty_map"}
+ , "else":
+ { "type": "singleton_map"
+ , "key": {"type": "var", "name": "_"}
+ , "value": {"type": "var", "name": "$_"}
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}