File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,15 @@ class Resolver {
2626 ///
2727 /// [release] must be called when done handling this [Resolver] to allow it
2828 /// to be used by later phases.
29+ ///
30+ /// If you pass a value of [false] for [resolveAllConstants] , then constants
31+ /// will only be resolved in [entryPoints] , and not any other libraries. This
32+ /// gives a significant speed boost, at the cost of not being able to assume
33+ /// all constants are already resolved.
2934 Future <Resolver > resolve (BuildStep buildStep,
30- [ List <AssetId > entryPoints] ) async {
35+ { List <AssetId > entryPoints, bool resolveAllConstants} ) async {
3136 return new Resolver (await resolver.resolve (toBarbackTransform (buildStep),
32- entryPoints? .map (toBarbackAssetId)? .toList ()));
37+ entryPoints? .map (toBarbackAssetId)? .toList (), resolveAllConstants ));
3338 }
3439
3540 /// Release this resolver so it can be updated by following build steps.
Original file line number Diff line number Diff line change @@ -31,5 +31,10 @@ abstract class BuildStep {
3131
3232 /// Gives a [Resolver] for [id] . This must be released when it is done being
3333 /// used.
34- Future <Resolver > resolve (AssetId id);
34+ ///
35+ /// If you pass a value of [false] for [resolveAllConstants] , then constants
36+ /// will only be resolved in [id] , and not any other libraries. This gives a
37+ /// significant speed boost, at the cost of not being able to assume all
38+ /// constants are already resolved.
39+ Future <Resolver > resolve (AssetId id, {bool resolveAllConstants});
3540}
Original file line number Diff line number Diff line change @@ -99,8 +99,10 @@ class BuildStepImpl implements BuildStep {
9999 }
100100
101101 /// Resolves [id] and returns a [Future<Resolver>] once that is done.
102- Future <Resolver > resolve (AssetId id) async => new Resolver (
103- await _resolvers.get (toBarbackTransform (this ), [toBarbackAssetId (id)]));
102+ @override
103+ Future <Resolver > resolve (AssetId id, {bool resolveAllConstants}) async =>
104+ new Resolver (await _resolvers.get (toBarbackTransform (this ),
105+ [toBarbackAssetId (id)], resolveAllConstants));
104106
105107 /// Should be called after `build` has completed. This will wait until for
106108 /// [_outputsCompleted] .
You can’t perform that action at this time.
0 commit comments