summaryrefslogtreecommitdiff
path: root/CC/foreign/EXPRESSIONS
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-01-20 12:04:43 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2023-01-26 12:58:25 +0100
commit0257363b76a05ed2f12dec689bd5dbc5b4e5b0e6 (patch)
tree050aeaf31704440476c370b8128537d3b1c0f447 /CC/foreign/EXPRESSIONS
parente75f101e8b988adb458e594ffaaaebc0c01f65df (diff)
downloadrules-cc-0257363b76a05ed2f12dec689bd5dbc5b4e5b0e6.tar.gz
Support creating libraries from CMake project
Diffstat (limited to 'CC/foreign/EXPRESSIONS')
-rw-r--r--CC/foreign/EXPRESSIONS34
1 files changed, 34 insertions, 0 deletions
diff --git a/CC/foreign/EXPRESSIONS b/CC/foreign/EXPRESSIONS
new file mode 100644
index 0000000..2cc1ac9
--- /dev/null
+++ b/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"}
+ }
+ }
+ }
+ }
+}