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

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

Issue 198053009: Use real "package:" imports in pub's plugin-loading code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 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
Index: sdk/lib/_internal/pub/lib/src/barback/build_environment.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart b/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart
index 99b3919556d7d4a30415c24eaa59a2063c2f5447..82fa93418c8f46a3f26d0cc88855d57260fc84e7 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart
@@ -228,12 +228,24 @@ class BuildEnvironment {
]);
}
+ // "$pub" is a psuedo-package that allows pub's transformer-loading
+ // infrastructure to share code with pub proper. We provide it only during
+ // the initial transformer loading process.
+ var dartPath = assetPath('dart');
+ var pubSources = listDir(dartPath).map((library) {
+ return new AssetId('\$pub',
+ path.join('lib', path.relative(library, from: dartPath)));
+ });
+
// Bind a server that we can use to load the transformers.
var transformerServer;
return BarbackServer.bind(this, _hostname, 0, null).then((server) {
transformerServer = server;
- return log.progress("Loading source assets", _provideSources);
+ return log.progress("Loading source assets", () {
+ barback.updateSources(pubSources);
+ return _provideSources();
+ });
}).then((_) {
log.fine("Provided sources.");
var completer = new Completer();
@@ -282,7 +294,7 @@ class BuildEnvironment {
subscription.cancel();
}
});
- });
+ }).then((_) => barback.removeSources(pubSources));
}
/// Provides all of the source assets in the environment to barback.

Powered by Google App Engine
This is Rietveld 408576698