build_runner 0.8.6 build_runner: ^0.8.6 copied to clipboard
Tools to write binaries that run builders.
0.8.6 #
- Forward default options for
PostProcessBuilder
s in the generated build script. - If a build appears to be not making progress (no actions completed for 15 seconds), then a warning will now be logged with the pending actions.
- Now fail when a build is requested which does not build anything.
- Clean up some error messages.
0.8.5 #
- Add log message for merged output errors.
0.8.4 #
- Log the number of completed actions on successful builds.
- Support the new
isRoot
field forBuilderOptions
so that builders can do different things for the root package. - Deprecated
PostProcessBuilder
andPostProcessBuildStep
. These should be imported frompackage:build
instead.
0.8.3 #
- Clean and summarize stack traces printed with
--verbose
. - Added a
clean
command which deletes generated to source files and the entire build cache directory. - Bug Fix: Use the same order to compute the digest of input files to a build step when writing it as when comparing it. Previously builds would not be pruned as efficiently as they can be because the inputs erroneously looked different.
0.8.2+2 #
- The
.packages
file is now always created in the root of the output directory instead of under each top level directory.
0.8.2+1 #
- Bug Fix: Correctly parse Window's paths with new
--output
semantics.
0.8.2 #
- Allow passing multiple
--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. - Allow deleting files in the post process build step.
- Bug Fix: Correctly include the default whitelist when multiple targets without include are provided.
- Allow logging from within a build factory.
- Allow serving assets from successful build steps if the overall build fails.
- Add a
--release
flag to choose the options fromrelease_options
inbuild.yaml
. This should replace the need to use--config
pointing to a release version ofbuild.yaml
.
0.8.1 #
- Improved the layout of
/$perf
, especially after browser window resize. pub run build_runner
exits with a error when invoked with an unsupported command.- Bug Fix: Update outputs in merged directory for sources which are not used
during the build. For example if
web/index.html
is not read to produce any generated outputs changes to this file will now get picked up duringpub run build_runner watch --output build
. - Don't allow a thrown exception from a Builder to take down the entire build process - instead record it as a failed action. The overall build will still be marked as a failure, but it won't crash the process.
0.8.0 #
New Features #
- Added the new
PostProcessBuilder
class. These are not supported in bazel, and are different than a normalBuilder
in some fundamental ways:- They don't have to declare output extensions, and can output any file as long as it doesn't conflict with an existing one. This is only checked at build time.
- They can only read their primary input.
- They will not cause optional actions to run - they will only run on assets that were built as a part of the normal build.
- They can not be optional themselves, and can only output to cache.
- Because they all run in a single phase, after other builders, none of their outputs can be used as inputs to any actions.
- Added
applyPostProccess
method which takesPostProcessBuilderFactory
s instead ofBuilderFactory
s.
Breaking Changes #
BuilderApplication
now has abuilderActionFactories
getter instead of abuilderFactories
getter.- The default constructor for
BuilderApplication
has been replaced withBuilderApplication.forBuilder
andBuilderApplication.forPostProcessBuilder
.
0.7.14 #
- Warn when using
--define
orbuild.yaml
configuration for invalid builders.
0.7.13+1 #
- Fix a concurrent modification error when using
listAssets
when an asset could be written.
0.7.13 #
- Fix a bug where a chain of
Builder
s would fail to run on some outputs from previous steps when the generated asset did not match the target'ssources
. - Added support for serving on IPv4 loopback when the server hostname is 'localhost' (the default).
- Added support for serving on any connection (both IPv4 and IPv6) when the hostname is 'any'.
- Improved stdout output.
0.7.12 #
- Added the
--log-requests
flag to theserve
command, which will log all requests to the server. - Build actions using
findAssets
will be more smartly invalidated. - Added a warning if using
serve
mode but no directories were found to serve. - The
--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. - The experimental
create_merged_dir
binary is now removed, it can't be easily supported any more and has been replaced by the--output
option. - Builders which write to
source
are no longer guaranteed to run before builders which write tocache
. - Honors
runs_before
configuration from Builder definitions. - Honors
applies_builders
configuration from Builder definitions.
0.7.11+1 #
- Switch to use a
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.
0.7.11 #
- Performance tracking is now disabled by default, and you must pass the
--track-performance
flag to enable it. - The heartbeat logger will now log the current number of completed versus scheduled actions, and it will log once a second instead of every 5 seconds.
- Builds will now be invalidated when the dart SDK is updated.
- Fixed the error message when missing a build_test dependency but trying to run
the
test
command. - The build script will now exit on changes to
build.yaml
files.
0.7.10+1 #
- Fix bug where relative imports in a dependencies build.yaml would break all downstream users, https://github.com/dart-lang/build/issues/995.
0.7.10 #
New Features #
- Added a basic performance visualization. When running with
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!
Bug Fixes #
- When using
--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).
0.7.9+2 #
- Fixed a bug with build to source and watch mode that would result in an infinite build loop, #962.
0.7.9+1 #
- Support the latest
analyzer
package.
0.7.9 #
New Features #
- Added command line args to override config for builders globally. The format
is
--define "<builder_key>=<option>=<value>"
. As an example, enabling the dart2js compiler for thebuild_web_compilers|entrypoint
builder would look like this:--define "build_web_compilers|entrypoint=compiler=dart2js"
.
Bug Fixes #
- Fixed an issue with mixed mode builds, see https://github.com/dart-lang/build/issues/924.
- Fixed some issues with exit codes and --fail-on-severe, although there are still some outstanding problems. See https://github.com/dart-lang/build/issues/910 for status updates.
- Fixed an issue where the process would hang on exceptions, see https://github.com/dart-lang/build/issues/883.
- Fixed an issue with etags not getting updated for source files that weren't inputs to any build actions, https://github.com/dart-lang/build/issues/894.
- Fixed an issue with hidden .DS_Store files on mac in the generated directory, https://github.com/dart-lang/build/issues/902.
- Fixed test output so it will use the compact reporter, https://github.com/dart-lang/build/issues/821.
0.7.8 #
- Add
--config
option to use a differentbuild.yaml
at build time.
0.7.7+1 #
- Avoid watching hosted dependencies for file changes.
0.7.7 #
- The top level
run
method now returns anint
which represents anexitCode
for the command that was executed.- For now we still set the exitCode manually as well but this will likely
change in the next breaking release. In manual scripts you should
await
the call torun
and assign that toexitCode
to be future-proofed.
- For now we still set the exitCode manually as well but this will likely
change in the next breaking release. In manual scripts you should
0.7.6 #
- Update to package:build version
0.12.0
. - Removed the
DigestAssetReader
interface, thedigest
method has now moved to the coreAssetReader
interface. We are treating this as a non-breaking change because there are no known users of this interface.
0.7.5+1 #
- Bug fix for using the
--output
flag when you have notest
directory.
0.7.5 #
- Add more human friendly duration printing.
- Added the
--output <dir>
(or-o
) argument which will create a merged output directory after each build. - Added the
--verbose
(or-v
) flag which enables verbose logging.- Disables stack trace folding and terse stack traces.
- Disables the overwriting of previous info logs.
- Sets the default log level to
Level.ALL
.
- Added
pubspec.yaml
andpubspec.lock
to the whitelist for the root package sources.
0.7.4 #
- Allows using files in any build targets in the root package as sources if they fall outside the hardcoded whitelist.
- Changes to the root
.packages
file during watch mode will now cause the build script to exit and prompt the user to restart the build.
0.7.3 #
- Added the flag
--low-resources-mode
, which defaults tofalse
.
0.7.2 #
- Added the flag
--fail-on-severe
, which defaults tofalse
. In a future version this will default totrue
, which means that logging a message vialog.severe
will fail the build instead of just printing to the terminal. This would match the current behavior inbazel_codegen
. - Added the
test
command to thebuild_runner
binary.
0.7.1+1 #
- BUG FIX: Running the
build_runner
binary without arguments no longer causes a crash sayingCould not find an option named "assume-tty".
.
0.7.1 #
- Run Builders which write to the source tree before those which write to the build cache.
0.7.0 #
New Features #
- Added
toRoot
Package filter. - Actions are now invalidated at a fine grained level when
BuilderOptions
change. - Added magic placeholder files in all packages, which can be used when your
builder doesn't have a clear primary input file.
- For non-root packages the placeholder exists at
lib/$lib$
, you should declare yourbuildExtensions
like this{r'$lib$': 'my_output_file.txt'}
, which would result in an output file atlib/my_output_file.txt
in the package. - For the root package there are also placeholders at
web/$web$
andtest/$test$
which should cover most use cases. Please file an issue if you need additional placeholders. - Note that these placeholders are not real assets and attempting to read them
will result in an
AssetNotFoundException
.
- For non-root packages the placeholder exists at
Breaking Changes #
- Removed
BuildAction
. Changedbuild
andwatch
to take aList<BuilderApplication>
. Seeapply
andapplyToRoot
to set these up. - Changed
apply
to take a single String argument - a Builder key frompackage:build_config
rather than a separate package and builder name. - Changed the default value of
hideOutput
fromfalse
totrue
forapply
. WithapplyToRoot
the value remainsfalse
. - There is now a whitelist of top level directories that will be used as a part
of the build, and other files will be ignored. For now those directories
include 'benchmark', 'bin', 'example', 'lib', 'test', 'tool', and 'web'.
- If this breaks your workflow please file an issue and we can look at either adding additional directories or making the list configurable per project.
- Remove
PackageGraph.orderedPackages
andPackageGraph.dependentsOf
. - Remove
writeToCache
argument ofbuild
andwatch
. Eachapply
call should specifyhideOutput
to keep this behavior. - Removed
PackageBuilder
andPackageBuildActions
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:
- Upgrade to
build_barback
v0.5.0 which uses strong mode analysis and no longer analyzes method bodies. - Removed
dependencyType
,version
,includes
, andexcludes
fromPackageNode
. - Removed
PackageNode.noPubspec
constructor. - Removed
InputSet
. - PackageGraph instances enforce that the
root
node is the only node withisRoot == true
.
0.6.1 #
New Features #
- Add an
enableLowResourcesMode
option tobuild
andwatch
, which will consume less memory at the cost of slower builds. This is intended for use in resource constrained environments such as Travis. - Add
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.
Deprecations #
- Deprecate
PackageGraph.orderedPackages
andPackageGraph.dependentsOf
.
Internal Improvements #
- Outputs will no longer be rebuilt unless their inputs actually changed, previously if any transtive dependency changed they would be invalidated.
- Switched to using semantic analyzer summaries, this combined with the better input validation means that, ddc/summary builds are much faster on non-api affecting edits (dependent modules will no longer be rebuilt).
- Build script invalidation is now much faster, which speeds up all builds.
Bug Fixes #
- The build actions are now checked against the previous builds actions, and if they do not match then a full build is performed. Previously the behavior in this case was undefined.
- Fixed an issue where once an edge between an output and an input was created it was never removed, causing extra builds to happen that weren't necessary.
- Build actions are now checked for overlapping outputs in non-checked mode, previously this was only an assert.
- Fixed an issue where nodes could get in an inconsistent state for short periods of time, leading to various errors.
- Fixed an issue on windows where incremental builds didn't work.
0.6.0+1 #
0.6.0 #
New features #
- Added
orderedPackages
anddependentsOf
utilities toPackageGraph
. - Added the
noPubspec
constructor toPackageNode
. - Added the
PackageBuilder
andPackageBuildAction
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 theIterable<String> get outputs
field, which returns relative paths under the current package. - Added the
isOptional
field toBuildAction
. Setting this totrue
means that the action will not run unless some other non-optional action tries to read one of the outputs of the action. - Breaking:
PackageNode.location
has becomePackageNode.path
, and is now aString
(absolute path) instead of aUri
; this prevents needing conversions to/fromUri
across the package. - Breaking:
RunnerAssetReader
interface requires you to implementMultiPackageAssetReader
andDigestAssetReader
. This means thepackageName
named argument has changed topackage
, and you have to add theFuture<Digest> digest(AssetId id)
method. While technically breaking most users do not rely on this interface explicitly.- You also no longer have to implement the
Future<DateTime> lastModified(AssetId id)
method, as it has been replaced with theDigestAssetReader
interface.
- You also no longer have to implement the
- Breaking:
ServeHandler.handle
has been replaced withHandler 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 withpub run test --pub-serve=$PORT
.
Bug fixes #
- Breaking: All
AssetReader#findAssets
implementations now return aStream<AssetId>
to match the latestbuild
package. This should not affect most users unless you are extending the built inAssetReader
s or using them in a custom way. - Fixed an issue where
findAssets
could return declared outputs from previous phases that did not actually output the asset. - Fixed two issues with
writeToCache
:- Over-declared outputs will no longer attempt to build on each startup.
- Unrecognized files in the cache dir will no longer be treated as inputs.
- Asset invalidation has changed from using last modified timestamps to content hashes. This is generally much more reliable, and unblocks other desired features.
Internal changes #
- Added
PackageGraphWatcher
andPackageNodeWatcher
as a wrapper API, including anAssetChange
class that is now consistently used across the package.
0.5.0 #
- Breaking: Removed
buildType
field fromBuildResult
. - Breaking:
watch
now returns aServeHandler
instead of aStream<BuildResult>
. UseServeHandler.buildResults
to get back to the original stream. - Breaking:
serve
has been removed. Instead usewatch
and use the resultingServeHandler.handle
method along with a server created in the client script to start a server. - Prevent reads into
.dart_tool
for more hermetic builds. - Bug Fix: Rebuild entire asset graph if the build script changes.
- Add
writeToCache
argument tobuild
andwatch
which separates generated files from the source directory and allows running builders against other packages. - Allow the latest version of
package:shelf
.
0.4.0+3 #
- Bug fix: Don't try to delete files generated for other packages.
0.4.0+2 #
- Bug fix: Don't crash after a Builder reads a file from another package.
0.4.0+1 #
- Depend on
build
0.10.x andbuild_barback
0.4.x
0.4.0 #
- Breaking: The
PhaseGroup
class has been replaced with aList<BuildAction>
inbuild
,watch
, andserve
. ThePhaseGroup
andPhase
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 theInputSet
s so that the outputs are filtered out. - Breaking: The
resolvers
argument has been removed frombuild
,watch
, andserve
. - Allow
package:build
v0.10.x
0.3.4+1 #
- Support the latest release of
build_barback
.
0.3.4 #
- Support the latest release of
analyzer
.
0.3.2 #
- Support for build 0.9.0
0.3.1+1 #
- Bug Fix: Update AssetGraph version so builds can be run without manually deleting old build directory.
- Bug Fix: Check for unreadable assets in an async method rather than throw synchronously
0.3.1 #
- Internal refactoring of RunnerAssetReader.
- Support for build 0.8.0
- Add findAssets on AssetReader implementations
- Limit Asset reads to those which were available at the start of the phase. This might cause some reads which uses to succeed to fail.
0.3.0 #
0.2.0 #
Add support for the new bytes apis in build
.
New Features #
FileBasedAssetReader
andFileBasedAssetWriter
now support reading/writing as bytes.
Breaking Changes #
- Removed the
AssetCache
,CachedAssetReader
, andCachedAssetWriter
. 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 ofList<AssetId>
instead ofList<Asset>
, since theAsset
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).
0.0.1 #
- Initial separate release - split off from
build
package.