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