build 0.7.0
·
2336 commits
to master
since this release
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.
New Features
- The
AssetWriterclass now has a
Future writeAsBytes(AssetId id, List<int> bytes)method. - The
AssetReaderclass now has aFuture<List<int>> readAsBytes(AssetId id)
method. - You no longer need to call
Resolver#releaseon any resolvers you get from
aBuildStep(in fact, theResolverinterface no longer has this method). - There is now a
BuildStep#resolvergetter, which resolves the primary input,
and returns aFuture<Resolver>. This replaces theBuildStep#resolve
method. Resolverhas a newisLibrarymethod to check whether an asset is a Dart
library source file before trying to resolve it's LibraryElement
Breaking Changes
- The
Assetclass has been removed entirely. - The
AssetWriter#writeAsStringsignature has changed to
Future writeAsString(AssetId id, String contents, {Encoding encoding}). - The type of the
AssetWriterSpy#assetsWrittengetter has changed from an
Iterable<Asset>to anIterable<AssetId>. BuildStep#inputhas been changed toBuildStep#inputId, and its type has
changed fromAssettoAssetId. This means you must now use
BuildStep#readAsStringorBuildStep#readAsBytesto read the primary input,
instead of it already being read in for you.Resolverno longer has areleasemethod (they are released for you).BuildStep#resolveno longer exists, and has been replaced with the
BuildStep#resolvergetter.Resolver.getLibrarywill now throw aNonLibraryAssetExceptioninstead 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.