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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 void _initBarback(Barback barback, BarbackOptions options) { | 143 void _initBarback(Barback barback, BarbackOptions options) { |
144 var assets = []; | 144 var assets = []; |
145 void addAssets(String package, String subDir) { | 145 void addAssets(String package, String subDir) { |
146 for (var filepath in _listPackageDir(package, subDir, options)) { | 146 for (var filepath in _listPackageDir(package, subDir, options)) { |
147 assets.add(new AssetId(package, filepath)); | 147 assets.add(new AssetId(package, filepath)); |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 for (var package in options.packageDirs.keys) { | 151 for (var package in options.packageDirs.keys) { |
152 // There is nothing to do in the polymer package dependencies. | 152 // There is nothing to do in the polymer package dependencies. |
153 // However: in Polymer package *itself*, we need to replace ObservableMixin | 153 // However: in Polymer package *itself*, we need to replace Observable |
154 // with ChangeNotifierMixin. | 154 // with ChangeNotifier. |
155 if (!options.transformPolymerDependencies && | 155 if (!options.transformPolymerDependencies && |
156 _polymerPackageDependencies.contains(package)) continue; | 156 _polymerPackageDependencies.contains(package)) continue; |
157 barback.updateTransformers(package, options.phases); | 157 barback.updateTransformers(package, options.phases); |
158 | 158 |
159 // Notify barback to process anything under 'lib' and 'asset'. | 159 // Notify barback to process anything under 'lib' and 'asset'. |
160 addAssets(package, 'lib'); | 160 addAssets(package, 'lib'); |
161 addAssets(package, 'asset'); | 161 addAssets(package, 'asset'); |
162 } | 162 } |
163 | 163 |
164 // In case of the current package, include also 'web'. | 164 // In case of the current package, include also 'web'. |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 Future _copyFile(String inpath, String outpath) { | 301 Future _copyFile(String inpath, String outpath) { |
302 _ensureDir(path.dirname(outpath)); | 302 _ensureDir(path.dirname(outpath)); |
303 return new File(inpath).openRead().pipe(new File(outpath).openWrite()); | 303 return new File(inpath).openRead().pipe(new File(outpath).openWrite()); |
304 } | 304 } |
305 | 305 |
306 /** Write contents of an [asset] into a file at [filepath]. */ | 306 /** Write contents of an [asset] into a file at [filepath]. */ |
307 Future _writeAsset(String filepath, Asset asset) { | 307 Future _writeAsset(String filepath, Asset asset) { |
308 _ensureDir(path.dirname(filepath)); | 308 _ensureDir(path.dirname(filepath)); |
309 return asset.read().pipe(new File(filepath).openWrite()); | 309 return asset.read().pipe(new File(filepath).openWrite()); |
310 } | 310 } |
OLD | NEW |