You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build.yaml file is intended to be published as a part of any package that has one. By doing so, build_runner knows how to build each dependency. Because of this, any builder applied to a package via its public build.yaml is effectively a part of its public API, meaning that those builders should be real dependencies and not dev_dependencies.
For builders that only read/write non-public files (e.g. tests), you likely don't want to make them real dependencies, and it shouldn't be necessary since the builder config should only impact the root package and not any consumers. But, if the builder config is included in build.yaml, it will be.
One workaround for this is to place dev-only builder config in a <package_name>.build.yaml file, where <package_name> is the name of the root package. This config is still auto-applied by build_runner like build.yaml, but isn't included in the "public API".
However, a better solution might be to support a separate dev_builders entry under each build target. When running build_runner in the same package, the dev_builders entries would be merged with the builders entries. When parsing build.yamls from dependencies, dev_builders entries would be ignored.
The original impetus for creating this issue turned out to be because of a known issue causing a builder to be created when it shouldn't be (#2191), but this feature may still be valuable on its own.
The text was updated successfully, but these errors were encountered:
The
build.yaml
file is intended to be published as a part of any package that has one. By doing so, build_runner knows how to build each dependency. Because of this, any builder applied to a package via its publicbuild.yaml
is effectively a part of its public API, meaning that those builders should be real dependencies and not dev_dependencies.For builders that only read/write non-public files (e.g. tests), you likely don't want to make them real dependencies, and it shouldn't be necessary since the builder config should only impact the root package and not any consumers. But, if the builder config is included in
build.yaml
, it will be.One workaround for this is to place dev-only builder config in a
<package_name>.build.yaml
file, where<package_name>
is the name of the root package. This config is still auto-applied by build_runner likebuild.yaml
, but isn't included in the "public API".However, a better solution might be to support a separate
dev_builders
entry under each build target. When runningbuild_runner
in the same package, thedev_builders
entries would be merged with thebuilders
entries. When parsingbuild.yaml
s from dependencies,dev_builders
entries would be ignored.The original impetus for creating this issue turned out to be because of a known issue causing a builder to be created when it shouldn't be (#2191), but this feature may still be valuable on its own.
The text was updated successfully, but these errors were encountered: