Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1249)

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart

Issue 597773003: Have barback lazily load assets from static pub packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/pub_package_provider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart b/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
index 8f37145a568693f89b40a2c5c47585e5ffc71a76..b2fbb50070481d51ca84732e9885545481a2c2ee 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
@@ -504,11 +504,7 @@ class AssetEnvironment {
});
return _withStreamErrors(() {
- return log.progress("Loading source assets", () {
- barback.updateSources(pubSources);
- barback.updateSources(sdkSources);
- return _provideSources();
- });
+ return log.progress("Loading source assets", _provideSources);
}, [errorStream, barback.results]);
}).then((_) {
log.fine("Provided sources.");
@@ -543,12 +539,13 @@ class AssetEnvironment {
/// Provides the public source assets in the environment to barback.
///
/// If [watcherType] is not [WatcherType.NONE], enables watching on them.
- Future _provideSources() {
+ Future _provideSources() async {
// Just include the "lib" directory from each package. We'll add the
// other build directories in the root package by calling
// [serveDirectory].
- return Future.wait(graph.packages.values.map((package) {
- return _provideDirectorySources(package, "lib");
+ await Future.wait(graph.packages.values.map((package) async {
+ if (graph.isPackageStatic(package.name)) return;
+ await _provideDirectorySources(package, "lib");
}));
}
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/pub_package_provider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698