I understand that jbuilder requires listing all .atd files manually, and this is an acceptable tradeoff, but in the case you have say 20 .atd files, how to make it less verbose ? Copy-pasting this rules 20 times is ugly and you can easily end up with a 200 lines jbuild files.
Is there anyway to have âapplication/mapâ so that you could have a rule skeleton like (please forgive my lack of lisp syntax experience)
This sounds like a case for the OCaml escape hatch where you can use OCaml in a jbuild file to generate a jbuild file. This would allow to generate the rules above concisely. Itâs still a bit clumsy because the OCaml program needs to generate the complete file, not just the part for the rules above. Luckily, the program just generates text and does not cater to a complex API (as in ocamlbuild).
On a more general note I believe it is unfortunate that we have to use âcode generationâ for simple rules like this, but I understand jbuilder is quite recent tool and has not reached the level of maturity required for every egde cases like this to be well supported.