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

Unified Diff: pkg/polymer/lib/src/build/log_combiner.dart

Issue 427623002: Polymer transformer logs now show on the frontend for pub serve. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Moved some logic to the isPrimary function Created 6 years, 5 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: pkg/polymer/lib/src/build/log_combiner.dart
diff --git a/pkg/polymer/lib/src/build/log_combiner.dart b/pkg/polymer/lib/src/build/log_combiner.dart
new file mode 100644
index 0000000000000000000000000000000000000000..00ab7e2a54e8fd4cc67ce049371e72079fb11a01
--- /dev/null
+++ b/pkg/polymer/lib/src/build/log_combiner.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Logic to combine all the ._buildLog.* logs into one ._buildLog file.
+library polymer.src.build.log_combiner;
+
+import 'dart:async';
+
+import 'package:barback/barback.dart';
+
+import 'common.dart';
+import 'wrapped_logger.dart';
+
+class LogCombiner extends Transformer with PolymerTransformer {
Siggi Cherem (dart-lang) 2014/08/01 21:31:52 (a) nit: let's add a Dart doc here too. Might be t
jakemac 2014/08/04 19:49:58 Done.
+
Siggi Cherem (dart-lang) 2014/08/01 21:31:52 nit: remove empty line
jakemac 2014/08/04 19:49:58 Done.
+ final TransformOptions options;
+
+ LogCombiner(this.options);
+
+ // Run only on entry point html files in !releaseMode.
+ Future<bool> isPrimary(idOrAsset) {
Siggi Cherem (dart-lang) 2014/08/01 21:31:52 same here: change to 'bool', and remove new Future
jakemac 2014/08/04 19:49:58 Done.
+ if (options.releaseMode) return false;
+ var id = idOrAsset is AssetId ? idOrAsset : idOrAsset.id;
+ return new Future.value(options.isHtmlEntryPoint(id));
+ }
+
+ Future apply(Transform transform) {
+ return WrappedLogger.combineLogFiles(transform);
+ }
+
Siggi Cherem (dart-lang) 2014/08/01 21:31:52 nit: remove empty line
jakemac 2014/08/04 19:49:58 Done.
+}

Powered by Google App Engine
This is Rietveld 408576698