I would like to write a mill
utility tool (maybe a function or Module inside build.sc
) for summarizing and post processing results of various targets. Instead of hard coding all processed targets I prefer a solution that could somehow iterate the build.sc
contents and produce a list of found targets from which I could then filter out e.g. other than ScalaModule
s etc.
What is the most elegant way to implement this kind of iterator?
That utility tool also needs to locate the dest
directory of each target. Inside the target I can use T.dest
but how the get the destination directory from "outside" (not running the target)?
One way to accomplish this kind of functionality is to browse recursively the directory structure under ./out
but that information lacks the target type information and also target out
directory is missing if it is cleaned or not yet run at all. So it is not possible to report that target Foo
exists but has currently no results.