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

Side by Side Diff: pkg/polymer/lib/src/build/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: code review updates Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 /// Logic to combine all the ._buildLog.* logs into one ._buildLog file.
6 library polymer.src.build.log_combiner;
7
8 import 'dart:async';
9
10 import 'package:barback/barback.dart';
11 import 'package:html5lib/parser.dart' show parseFragment;
12
13 import 'common.dart';
14 import 'wrapped_logger.dart';
15
16 /// Logic to combine all the ._buildLog.* logs into one ._buildLog file.
17 class BuildLogCombiner extends Transformer with PolymerTransformer {
18 final TransformOptions options;
19
20 BuildLogCombiner(this.options);
21
22 // Run only on entry point html files in !releaseMode.
23 bool isPrimary(idOrAsset) {
24 if (options.releaseMode) return false;
25 var id = idOrAsset is AssetId ? idOrAsset : idOrAsset.id;
26 return options.isHtmlEntryPoint(id);
27 }
28
29 Future apply(Transform transform) {
30 // Combine all ._buildLogs* files into one ._buildLogs file.
31 return WrappedLogger.combineLogFiles(transform).then((_) {
32 // Inject the stylesheet for the logger widget.
33 return readPrimaryAsHtml(transform).then((document) {
34 document.body.append(parseFragment(
Siggi Cherem (dart-lang) 2014/08/04 20:38:37 body => head
jakemac 2014/08/04 22:21:57 Done.
35 '<link rel="stylesheet" type="text/css"'
36 'href="packages/polymer/src/build/log_injector.css">'));
37 transform.addOutput(new Asset.fromString(
38 transform.primaryInput.id, document.outerHtml));
39 });
40 });
41 }
42 }
OLDNEW
« no previous file with comments | « no previous file | pkg/polymer/lib/src/build/common.dart » ('j') | pkg/polymer/lib/src/build/log_injector.css » ('J')

Powered by Google App Engine
This is Rietveld 408576698