Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow a single build/watch command for an entire workspace #3804

Open
tylandercasper opened this issue Jan 30, 2025 · 6 comments
Open

allow a single build/watch command for an entire workspace #3804

tylandercasper opened this issue Jan 30, 2025 · 6 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@tylandercasper
Copy link

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?

@davidmorgan davidmorgan added the type-enhancement A request for a change that isn't a bug label Jan 30, 2025
@davidmorgan
Copy link
Contributor

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 :)

@tylandercasper
Copy link
Author

looking forward to seeing what you guys do with it!

@DanTup
Copy link
Contributor

DanTup commented Jan 30, 2025

but with the advent of workspaces

I just opened #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.

@jakemac53
Copy link
Contributor

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.

@simolus3
Copy link
Contributor

I had a similar idea a while ago: #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).

@jakemac53
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants