| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 var map = JSON.decode(result.stdout)["packages"]; | 110 var map = JSON.decode(result.stdout)["packages"]; |
| 111 map.forEach((k, v) { map[k] = path.dirname(v); }); | 111 map.forEach((k, v) { map[k] = path.dirname(v); }); |
| 112 map[currentPackage] = '.'; | 112 map[currentPackage] = '.'; |
| 113 return map; | 113 return map; |
| 114 } | 114 } |
| 115 | 115 |
| 116 /** Internal packages used by polymer. */ | 116 /** Internal packages used by polymer. */ |
| 117 // TODO(sigmund): consider computing this list by recursively parsing | 117 // TODO(sigmund): consider computing this list by recursively parsing |
| 118 // pubspec.yaml files in the `Options.packageDirs`. | 118 // pubspec.yaml files in the `Options.packageDirs`. |
| 119 final Set<String> _polymerPackageDependencies = [ | 119 final Set<String> _polymerPackageDependencies = [ |
| 120 'analyzer', 'args', 'barback', 'browser', 'custom_element', 'html5lib', | 120 'analyzer', 'args', 'barback', 'browser', 'html5lib', |
| 121 'html_import', 'js', 'logging', 'mutation_observer', 'observe', 'path' | 121 'js', 'logging', 'mutation_observer', 'observe', 'path' |
| 122 'polymer_expressions', 'serialization', 'shadow_dom', 'source_maps', | 122 'polymer_expressions', 'serialization', 'source_maps', |
| 123 'stack_trace', 'template_binding', 'unittest', 'unmodifiable_collection', | 123 'stack_trace', 'template_binding', 'unittest', 'unmodifiable_collection', |
| 124 'yaml'].toSet(); | 124 'web_components', 'yaml'].toSet(); |
| 125 | 125 |
| 126 /** Return the relative path of each file under [subDir] in [package]. */ | 126 /** Return the relative path of each file under [subDir] in [package]. */ |
| 127 Iterable<String> _listPackageDir(String package, String subDir, | 127 Iterable<String> _listPackageDir(String package, String subDir, |
| 128 BarbackOptions options) { | 128 BarbackOptions options) { |
| 129 var packageDir = options.packageDirs[package]; | 129 var packageDir = options.packageDirs[package]; |
| 130 if (packageDir == null) return const []; | 130 if (packageDir == null) return const []; |
| 131 var dir = new Directory(path.join(packageDir, subDir)); | 131 var dir = new Directory(path.join(packageDir, subDir)); |
| 132 if (!dir.existsSync()) return const []; | 132 if (!dir.existsSync()) return const []; |
| 133 return dir.listSync(recursive: true, followLinks: options.followLinks) | 133 return dir.listSync(recursive: true, followLinks: options.followLinks) |
| 134 .where((f) => f is File) | 134 .where((f) => f is File) |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 output.write(entry.span.getLocationMessage(entry.message, | 375 output.write(entry.span.getLocationMessage(entry.message, |
| 376 useColors: useColors, | 376 useColors: useColors, |
| 377 color: levelColor)); | 377 color: levelColor)); |
| 378 } | 378 } |
| 379 return output.toString(); | 379 return output.toString(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 const String _RED_COLOR = '\u001b[31m'; | 382 const String _RED_COLOR = '\u001b[31m'; |
| 383 const String _MAGENTA_COLOR = '\u001b[35m'; | 383 const String _MAGENTA_COLOR = '\u001b[35m'; |
| 384 const String _NO_COLOR = '\u001b[0m'; | 384 const String _NO_COLOR = '\u001b[0m'; |
| OLD | NEW |