| Index: lib/build/mirrors_remover.dart
|
| diff --git a/lib/build/mirrors_remover.dart b/lib/build/mirrors_remover.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4cb88625d35acb0d573f9a8b11db4a500ef19770
|
| --- /dev/null
|
| +++ b/lib/build/mirrors_remover.dart
|
| @@ -0,0 +1,25 @@
|
| +// Copyright (c) 2015, 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.
|
| +library web_components.build.mirrors_remover;
|
| +
|
| +import 'dart:async';
|
| +import 'package:barback/barback.dart';
|
| +
|
| +/// Removes `mirror_initializer.dart` and replaces it with
|
| +/// `static_initializer.dart`.
|
| +class MirrorsRemoverTransformer extends Transformer {
|
| + MirrorsRemoverTransformer();
|
| + MirrorsRemoverTransformer.asPlugin(BarbackSettings settings);
|
| +
|
| + bool isPrimary(AssetId id) => id.path == 'lib/src/init.dart';
|
| +
|
| + @override
|
| + Future apply(Transform transform) async {
|
| + String source = await transform.primaryInput.readAsString();
|
| + source = source.replaceFirst(
|
| + 'mirror_initializer.dart', 'static_initializer.dart');
|
| + transform.addOutput(
|
| + new Asset.fromString(transform.primaryInput.id, source));
|
| + }
|
| +}
|
|
|