summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2022-08-22 12:29:58 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2022-08-23 10:18:41 +0200
commit8d810e663ff4995bbceb1f16e1fb02387d76b68f (patch)
tree258b5b270302d6ce3f27896b741d48472a99bf9b /data
parent107c91837e33cfa014991fddf3a784039d9f804d (diff)
downloadrules-cc-8d810e663ff4995bbceb1f16e1fb02387d76b68f.tar.gz
Add a rule to overlay artifact maps
... in a latest-wins fashion. The intended use case is overlaying globs with individual patched files.
Diffstat (limited to 'data')
-rw-r--r--data/RULES33
1 files changed, 33 insertions, 0 deletions
diff --git a/data/RULES b/data/RULES
index 02f8e11..99c8e5c 100644
--- a/data/RULES
+++ b/data/RULES
@@ -64,4 +64,37 @@
}
}
}
+, "overlay":
+ { "doc":
+ ["Overlay the artifacts of \"deps\" targets in a latest-wins fashion."]
+ , "target_fields": ["deps"]
+ , "field_doc": {"deps": ["The targets of which to overlay the artifacts"]}
+ , "artifacts_doc":
+ [ "Artifacts of the targets specified in \"deps\". For conflicting"
+ , "logical paths, the artifact is taken from the latest target (in"
+ , "the \"deps\" field) that defines that logical path"
+ ]
+ , "runfiles_doc": ["Same as artifacts"]
+ , "expression":
+ { "type": "let*"
+ , "bindings":
+ [ [ "all"
+ , { "type": "map_union"
+ , "$1":
+ { "type": "foreach"
+ , "var": "dep"
+ , "range": {"type": "FIELD", "name": "deps"}
+ , "body":
+ {"type": "DEP_ARTIFACTS", "dep": {"type": "var", "name": "dep"}}
+ }
+ }
+ ]
+ ]
+ , "body":
+ { "type": "RESULT"
+ , "artifacts": {"type": "var", "name": "all"}
+ , "runfiles": {"type": "var", "name": "all"}
+ }
+ }
+ }
}