summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2022-02-22 17:03:21 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2022-02-22 17:03:21 +0100
commit86c4f55b6f578bfae74ab35151c1e4425b7e1fd1 (patch)
treea0eb1319d6449726f345b7c2f237c3fbffa71096 /data
downloadrules-cc-86c4f55b6f578bfae74ab35151c1e4425b7e1fd1.tar.gz
Initial self-hosting commit
This is the initial version of our tool that is able to build itself. In can be bootstrapped by ./bin/bootstrap.py Co-authored-by: Oliver Reiche <oliver.reiche@huawei.com> Co-authored-by: Victor Moreno <victor.moreno1@huawei.com>
Diffstat (limited to 'data')
-rw-r--r--data/RULES42
1 files changed, 42 insertions, 0 deletions
diff --git a/data/RULES b/data/RULES
new file mode 100644
index 0000000..34bc624
--- /dev/null
+++ b/data/RULES
@@ -0,0 +1,42 @@
+{ "staged":
+ { "doc": ["Stage data to a logical subdirectory."]
+ , "target_fields": ["srcs"]
+ , "string_fields": ["stage"]
+ , "field_doc":
+ { "srcs": ["The (run)files to be staged"]
+ , "stage":
+ [ "The logical directory to stage the files to."
+ , "Individual directory components are joined with \"/\"."
+ ]
+ }
+ , "expression":
+ { "type": "let*"
+ , "bindings":
+ [ [ "stage"
+ , { "type": "join"
+ , "separator": "/"
+ , "$1": {"type": "FIELD", "name": "stage"}
+ }
+ ]
+ , [ "srcs"
+ , { "type": "disjoint_map_union"
+ , "$1":
+ { "type": "foreach"
+ , "var": "x"
+ , "range": {"type": "FIELD", "name": "srcs"}
+ , "body":
+ {"type": "DEP_RUNFILES", "dep": {"type": "var", "name": "x"}}
+ }
+ }
+ ]
+ , [ "staged"
+ , { "type": "to_subdir"
+ , "subdir": {"type": "var", "name": "stage"}
+ , "$1": {"type": "var", "name": "srcs"}
+ }
+ ]
+ ]
+ , "body": {"type": "RESULT", "runfiles": {"type": "var", "name": "staged"}}
+ }
+ }
+}