A build system for Dart
Switch branches/tags
v0.5.0 v0.4.1+3 v0.4.1+2 v0.4.1+1 v0.4.1 v0.4.0 v0.3.0+6 v0.3.0+5 v0.3.0+4 v0.3.0+3 v0.3.0+2 v0.2.1 v0.2.0 v0.1.4 v0.1.3 v0.1.2 v0.1.1 v0.1.0 scratch_space-v0.0.3+2 scratch_space-v0.0.3+1 scratch_space-v0.0.3 scratch_space-v0.0.2+1 scratch_space-v0.0.2 scratch_space-v0.0.1+3 scratch_space-v0.0.1+2 build_web_compilers-v0.4.4+2 build_web_compilers-v0.4.4+1 build_web_compilers-v0.4.4 build_web_compilers-v0.4.3+1 build_web_compilers-v0.4.3 build_web_compilers-v0.4.2+2 build_web_compilers-v0.4.2+1 build_web_compilers-v0.4.2 build_web_compilers-v0.4.1 build_web_compilers-v0.4.0+4 build_web_compilers-v0.4.0+3 build_web_compilers-v0.4.0+1 build_web_compilers-v0.4.0 build_web_compilers-v0.3.8 build_web_compilers-v0.3.7+3 build_web_compilers-v0.3.7+2 build_web_compilers-v0.3.7+1 build_web_compilers-v0.3.7 build_web_compilers-v0.3.6 build_web_compilers-v0.3.5 build_web_compilers-v0.3.4+2 build_web_compilers-v0.3.4+1 build_web_compilers-v0.3.4 build_web_compilers-v0.3.3 build_web_compilers-v0.3.2 build_web_compilers-v0.3.1 build_web_compilers-v0.3.0 build_web_compilers-v0.2.1+1 build_web_compilers-v0.2.1 build_vm_compilers-v0.1.1+3 build_vm_compilers-v0.1.1+2 build_vm_compilers-v0.1.1+1 build_vm_compilers-v0.1.1 build_test-v0.10.3+3 build_test-v0.10.3+2 build_test-v0.10.3+1 build_test-v0.10.3 build_test-v0.10.2+5 build_test-v0.10.2+4 build_test-v0.10.2+3 build_test-v0.10.2+2 build_test-v0.10.2+1 build_test-v0.10.2 build_test-v0.10.1+1 build_test-v0.10.1 build_test-v0.10.0 build_test-v0.9.4 build_test-v0.9.3 build_test-v0.9.2 build_test-v0.9.1 build_test-v0.9.0 build_test-v0.8.0 build_test-v0.7.1 build_test-v0.7.0+1 build_test-v0.7.0 build_test-v0.6.4+1 build_test-v0.6.4 build_test-v0.6.3 build_test-v0.6.2 build_test-v0.6.1 build_test-v0.6.0 build_test-v0.5.2 build_test-v0.5.1 build_test-v0.4.1 build_test-v0.4.0+1 build_test-v0.4.0 build_test-v0.3.1 build_test-v0.3.0 build_test-v0.2.1 build_test-v0.2.0 build_test-v0.1.2 build_runner_core-v1.1.0 build_runner_core-v1.0.2 build_runner_core-v1.0.1 build_runner_core-v1.0.0
Nothing to show
Clone or download
natebosch Improve error message when build script is invalid (#1901)
See #1900

Add explicit error handling in the places where we can identify either
syntactically or semantically invalid code.

If the script fails to parse when attempting to format the output
pointing to the error isn't very useful, since at that point the script
is all on one line - for this case indicate that the script cannot be
parsed.

If the script fails to snapshot we can print the stderr from the dart
process which should include details of the problem.

In both cases we assume that the problem stems from bad config and so we
exit with code 78.

Also fix some bugs with the test utilities for integration tests using
`pub run build_runner` instead of running with a simulated manual build
script:

- Add missing dependencies for the pubspecs in `packageWithBuilders`.
- Create the directories for dependencies when creating with `package`.
- In pubspecs write both `dependencies` and `dependency_overrides` since
  overrides are not taken into account for the non-root package.
Latest commit 1d3cb64 Nov 13, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update ISSUE_TEMPLATE.md (#1220) Mar 29, 2018
_test Run build_runner scripts from snapshot. (#1892) Nov 2, 2018
_test_common Fix unnecessary_this violations (#1879) Oct 12, 2018
bazel_codegen Use correct exceptions in bazel AssetReader (#1881) Oct 12, 2018
build remove dependency overrides in package:build to prep for publish (#1875) Oct 8, 2018
build_config Support the latest json_annotation across 3 packages (#1887) Oct 23, 2018
build_modules Support the latest json_annotation across 3 packages (#1887) Oct 23, 2018
build_resolvers Extend analyzer range to 0.34 (#1873) Oct 8, 2018
build_runner Improve error message when build script is invalid (#1901) Nov 13, 2018
build_runner_core Run build_runner scripts from snapshot. (#1892) Nov 2, 2018
build_test Extend analyzer range to 0.34 (#1873) Oct 8, 2018
build_vm_compilers add test that sync-async is enabled for kernel (#1885) Oct 18, 2018
build_web_compilers Remove mention of work on command line options (#1889) Oct 26, 2018
docs Remove "dev channel or fresher" requirement (#1888) Oct 25, 2018
example Update dependencies in example (#1868) Sep 28, 2018
scratch_space Update build_runner dependency everywhere (#1871) Oct 2, 2018
tool Adds support for config specific imports (#1793) Aug 29, 2018
.gitignore Clean up .gitignore (#1821) Sep 11, 2018
.travis.yml Adds support for config specific imports (#1793) Aug 29, 2018
AUTHORS Don't duplicate common files (#156) Dec 8, 2016
CONTRIBUTING.md Don't duplicate common files (#156) Dec 8, 2016
LICENSE Ordering and place-holders in README, added root LICENSE (#1146) Mar 12, 2018
README.md clarify description in readme (#1692) Jul 30, 2018
analysis_options.yaml Add null_closures lint (#1882) Oct 12, 2018
appveyor.yml Fix relative builder import uris on windows (#1603) Jun 21, 2018
mono_repo.yaml misc: update to mono_repo v1.0.0 (#1795) Aug 28, 2018

README.md

Build Status Build Status

These packages provide libraries for generating, compiling and serving Dart code.

Getting started with build_runner

Integrating with Travis

General FAQ

Windows FAQ

FAQ for Builder authors.

Additional Docs

build

Defines the interfaces for creating a Builder which is a way of doing codegen that is compatible across build systems (pub, bazel, standalone runner).

For packages doing code generation this should generally be the only package against which there is a public dependency. Packages may have a dev_dependency on one or more of the other packages.

build_config

Support for parsing build.yaml files. Used by build_runner.

build_modules

Support for discovering the sub-modules within packages and creating summaries of those modules. Used by build_web_compilers but should not be used directly by most users.

build_resolvers

An implementation of the Resolver interface to use the analyzer during build steps.

build_runner

Provides utilities to enact builds and a way to automatically run builds based on configuration.

This package should generally be a dev_dependency as it is used to run standalone builds. The only exception would be wrapping the build and watch methods with some other package.

build_test

Stub implementations for classes in Build and some utilities for running instances of builds and checking their outputs.

This package generally only be a dev_dependency as it introduces a dependency on package:test. The exception to that would be if you were creating another testing-only package that wraps this one.

build_web_compilers

Provides the dart2js and dartdevc support for your package. To use this package you should add it as a dev_dependency.

If you are using the automated build scripts, your project will automatically start being compiled with dartdevc, and you can start developing with chrome without any configuration.

Examples

The example directory has an example of a build with custom builders which generate outputs into both the source tree and a hidden generated directory. Try a build with pub run build_runner build -o web:deploy to see what the output looks like.

Most projects should not need custom builders. A more typical project which uses Angular and compiles to javascript can be found in the angular repo.