Chromium Code Reviews| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 var map = JSON.decode(result.stdout)["packages"]; | 97 var map = JSON.decode(result.stdout)["packages"]; |
| 98 map.forEach((k, v) { map[k] = path.dirname(v); }); | 98 map.forEach((k, v) { map[k] = path.dirname(v); }); |
| 99 map[currentPackage] = '.'; | 99 map[currentPackage] = '.'; |
| 100 return map; | 100 return map; |
| 101 } | 101 } |
| 102 | 102 |
| 103 /** Internal packages used by polymer. */ | 103 /** Internal packages used by polymer. */ |
| 104 // TODO(sigmund): consider computing this list by recursively parsing | 104 // TODO(sigmund): consider computing this list by recursively parsing |
| 105 // pubspec.yaml files in the `Options.packageDirs`. | 105 // pubspec.yaml files in the `Options.packageDirs`. |
| 106 final Set<String> _polymerPackageDependencies = [ | 106 final Set<String> _polymerPackageDependencies = [ |
| 107 'analyzer', 'args', 'barback', 'browser', 'csslib', | 107 'analyzer', 'args', 'barback', 'browser', 'custom_element', 'fancy_syntax', |
|
Jennifer Messerly
2013/11/07 04:11:54
remove fancy_syntax too?
| |
| 108 'custom_element', 'fancy_syntax', 'html5lib', 'html_import', 'js', | 108 'html5lib', 'html_import', 'js', 'logging', 'meta', 'mutation_observer', |
|
Jennifer Messerly
2013/11/07 04:11:54
and meta
| |
| 109 'logging', 'meta', 'mutation_observer', 'observe', 'path' | 109 'observe', 'path', 'polymer_expressions', 'serialization', 'shadow_dom', |
| 110 'polymer_expressions', 'serialization', 'shadow_dom', 'source_maps', | 110 'source_maps', 'stack_trace', 'template_binding', 'unittest', |
| 111 'stack_trace', 'template_binding', 'unittest', 'unmodifiable_collection', | 111 'unmodifiable_collection', 'yaml'].toSet(); |
| 112 'yaml'].toSet(); | |
| 113 | 112 |
| 114 /** Return the relative path of each file under [subDir] in [package]. */ | 113 /** Return the relative path of each file under [subDir] in [package]. */ |
| 115 Iterable<String> _listPackageDir(String package, String subDir, | 114 Iterable<String> _listPackageDir(String package, String subDir, |
| 116 BarbackOptions options) { | 115 BarbackOptions options) { |
| 117 var packageDir = options.packageDirs[package]; | 116 var packageDir = options.packageDirs[package]; |
| 118 if (packageDir == null) return const []; | 117 if (packageDir == null) return const []; |
| 119 var dir = new Directory(path.join(packageDir, subDir)); | 118 var dir = new Directory(path.join(packageDir, subDir)); |
| 120 if (!dir.existsSync()) return const []; | 119 if (!dir.existsSync()) return const []; |
| 121 return dir.listSync(recursive: true, followLinks: false) | 120 return dir.listSync(recursive: true, followLinks: false) |
| 122 .where((f) => f is File) | 121 .where((f) => f is File) |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 Future _copyFile(String inpath, String outpath) { | 303 Future _copyFile(String inpath, String outpath) { |
| 305 _ensureDir(path.dirname(outpath)); | 304 _ensureDir(path.dirname(outpath)); |
| 306 return new File(inpath).openRead().pipe(new File(outpath).openWrite()); | 305 return new File(inpath).openRead().pipe(new File(outpath).openWrite()); |
| 307 } | 306 } |
| 308 | 307 |
| 309 /** Write contents of an [asset] into a file at [filepath]. */ | 308 /** Write contents of an [asset] into a file at [filepath]. */ |
| 310 Future _writeAsset(String filepath, Asset asset) { | 309 Future _writeAsset(String filepath, Asset asset) { |
| 311 _ensureDir(path.dirname(filepath)); | 310 _ensureDir(path.dirname(filepath)); |
| 312 return asset.read().pipe(new File(filepath).openWrite()); | 311 return asset.read().pipe(new File(filepath).openWrite()); |
| 313 } | 312 } |
| OLD | NEW |