OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 | 4 |
5 /// Transfomer that combines multiple dart script tags into a single one. | 5 /// Transfomer that combines multiple dart script tags into a single one. |
6 library polymer.src.build.script_compactor; | 6 library polymer.src.build.script_compactor; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:convert'; | 9 import 'dart:convert'; |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 /// Code generator used to create the static initialization for smoke. | 142 /// Code generator used to create the static initialization for smoke. |
143 final generator = new SmokeCodeGenerator(); | 143 final generator = new SmokeCodeGenerator(); |
144 | 144 |
145 _SubExpressionVisitor expressionVisitor; | 145 _SubExpressionVisitor expressionVisitor; |
146 | 146 |
147 _ScriptCompactor(Transform transform, options, this.resolvers) | 147 _ScriptCompactor(Transform transform, options, this.resolvers) |
148 : transform = transform, | 148 : transform = transform, |
149 options = options, | 149 options = options, |
150 logger = new BuildLogger( | 150 logger = new BuildLogger( |
151 transform, convertErrorsToWarnings: !options.releaseMode), | 151 transform, convertErrorsToWarnings: !options.releaseMode, |
| 152 detailsUri: 'http://goo.gl/5HPeuP'), |
152 docId = transform.primaryInput.id, | 153 docId = transform.primaryInput.id, |
153 bootstrapId = transform.primaryInput.id.addExtension('_bootstrap.dart'); | 154 bootstrapId = transform.primaryInput.id.addExtension('_bootstrap.dart'); |
154 | 155 |
155 Future apply() => | 156 Future apply() => |
156 _loadDocument() | 157 _loadDocument() |
157 .then(_loadEntryLibraries) | 158 .then(_loadEntryLibraries) |
158 .then(_processHtml) | 159 .then(_processHtml) |
159 .then(_emitNewEntrypoint) | 160 .then(_emitNewEntrypoint) |
160 .then((_) { | 161 .then((_) { |
161 // Write out the logs collected by our [BuildLogger]. | 162 // Write out the logs collected by our [BuildLogger]. |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 for (var c in combinators) { | 839 for (var c in combinators) { |
839 if (c is ShowElementCombinator) { | 840 if (c is ShowElementCombinator) { |
840 var show = c.shownNames.toSet(); | 841 var show = c.shownNames.toSet(); |
841 elements.retainWhere((e) => show.contains(e.displayName)); | 842 elements.retainWhere((e) => show.contains(e.displayName)); |
842 } else if (c is HideElementCombinator) { | 843 } else if (c is HideElementCombinator) { |
843 var hide = c.hiddenNames.toSet(); | 844 var hide = c.hiddenNames.toSet(); |
844 elements.removeWhere((e) => hide.contains(e.displayName)); | 845 elements.removeWhere((e) => hide.contains(e.displayName)); |
845 } | 846 } |
846 } | 847 } |
847 } | 848 } |
OLD | NEW |