summaryrefslogtreecommitdiff
path: root/rules
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
commit566374c10f72dd3f9d18c972df477a702ad524a0 (patch)
tree7494d2ee0e9abc206d286274d1e2550f078698c6 /rules
parentbc9fa36c65183a0b8e14b37c9aa2e07ce768463e (diff)
downloadjustbuild-566374c10f72dd3f9d18c972df477a702ad524a0.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 'rules')
-rw-r--r--rules/data/RULES33
1 files changed, 33 insertions, 0 deletions
diff --git a/rules/data/RULES b/rules/data/RULES
index 02f8e113..99c8e5cb 100644
--- a/rules/data/RULES
+++ b/rules/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"}
+ }
+ }
+ }
}