test
command to wait to exit until the inner test process exits.build_daemon
and provide a shutdown notification on build script updates.build_daemon
.run
command to execute VM entrypoints with generated sources.build_daemon
.build_config
.HttpMultiServer.loopback
for the daemon asset server..dart_tool
dir (or doing a clean
).build_runner_core
and build_daemon
releases.test
.build_daemon
to version 0.4.0
.build_runner_core
to version 2.0.3
.build_resolvers
to version 1.0.0
.--live-reload
and --hot-reload
might not work due to the etags for the injected JS not changing when they should.package:build_runner_core
to version 2.0.1
.package:build_daemon
.package:build_runner_core
to version 2.0.0
.package:graphs
version 0.2.0
.build
version 1.1.x
.78
to indicate that there is a problem with configuration in the project or a dependency's build.yaml
.Bootstrap
logger.run
method. The goal is to reduce the surface area in order to stabilize this package, since it is directly depended on by all users.build
and watch
functions directly, as well as the ServeHandler
.timing
package.clean
command.--hot-reload
cli option and appropriate functionality. See hot-module-reloading for more info.serve
mode.--live-reload
cli option and appropriate functionalityBuildEnvironment
must now implement the finalizeBuild
method. There is a default implementation if you extend BuildEnvironment
that is a no-op.assumeTty
argument on IOEnvironment
has moved to a named argument since null
is an accepted value.outputMap
field on BuildOptions
has moved to the IOEnvironment
class.outputSymlinksOnly
option to IOEnvironment
constructor, that causes the merged output directories to contain only symlinks, which is much faster than copying files.FinalizedAssetView
class which provides a list of all available assets to the BuildEnvironment
during the build finalization phase.outputMap
has moved from BuildOptions
to this constructor, as a named argument.OverridableEnvironment
now supports overriding the new finalizeBuild
api.<3.0.0
..dart_tool/build
is now based on a relative path to the build script instead of the absolute path..dart_tool/build
directories to be reused across different computers and directories for the same project.--log-performance <dir>
option which will dump performance information to <dir>
after each build.BuildPerformance
class is now serializable, it has a fromJson
constructor and a toJson
instance method.global_options
in build.yaml
of the root package.Resolvers
implementation.BuildPhasePerformance.action
has been replaced with BuildPhasePerformance.builderKeys
.BuilderActionPerformance.builder
has been replaced with BuilderActionPerformance.builderKey
.BuildResult
no longer has an exception
or stackTrace
field.run
will no longer set an exit code. All manual build scripts which call run
should use the Future<int>
return to set the exit code for the process.failOnSevere
arguments and --fail-on-severe
flag. Severe logs are always considered failing.stdout
along with other logs rather than stderr
. Uncaught exceptions from the build_runner
system itself still go to stderr
.>=2.0.0-dev.61
.build_to: source
will now be ran regardless of which directory is currently being built, see https://github.com/dart-lang/build/issues/1454 for context.build
will now throw instead of returning a failed build result if nothing was built.build.yaml
with a missing dependency.target
will no longer appear in the asset graph, so they will not be readable or globbable.build
, watch
commands support positional arguments which are the directories to build. For example, pub run build_runner build web
will only build the web
directory.serve
command treats positional args as it did before, except it will only build the directories you ask it to serve.test
command will automatically only build the test
directory.-o
option, with the <dir-to-build>:<output-dir>
syntax, then the <dir-to-build>
will be added to the list of directories to build.serve
logic to only serve files which were part of the actual build, and not stale assets. This brings the semantics exactly in line with what would be copied to the -o
output directory./$graph
page. Users can now query for paths and AssetID
values – pkg_name|lib/pkg_name.dart
./$graph
page.package:builde
PostProcessBuilder
s in the generated build script.isRoot
field for BuilderOptions
so that builders can do different things for the root package.PostProcessBuilder
and PostProcessBuildStep
. These should be imported from package:build
instead.--verbose
.clean
command which deletes generated to source files and the entire build cache directory..packages
file is now always created in the root of the output directory instead of under each top level directory.--output
semantics.--output
options. Each option will be split on :
. The first value will be the root input directory, the second value will be the output directory. If no delimeter is provided, all resources will be copied to the output directory.--release
flag to choose the options from release_options
in build.yaml
. This should replace the need to use --config
pointing to a release version of build.yaml
./$perf
, especially after browser window resize.pub run build_runner
exits with a error when invoked with an unsupported command.web/index.html
is not read to produce any generated outputs changes to this file will now get picked up during pub run build_runner watch --output build
.PostProcessBuilder
class. These are not supported in bazel, and are different than a normal Builder
in some fundamental ways:applyPostProccess
method which takes PostProcessBuilderFactory
s instead of BuilderFactory
s.BuilderApplication
now has a builderActionFactories
getter instead of a builderFactories
getter.BuilderApplication
has been replaced with BuilderApplication.forBuilder
and BuilderApplication.forPostProcessBuilder
.--define
or build.yaml
configuration for invalid builders.listAssets
when an asset could be written.Builder
s would fail to run on some outputs from previous steps when the generated asset did not match the target's sources
.--log-requests
flag to the serve
command, which will log all requests to the server.findAssets
will be more smartly invalidated.serve
mode but no directories were found to serve.--output
option now only outputs files that were required for the latest build. Previously when switching js compilers you could end up with ddc modules in your dart2js output, even though they weren't required. See https://github.com/dart-lang/build/issues/1033.create_merged_dir
binary is now removed, it can't be easily supported any more and has been replaced by the --output
option.source
are no longer guaranteed to run before builders which write to cache
.runs_before
configuration from Builder definitions.applies_builders
configuration from Builder definitions.PollingDirectoryWatcher
on windows, which should fix file watching with the --output
option. Follow along at https://github.com/dart-lang/watcher/issues/52 for more details.--track-performance
flag to enable it.test
command.build.yaml
files.serve
you can now navigate to /$perf
and get a timeline of all actions. If you are experiencing slow builds (especially incremental ones), you can save the html of that page and attach it to bug reports!--output
we will only clean up files we know we previously output to the specified directory. This should allow running long lived processes such as servers in that directory (as long as they don't hold open file handles).analyzer
package.--define "<builder_key>=<option>=<value>"
. As an example, enabling the dart2js compiler for the build_web_compilers|entrypoint
builder would look like this: --define "build_web_compilers|entrypoint=compiler=dart2js"
.--config
option to use a different build.yaml
at build time.run
method now returns an int
which represents an exitCode
for the command that was executed.await
the call to run
and assign that to exitCode
to be future-proofed.0.12.0
.DigestAssetReader
interface, the digest
method has now moved to the core AssetReader
interface. We are treating this as a non-breaking change because there are no known users of this interface.--output
flag when you have no test
directory.--output <dir>
(or -o
) argument which will create a merged output directory after each build.--verbose
(or -v
) flag which enables verbose logging.Level.ALL
.pubspec.yaml
and pubspec.lock
to the whitelist for the root package sources..packages
file during watch mode will now cause the build script to exit and prompt the user to restart the build.--low-resources-mode
, which defaults to false
.--fail-on-severe
, which defaults to false
. In a future version this will default to true
, which means that logging a message via log.severe
will fail the build instead of just printing to the terminal. This would match the current behavior in bazel_codegen
.test
command to the build_runner
binary.build_runner
binary without arguments no longer causes a crash saying Could not find an option named "assume-tty".
.toRoot
Package filter.BuilderOptions
change.lib/$lib$
, you should declare your buildExtensions
like this {r'$lib$': 'my_output_file.txt'}
, which would result in an output file at lib/my_output_file.txt
in the package.web/$web$
and test/$test$
which should cover most use cases. Please file an issue if you need additional placeholders.AssetNotFoundException
.BuildAction
. Changed build
and watch
to take a List<BuilderApplication>
. See apply
and applyToRoot
to set these up.apply
to take a single String argument - a Builder key from package:build_config
rather than a separate package and builder name.hideOutput
from false
to true
for apply
. With applyToRoot
the value remains false
.PackageGraph.orderedPackages
and PackageGraph.dependentsOf
.writeToCache
argument of build
and watch
. Each apply
call should specify hideOutput
to keep this behavior.PackageBuilder
and PackageBuildActions
classes. Use the new magic placeholder files instead (see new features section for this release).The following changes are technically breaking but should not impact most clients:
build_barback
v0.5.0 which uses strong mode analysis and no longer analyzes method bodies.dependencyType
, version
, includes
, and excludes
from PackageNode
.PackageNode.noPubspec
constructor.InputSet
.root
node is the only node with isRoot == true
.enableLowResourcesMode
option to build
and watch
, which will consume less memory at the cost of slower builds. This is intended for use in resource constrained environments such as Travis.createBuildActions
. After finding a list of Builders to run, and defining which packages need them applied, use this tool to apply them in the correct order across the package graph.PackageGraph.orderedPackages
and PackageGraph.dependentsOf
.package:pool
to limit the number of open file handles.writeToCache: true
.orderedPackages
and dependentsOf
utilities to PackageGraph
.noPubspec
constructor to PackageNode
.PackageBuilder
and PackageBuildAction
classes. These builders only run once per package, and have no primary input. Outputs must be well known ahead of time and are declared with the Iterable<String> get outputs
field, which returns relative paths under the current package.isOptional
field to BuildAction
. Setting this to true
means that the action will not run unless some other non-optional action tries to read one of the outputs of the action.PackageNode.location
has become PackageNode.path
, and is now a String
(absolute path) instead of a Uri
; this prevents needing conversions to/from Uri
across the package.RunnerAssetReader
interface requires you to implement MultiPackageAssetReader
and DigestAssetReader
. This means the packageName
named argument has changed to package
, and you have to add the Future<Digest> digest(AssetId id)
method. While technically breaking most users do not rely on this interface explicitly.Future<DateTime> lastModified(AssetId id)
method, as it has been replaced with the DigestAssetReader
interface.ServeHandler.handle
has been replaced with Handler ServeHandler.handleFor(String rootDir)
. This allows you to create separate handlers per directory you want to serve, which maintains pub serve conventions and allows interoperation with pub run test --pub-serve=$PORT
.AssetReader#findAssets
implementations now return a Stream<AssetId>
to match the latest build
package. This should not affect most users unless you are extending the built in AssetReader
s or using them in a custom way.findAssets
could return declared outputs from previous phases that did not actually output the asset.writeToCache
:PackageGraphWatcher
and PackageNodeWatcher
as a wrapper API, including an AssetChange
class that is now consistently used across the package.buildType
field from BuildResult
.watch
now returns a ServeHandler
instead of a Stream<BuildResult>
. Use ServeHandler.buildResults
to get back to the original stream.serve
has been removed. Instead use watch
and use the resulting ServeHandler.handle
method along with a server created in the client script to start a server..dart_tool
for more hermetic builds.writeToCache
argument to build
and watch
which separates generated files from the source directory and allows running builders against other packages.package:shelf
.build
0.10.x and build_barback
0.4.xPhaseGroup
class has been replaced with a List<BuildAction>
in build
, watch
, and serve
. The PhaseGroup
and Phase
classes are removed. If your current build has multiple actions in a single phase which are depending on not seeing the outputs from other actions in the phase you will need to instead set up the InputSet
s so that the outputs are filtered out.resolvers
argument has been removed from build
, watch
, and serve
.package:build
v0.10.xbuild_barback
.analyzer
.RunnerAssetWriter
now requires an additional field, onDelete
which is a callback that must be called synchronously within delete
.Add support for the new bytes apis in build
.
FileBasedAssetReader
and FileBasedAssetWriter
now support reading/writing as bytes.AssetCache
, CachedAssetReader
, and CachedAssetWriter
. These may come back at a later time if deemed necessary, but for now they just complicate things unnecessarily without proven benefits.BuildResult#outputs
now has a type of List<AssetId>
instead of List<Asset>
, since the Asset
class no longer exists. Additionally this was wasting memory by keeping all output contents around when it's not generally a very useful thing outside of tests (which retain this information in other ways).build
package.