allow a single build/watch command for an entire workspace
right now I spawn 3 or 4 different build_runner watches when I open a project, but with the advent of workspaces it feels like that shouldn't be necessary any more.
Is it possible for one build_runner to cover all of the projects in a workspace?
Sounds reasonable, thanks.
I guess with renewed interest in build_runner we'll get a pile of feature requests, I can't say yet where this will end up in the pile :)
looking forward to seeing what you guys do with it!
but with the advent of workspaces
I just opened https://github.com/dart-lang/build/issues/3806 which maybe overlaps a little. But my idea wasn't to restrict it to a single Pub workspace, but rather have a single instance an IDE could spawn that could handle all projects in the open set of folders (which may or may not be a workspace). Probably there are some gains to having only a single build_runner instance (even if it's just spawning multiple isolates) versus spawning many build_runner instances for the different projects in the (VS Code) workspace.
See also my comment regarding an analyzer plugin, this would also solve the workspace issue. The plugin works on analysis contexts, you will only get one context for the whole workspace, and anything open in your IDE which has an analysis context will get codegen run on it.
I had a similar idea a while ago: https://github.com/dart-lang/build/issues/2981. At least with the standalone build_runner, a problem is that each build must have a single "root" package which is treated specially in a lot of places (running a build across a workspace means that there may be multiple root packages, or perhaps even a package that is a root package for its own build and a non-root package for another build).
Right, build_runner has quite baked in the notion of a single "root" package.
Workspaces do also technically have a "root" package - (at the workspace root) - but we would need to be able to allow other packages to also behave like root packages in terms of running their build-to-source builders and such. It would definitely require some thoughtful design work.