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.0
Resolver
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 Builder
s.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
.AssetId
s 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
.AssetId
s as URI
s 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
.ResourceManager
s 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 AssetReader
canRead
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 log
ManagedBuildStep
, 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).