build icon indicating copy to clipboard operation
build copied to clipboard

Shorter command to run

Open davidmorgan opened this issue 8 months ago • 4 comments

We could make build the default, and put the binary in package:build, leading to

dart run build

instead of the current dart run build_runner build :)

Thanks to @jonasfj for the suggestion :)

davidmorgan avatar Mar 12 '25 13:03 davidmorgan

I think watch -d should be the default instead.

build is more of a CI thing. watch is what folks use in their day-to-day life.

rrousselGit avatar Mar 12 '25 13:03 rrousselGit

The build package should not have a dependency on build_runner, the layering here is very intentional. The build_runner package is just one of many possible implementations of build systems using the build interface. Doing this would mean adding a dependency on build_runner, build_runner_core, and many other unnecessary deps to all users of build regardless of the implementation they use. It would also introduce a cyclic package dependency which is best avoided.

This could maybe be done by having a script which just checks for a dependency on package:build_runner, and if it sees it then it runs dart run build_runner build, so its effectively just an alias, but I don't think there is much value in that personally (and it would make things slower, an extra app to compile, potential for bugs around forwarding stdin/stdout etc).

jakemac53 avatar Mar 12 '25 15:03 jakemac53

The build package should not have a dependency on build_runner, the layering here is very intentional. The build_runner package is just one of many possible implementations of build systems using the build interface. Doing this would mean adding a dependency on build_runner, build_runner_core, and many other unnecessary deps to all users of build regardless of the implementation they use. It would also introduce a cyclic package dependency which is best avoided.

As you know I very much like correct build dependencies, so whatever we do, there will be some clean deps graph coming out of it :)

Are there other build systems using build that we know about? There are a lot of concrete requests from users we do know about, I'm not super enthusiastic about supporting speculative use cases. Of course, if people are using it, we'll support it in some form.

davidmorgan avatar Mar 13 '25 08:03 davidmorgan

Are there other build systems using build that we know about? There are a lot of concrete requests from users we do know about, I'm not super enthusiastic about supporting speculative use cases. Of course, if people are using it, we'll support it in some form.

Internal google3, and even build_test could be considered one. Additionally the prototype analyzer plugin is an example.

It is a core feature and gives us a lot of future flexibility - as well as allowing the ecosystem to create alternatives (honestly, I am quite surprised there aren't any of these).

jakemac53 avatar Mar 13 '25 16:03 jakemac53