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

Side by Side Diff: packages/web_components/lib/build/mirrors_remover.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 web_components.build.mirrors_remover; 4 library web_components.build.mirrors_remover;
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 /// Removes `mirror_initializer.dart` and replaces it with 9 /// Removes `mirror_initializer.dart` and replaces it with
10 /// `static_initializer.dart`. 10 /// `static_initializer.dart`.
11 class MirrorsRemoverTransformer extends Transformer { 11 class MirrorsRemoverTransformer extends Transformer {
12 MirrorsRemoverTransformer(); 12 MirrorsRemoverTransformer();
13 MirrorsRemoverTransformer.asPlugin(BarbackSettings settings); 13 MirrorsRemoverTransformer.asPlugin(BarbackSettings settings);
14 14
15 bool isPrimary(AssetId id) => id.path == 'lib/src/init.dart'; 15 bool isPrimary(AssetId id) => id.path == 'lib/src/init.dart';
16 16
17 @override 17 @override
18 Future apply(Transform transform) async { 18 Future apply(Transform transform) async {
19 String source = await transform.primaryInput.readAsString(); 19 String source = await transform.primaryInput.readAsString();
20 source = 20 source =
21 source.replaceAll('mirror_initializer.dart', 'static_initializer.dart'); 21 source.replaceAll('mirror_initializer.dart', 'static_initializer.dart');
22 transform 22 transform
23 .addOutput(new Asset.fromString(transform.primaryInput.id, source)); 23 .addOutput(new Asset.fromString(transform.primaryInput.id, source));
24 } 24 }
25 } 25 }
OLDNEW
« no previous file with comments | « packages/web_components/lib/build/messages.dart ('k') | packages/web_components/lib/build/script_compactor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698