| 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 /** | 5 /** |
| 6 * Definitions used to run the polymer linter and deploy tools without using | 6 * Definitions used to run the polymer linter and deploy tools without using |
| 7 * pub serve or pub deploy. | 7 * pub serve or pub deploy. |
| 8 */ | 8 */ |
| 9 library polymer.src.build.runner; | 9 library polymer.src.build.runner; |
| 10 | 10 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 var map = JSON.decode(result.stdout)["packages"]; | 103 var map = JSON.decode(result.stdout)["packages"]; |
| 104 map.forEach((k, v) { map[k] = path.dirname(v); }); | 104 map.forEach((k, v) { map[k] = path.dirname(v); }); |
| 105 map[currentPackage] = '.'; | 105 map[currentPackage] = '.'; |
| 106 return map; | 106 return map; |
| 107 } | 107 } |
| 108 | 108 |
| 109 /** Internal packages used by polymer. */ | 109 /** Internal packages used by polymer. */ |
| 110 // TODO(sigmund): consider computing this list by recursively parsing | 110 // TODO(sigmund): consider computing this list by recursively parsing |
| 111 // pubspec.yaml files in the `Options.packageDirs`. | 111 // pubspec.yaml files in the `Options.packageDirs`. |
| 112 final Set<String> _polymerPackageDependencies = [ | 112 final Set<String> _polymerPackageDependencies = [ |
| 113 'analyzer', 'args', 'barback', 'browser', 'csslib', | 113 'analyzer', 'args', 'barback', 'browser', 'custom_element', 'html5lib', |
| 114 'custom_element', 'fancy_syntax', 'html5lib', 'html_import', 'js', | 114 'html_import', 'js', 'logging', 'mutation_observer', 'observe', 'path' |
| 115 'logging', 'meta', 'mutation_observer', 'observe', 'path' | |
| 116 'polymer_expressions', 'serialization', 'shadow_dom', 'source_maps', | 115 'polymer_expressions', 'serialization', 'shadow_dom', 'source_maps', |
| 117 'stack_trace', 'template_binding', 'unittest', 'unmodifiable_collection', | 116 'stack_trace', 'template_binding', 'unittest', 'unmodifiable_collection', |
| 118 'yaml'].toSet(); | 117 'yaml'].toSet(); |
| 119 | 118 |
| 120 /** Return the relative path of each file under [subDir] in [package]. */ | 119 /** Return the relative path of each file under [subDir] in [package]. */ |
| 121 Iterable<String> _listPackageDir(String package, String subDir, | 120 Iterable<String> _listPackageDir(String package, String subDir, |
| 122 BarbackOptions options) { | 121 BarbackOptions options) { |
| 123 var packageDir = options.packageDirs[package]; | 122 var packageDir = options.packageDirs[package]; |
| 124 if (packageDir == null) return const []; | 123 if (packageDir == null) return const []; |
| 125 var dir = new Directory(path.join(packageDir, subDir)); | 124 var dir = new Directory(path.join(packageDir, subDir)); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 output.write(entry.span.getLocationMessage(entry.message, | 368 output.write(entry.span.getLocationMessage(entry.message, |
| 370 useColors: useColors, | 369 useColors: useColors, |
| 371 color: levelColor)); | 370 color: levelColor)); |
| 372 } | 371 } |
| 373 return output.toString(); | 372 return output.toString(); |
| 374 } | 373 } |
| 375 | 374 |
| 376 const String _RED_COLOR = '\u001b[31m'; | 375 const String _RED_COLOR = '\u001b[31m'; |
| 377 const String _MAGENTA_COLOR = '\u001b[35m'; | 376 const String _MAGENTA_COLOR = '\u001b[35m'; |
| 378 const String _NO_COLOR = '\u001b[0m'; | 377 const String _NO_COLOR = '\u001b[0m'; |
| OLD | NEW |