OLD | NEW |
1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this | 1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in | 2 // source code is governed by a BSD-style license that can be found in |
3 // the LICENSE file. | 3 // the LICENSE file. |
4 | 4 |
5 library reflectable.transformer; | 5 library reflectable.transformer; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'package:barback/barback.dart'; | 9 import 'package:barback/barback.dart'; |
10 import 'package:logging/logging.dart'; | 10 import 'package:logging/logging.dart'; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 /// Creates new instance as required by Barback. | 118 /// Creates new instance as required by Barback. |
119 ReflectableTransformer.asPlugin(this._settings) { | 119 ReflectableTransformer.asPlugin(this._settings) { |
120 _entryPoints = _findEntryPoints(_settings.configuration['entry_points']); | 120 _entryPoints = _findEntryPoints(_settings.configuration['entry_points']); |
121 _formatted = _findFormatted(_settings.configuration['formatted']); | 121 _formatted = _findFormatted(_settings.configuration['formatted']); |
122 _suppressWarnings = | 122 _suppressWarnings = |
123 _findSuppressWarnings(_settings.configuration['suppressWarnings']); | 123 _findSuppressWarnings(_settings.configuration['suppressWarnings']); |
124 } | 124 } |
125 | 125 |
126 /// Return a [String] or [Future<String>] valued key for each | 126 /// Returns a [String] or [Future<String>] valued key for each |
127 /// primary asset that this transformer wishes to process, and | 127 /// primary asset that this transformer wishes to process, and |
128 /// null for assets that it wishes to ignore. Primary assets | 128 /// null for assets that it wishes to ignore. Primary assets |
129 /// with the same key are delivered to [apply] as a group. In | 129 /// with the same key are delivered to [apply] as a group. In |
130 /// this transformer we handle the grouping later, so everything | 130 /// this transformer we handle the grouping later, so everything |
131 /// is in the same group. | 131 /// is in the same group. |
132 String classifyPrimary(AssetId id) { | 132 String classifyPrimary(AssetId id) { |
133 return _entryPoints.any((entryPoint) => id.path.endsWith(entryPoint)) | 133 return _entryPoints.any((entryPoint) => id.path.endsWith(entryPoint)) |
134 ? "ReflectableTransformed" | 134 ? "ReflectableTransformed" |
135 : null; | 135 : null; |
136 } | 136 } |
(...skipping 16 matching lines...) Expand all Loading... |
153 // any diagnostic messages, this is done by `apply` in | 153 // any diagnostic messages, this is done by `apply` in |
154 // `TransformerImplementation`. | 154 // `TransformerImplementation`. |
155 return; | 155 return; |
156 } | 156 } |
157 transform.declareOutput(id); | 157 transform.declareOutput(id); |
158 AssetId dataId = id.changeExtension("_reflectable_original_main.dart"); | 158 AssetId dataId = id.changeExtension("_reflectable_original_main.dart"); |
159 transform.declareOutput(dataId); | 159 transform.declareOutput(dataId); |
160 }); | 160 }); |
161 } | 161 } |
162 } | 162 } |
OLD | NEW |