build
build copied to clipboard
Shorter command to run
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 :)
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.
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).
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
buildinterface. Doing this would mean adding a dependency on build_runner, build_runner_core, and many other unnecessary deps to all users ofbuildregardless 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.
Are there other build systems using
buildthat 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).