BuildStep.packageConfig getter to resolve a package config of all packages involved in the current build.package:analyzer.Resources when the resource has a dispose method. Previously the instances were discarded and recreated for every build even if they had tried to clean up their own state.ArgumentError if an expected output matches the input.buildExtensions include capture groups, enabling directory moves. For more information on this feature, see capture groupsallowedOutputs getter to BuildStep. It returns assets that may be written in that step.buildStep.complete.rootPackage argument to runBuilderAssetId.resolve from a String (which previously was required to be a valid URI) to a Uri instance. Call sites which have static errors can wrap the argument with Uri.parse().1.x.2.x.AssetId.resolve for empty urisFuture<AstNode> astNodeFor(Element, {bool resolve}) api to Resolver which provides a safe way of getting ast nodes (avoiding InconsistentAnalysisExceptions).0.41.x.InvalidInputException.AssetReader implementations are now expected to throw InvalidInputExceptions when reading invalid inputs. The check has been removed from the build step implementation.0.40.x.Future<CompilationUnit> compilationUnitFor(AssetId id) api to the Resolver class, which returns only the parsed AST for the given asset.libraryFor, because it only reads the given asset instead of touching all transitive deps.Element model.The resolver will now throw an SyntaxErrorInAssetException when attempting to resolve an asset with syntax errors. You can opt-out of this new behavior by passing allowSyntaxErrors: true to libraryFor.
Added a new experiments library which exposes a list of language experiments through a Zone variable. This should only be used by builders which are invoking compilers or some other tool and need to pass on the language experiments.
Resolver.libraries will now return any library that has been resolved with this resolver. This means calls to libraryFor or isLibrary on files not already resolved will make subsequent libraries streams return more libraries than previous calls did.findLibraryByName since it searches through the libraries stream. You may get a different result at different points in your build method if you resolve additional libraries.0.39.x.void reportUnusedAssets(Iterable<AssetId> ids) method to the BuildStep class.ids were read but their content has no impact on the outputs of the build.Future<dynamic> to Future<void>.package:analyzer to <0.37.0.0.35.0Resolver implementations in other packages are now backed by an AnalysisDriver. There are behavior changes which may be breaking. The LibraryElement instances returned by the resolver will now:context fields.session fields.Source instances with different URIs than before.Resolver.assetIdForElement API. This allows finding the Dart source asset which contains the definition of an element found through the analyzer.AssetReader.digest method should do the same, and a comment has been added to that effect.package:analyzer to <0.35.0.package:analyzer to <0.34.0.Builder.build from Future<dynamic> to FutureOr<void>. This should not be breaking for most Builder authors, it is only breaking for build system implementations that run Builders.T trackStage<T>(String label, T Function() action); method to BuildStep. Actions that are tracked in this way will show up in the performance timeline at /$perf.print calls inside a Builder will now log at warning instead of info.BuildStep after it has been completed.<3.0.0.AssetIds can no longer be constructed with paths that reach outside their package.Resolvers.reset method.List<String> get pathSegments to AssetId.log will now always return a Logger instance.package:analyzer 0.32.0.FileDeletingBuilder.FileDeletingBuilder.PostProcesBuilderFactory typedef.isRoot boolean to BuilderOptions, which allows builders to have different behavior for the root package, if desired.PostProcessBuilder. This is only supported by build_runner.BuilderOptions.empty and BuilderOptions.overrideWith.AssetIds as URIs when they contain characters which are not valid for a path segment.analyzer package.Future<Digest> digest(AssetId id) method to the AssetReader interface. There is a default implementation which uses readAsBytes and md5.MultiplexingBuilder now filters inputs rather than calling every builder on any input that matched any builder.BuilderOptions and BuilderFactory interfaces. Along with package:build_config this will offer a consistent way to describe and create the Builder instances exposed by a package.AssetReader.findAssets now returns a Stream<AssetId> instead of an Iterable<AssetId>. This also impacts BuildStep since that implements AssetReader.ResourceManagers would share Resource instances if running at the same time.MultiPackageAssetReader interface which allows globbing within any package.BuildStep class does not implement this interface.AssetReader#findAssets have changed such that it globs within the current package instead of the root package (typically defined as buildStep.inputId.package).Resource class, and BuildStep#fetchResource method.BuildStep.hasInput - all uses should be going through BuildStep.canRead.Resolver has asynchronous APIs for resolution and is retrieved synchronously from the BuildStep.Resolver.getLibrary with libraryFor and getLibraryByName with findLibraryByName.AssetReader.canRead to always return a Future.asset: URIs into AssetIdsuri property on AssetIdBuildStep.hasInput in favor of BuildStep.canRead.AssetReader.hasInput as canRead. This is breaking for implementers of AssetReader and for any clients passing a BuildStep as an AssetReadercanRead return a FutureOr for more flexibilityManagedBuildStep class.BuildStep.logger. All logging should go through the top level log.BuildStep.writeAs* methods now take a FutureOr for content. Builders which produce content asynchronously can now set up the write without waiting for it to resolve.declareOutputs is replaced with buildExtensions. All Builder implementations must now have outputs that vary only based on the extensions of inputs, rather than based on any part of the AssetId.AssetReader.findAssets to allow listing assets by glob.BuildStep.inputLibrary as a convenience.AssetId.resolve to prepend lib/ when resolving packages.AssetId.resolve constructor to easily construct AssetIds from import uris.log.info. Depending on the environment a print can be hazardous so this makes all builders safe and consistent by default.log getter which is scoped to running builds and can be used anywhere within a build rather than passing around a logger. This replaces the BuildStep.logger field.BuildStep.logger - it is replaced by logManagedBuildStep, all build runs should go through runBuilders.A number of changes to the apis, primarily to support reading/writing as bytes, as this is going to inevitably be a required feature. This will hopefully be the last breaking change before the 1.0 release, but it is a fairly large one.
AssetWriter class now has a Future writeAsBytes(AssetId id, List<int> bytes) method.AssetReader class now has a Future<List<int>> readAsBytes(AssetId id) method.Resolver#release on any resolvers you get from a BuildStep (in fact, the Resolver interface no longer has this method).BuildStep#resolver getter, which resolves the primary input, and returns a Future<Resolver>. This replaces the BuildStep#resolve method.Resolver has a new isLibrary method to check whether an asset is a Dart library source file before trying to resolve it's LibraryElementAsset class has been removed entirely.AssetWriter#writeAsString signature has changed to Future writeAsString(AssetId id, String contents, {Encoding encoding}).AssetWriterSpy#assetsWritten getter has changed from an Iterable<Asset> to an Iterable<AssetId>.BuildStep#input has been changed to BuildStep#inputId, and its type has changed from Asset to AssetId. This means you must now use BuildStep#readAsString or BuildStep#readAsBytes to read the primary input, instead of it already being read in for you.Resolver no longer has a release method (they are released for you).BuildStep#resolve no longer exists, and has been replaced with the BuildStep#resolver getter.Resolver.getLibrary will now throw a NonLibraryAssetException instead of return null if it is asked to resolve an impossible library.Note: The changes to AssetReader and AssetWriter also affect BuildStep and other classes that implement those interfaces.
build_barback to write assets from a FutureBuildStep now implements AssetReader and AssetWriter so it's easier to share with other code paths using a more limited interface.build, watch, or serve, along with PhaseGroup and related classes add a dependency on build_runner. If you are using BuilderTransformer or TansformerBuilder add a dependency on build_barback.const Resolvers() as a default instance import build_barback and used const BarbackResolvers() instead.dev_dependencies so tests run.useSharedSources when constructing Resolverspackages paths in the file watcher to their absolute paths. This fixes #109.Fix duplicate logs issue when running as a BuilderTransformer.
Support crypto 2.0.0.
BuildType, BuildStatus, and PackageDependencyType.buildStep.resolve.Resolvers instance.deleteFilesByDefault option to all top level methods. This will skip the prompt to delete files, and instead act as if you responded y.PhaseGroup instead of a List<List<Phase>>..build folder to .dart_tool/build. Other packages in the future may also use this folder.serve function.watch, but it provides a server which blocks on any ongoing builds before responding to requests.lastModified to AssetReader (only matters if you implement it).watch function. This can be used to watch the file system and run incremental rebuilds on changes.build function. This can be used to run builds..build directory which should be added to your .gitignore.resolve method to BuildStep which can give you a Resolver for an AssetId.listAssetIds to AssetReader (only matters if you implement it).delete to AssetWriter (also only matters if you implement it).