build 0.7.0
jakemac53
released this
27 Jan 21:31
·
2044 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
AssetWriter
class now has a
Future writeAsBytes(AssetId id, List<int> bytes)
method. - The
AssetReader
class now has aFuture<List<int>> readAsBytes(AssetId id)
method. - You no longer need to call
Resolver#release
on any resolvers you get from
aBuildStep
(in fact, theResolver
interface no longer has this method). - There is now a
BuildStep#resolver
getter, which resolves the primary input,
and returns aFuture<Resolver>
. This replaces theBuildStep#resolve
method. Resolver
has a newisLibrary
method to check whether an asset is a Dart
library source file before trying to resolve it's LibraryElement
Breaking Changes
- The
Asset
class has been removed entirely. - The
AssetWriter#writeAsString
signature has changed to
Future writeAsString(AssetId id, String contents, {Encoding encoding})
. - The type of the
AssetWriterSpy#assetsWritten
getter has changed from an
Iterable<Asset>
to anIterable<AssetId>
. BuildStep#input
has been changed toBuildStep#inputId
, and its type has
changed fromAsset
toAssetId
. This means you must now use
BuildStep#readAsString
orBuildStep#readAsBytes
to read the primary input,
instead of it already being read in for you.Resolver
no longer has arelease
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 aNonLibraryAssetException
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.