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

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

Issue 24886002: Support dart2js in pub serve. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 2 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/load_all_transformers.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/load_all_transformers.dart b/sdk/lib/_internal/pub/lib/src/barback/load_all_transformers.dart
index 3efce84417b0dfe2916411b21d39f0ceedce2e35..a03ce3acb8c881fe167871a39347b108fc2b045c 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/load_all_transformers.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/load_all_transformers.dart
@@ -19,7 +19,11 @@ import '../utils.dart';
///
/// This uses [server] to serve the Dart files from which transformers are
/// loaded, then adds the transformers to `server.barback`.
-Future loadAllTransformers(BarbackServer server, PackageGraph graph) {
+///
+/// Any [builtInTransformers] that are provided will automatically be added to
+/// the end of every package's cascade.
+Future loadAllTransformers(BarbackServer server, PackageGraph graph,
+ [Iterable<Transformer> builtInTransformers]) {
// In order to determine in what order we should load transformers, we need to
// know which transformers depend on which others. This is different than
// normal package dependencies. Let's begin with some terminology:
@@ -109,7 +113,12 @@ Future loadAllTransformers(BarbackServer server, PackageGraph graph) {
for (var package in graph.packages.values) {
var phases = package.pubspec.transformers.map((phase) {
return unionAll(phase.map((id) => loader.transformersFor(id)));
- });
+ }).toList();
+
+ if (builtInTransformers != null && builtInTransformers.isNotEmpty) {
+ phases.add(builtInTransformers);
+ }
+
server.barback.updateTransformers(package.name, phases);
}
});

Powered by Google App Engine
This is Rietveld 408576698