If you want to depend on all files recursively, you can use (source_tree stylesheets). However, this will only include files that are present in your source tree, i.e. not generated one. We don’t have yet a construction for depending on a files recursively including generated files, though we are planning to add support for that.
Thanks! That worked.
As I understood, glob_files is used to tell dune to depend on files in a certain directory, while source_tree is to tell dune to depend on all files in all subdirectories of specified path. Is that right?
BTW, is there any handy way to apply this rule to different targets? E.g. I want to compile different .css files with the same action, where only deps and targets are different, but the action is always the same.
Do I have to write single rule for every action of that kind or I can define something like a function for this?
Yes, that’s exactly that. Plus one more distinction: glob_files takes into account generated files but not source_tree. I guess source_tree is a bit odd and we should add something more generic that takes generated files into account, it’s just this way for historical reason.
Unfortinately yes. We are planning to add better support for such things in the future though. In the meantime, you can use the promotion feature to generate and commit the boilerplate. We do that in dune itself, in dune/doc: