diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-05-12 14:18:24 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-05-12 14:33:55 +0200 |
commit | 7990e2dd1c3cfd99d216afd91b638a0e12156de2 (patch) | |
tree | 4a20c941747f734d8746a4953381267c246a49a4 | |
parent | b49842343371d1b0c99c3abf438a2490e1be372e (diff) | |
download | rules-cc-7990e2dd1c3cfd99d216afd91b638a0e12156de2.tar.gz |
["data", "staged"] Allow direct dependencies
Add a "deps" field to ["data", "staged"] from which the runfiles
also added, without being staged, e.g., another ["data", "staged"]
target, possibly with a different stage. This allows convenient
collection of files, logically put to different directories.
-rw-r--r-- | data/RULES | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -1,6 +1,6 @@ { "staged": { "doc": ["Stage data to a logical subdirectory."] - , "target_fields": ["srcs"] + , "target_fields": ["srcs", "deps"] , "string_fields": ["stage"] , "field_doc": { "srcs": ["The files to be staged"] @@ -8,10 +8,15 @@ [ "The logical directory to stage the files to." , "Individual directory components are joined with \"/\"." ] + , "deps": + [ "Targets of with their runfiles should be added as well." + , "Their staging is not changed." + ] } , "artifacts_doc": [ "The runfiles of the \"srcs\" targets staged to the directory" - , "specified in \"stage\"." + , "specified in \"stage\" together the runfiles of the targets" + , "specied in the field \"deps\" (in their original location)." ] , "runfiles_doc": ["Same as artifacts"] , "imports": {"runfiles": ["./", "..", "field_runfiles"]} @@ -36,11 +41,26 @@ , "$1": {"type": "var", "name": "srcs"} } ] + , [ "dep stage" + , { "type": "let*" + , "bindings": [["fieldname", "deps"]] + , "body": {"type": "CALL_EXPRESSION", "name": "runfiles"} + } + ] + , [ "total" + , { "type": "disjoint_map_union" + , "msg": "Conflict between staged data and dependencies" + , "$1": + [ {"type": "var", "name": "dep stage"} + , {"type": "var", "name": "staged"} + ] + } + ] ] , "body": { "type": "RESULT" - , "artifacts": {"type": "var", "name": "staged"} - , "runfiles": {"type": "var", "name": "staged"} + , "artifacts": {"type": "var", "name": "total"} + , "runfiles": {"type": "var", "name": "total"} } } } |