You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to write a rule to generate arbitrary JSON files with sources and deps. The implementation of that rule is fairly simple using ctx.actions.write_json, but the issue comes from the attrs parameter to rule.
In real life the layout would be more complicated, and not something that I would like to replicate the structure of in the rule's attrs. Writing out the sum type for this would be quite painful, so I'd like to have to avoid this. It also adds the restriction that the JSON schema has to be known upfront.
Another option would be to write a rule that takes in an existing JSON file and search/replace specific tokens. The rule would then take key/value pairs of token -> source/dep replacement. But that's quite cumbersome for users.
Is there a better to do this?
The text was updated successfully, but these errors were encountered:
I'd like to write a rule to generate arbitrary JSON files with sources and deps. The implementation of that rule is fairly simple using
ctx.actions.write_json
, but the issue comes from theattrs
parameter torule
.Consider:
In real life the layout would be more complicated, and not something that I would like to replicate the structure of in the
rule
'sattrs
. Writing out the sum type for this would be quite painful, so I'd like to have to avoid this. It also adds the restriction that the JSON schema has to be known upfront.Another option would be to write a rule that takes in an existing JSON file and search/replace specific tokens. The rule would then take key/value pairs of token -> source/dep replacement. But that's quite cumbersome for users.
Is there a better to do this?
The text was updated successfully, but these errors were encountered: