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 /// Final phase of the polymer transformation: removes any files that are not | 5 /// Final phase of the polymer transformation: removes any files that are not |
6 /// needed for deployment. | 6 /// needed for deployment. |
7 library polymer.src.build.build_filter; | 7 library polymer.src.build.build_filter; |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 // keep any entry points | 29 // keep any entry points |
30 !options.isHtmlEntryPoint(id); | 30 !options.isHtmlEntryPoint(id); |
31 } | 31 } |
32 | 32 |
33 apply(Transform transform) { | 33 apply(Transform transform) { |
34 transform.consumePrimary(); | 34 transform.consumePrimary(); |
35 if (transform.primaryInput.id.extension == _DATA_EXTENSION) { | 35 if (transform.primaryInput.id.extension == _DATA_EXTENSION) { |
36 return null; | 36 return null; |
37 } | 37 } |
38 var logger = new BuildLogger(transform, | 38 var logger = new BuildLogger(transform, |
39 convertErrorsToWarnings: !options.releaseMode); | 39 convertErrorsToWarnings: !options.releaseMode, |
| 40 detailsUri: 'http://goo.gl/5HPeuP'); |
40 return readPrimaryAsHtml(transform, logger).then((document) { | 41 return readPrimaryAsHtml(transform, logger).then((document) { |
41 // Keep .html files that don't use polymer, since the app developer might | 42 // Keep .html files that don't use polymer, since the app developer might |
42 // have non-polymer entrypoints. | 43 // have non-polymer entrypoints. |
43 if (document.querySelectorAll('polymer-element').isEmpty) { | 44 if (document.querySelectorAll('polymer-element').isEmpty) { |
44 transform.addOutput(transform.primaryInput); | 45 transform.addOutput(transform.primaryInput); |
45 } | 46 } |
46 }); | 47 }); |
47 } | 48 } |
48 } | 49 } |
49 | 50 |
50 const String _DATA_EXTENSION = '._data'; | 51 const String _DATA_EXTENSION = '._data'; |
OLD | NEW |