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

Side by Side Diff: packages/polymer_interop/lib/src/build/replace_polymer_js.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 library polymer_interop.src.build.replace_polymer_js.dart; 4 library polymer_interop.src.build.replace_polymer_js.dart;
5 5
6 import 'dart:async'; 6 import 'dart:async';
7 import 'package:barback/barback.dart'; 7 import 'package:barback/barback.dart';
8 8
9 /// Replaces `polymer.min.js` with `polymer.js` in development mode. 9 /// Replaces `polymer.min.js` with `polymer.js` in development mode.
10 class ReplacePolymerJsTransformer extends Transformer { 10 class ReplacePolymerJsTransformer extends Transformer {
11 BarbackSettings settings; 11 BarbackSettings settings;
12 12
13 ReplacePolymerJsTransformer.asPlugin(this.settings); 13 ReplacePolymerJsTransformer.asPlugin(this.settings);
14 14
15 bool isPrimary(AssetId id) { 15 bool isPrimary(AssetId id) {
16 if (settings.mode == BarbackMode.RELEASE) return false; 16 if (settings.mode == BarbackMode.RELEASE) return false;
17 return id.path == 'lib/src/js/polymer.html'; 17 return id.path == 'lib/src/js/polymer.html';
18 } 18 }
19 19
20 Future apply(Transform transform) async { 20 Future apply(Transform transform) async {
21 var contents = await transform.primaryInput.readAsString(); 21 var contents = await transform.primaryInput.readAsString();
22 contents = contents.replaceFirst('polymer.min.js', 'polymer.js'); 22 contents = contents.replaceFirst('polymer.min.js', 'polymer.js');
23 transform 23 transform
24 .addOutput(new Asset.fromString(transform.primaryInput.id, contents)); 24 .addOutput(new Asset.fromString(transform.primaryInput.id, contents));
25 } 25 }
26 } 26 }
OLDNEW
« no previous file with comments | « packages/polymer_interop/lib/polymer_interop.dart ('k') | packages/polymer_interop/lib/src/js/AUTHORS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698