Chromium Code Reviews| Index: pkg/polymer/lib/src/build/runner.dart |
| diff --git a/pkg/polymer/lib/src/build/runner.dart b/pkg/polymer/lib/src/build/runner.dart |
| index 3596e923b440365a16655b2b2b44b4803fc339fc..ca05ae809f4cbb097fbd09878a7ca689509ae7f3 100644 |
| --- a/pkg/polymer/lib/src/build/runner.dart |
| +++ b/pkg/polymer/lib/src/build/runner.dart |
| @@ -197,8 +197,8 @@ Future _emitAllFiles(Barback barback, BarbackOptions options) { |
| // Delete existing output folder before we generate anything |
| var dir = new Directory(options.outDir); |
| if (dir.existsSync()) dir.deleteSync(recursive: true); |
| - return _emitPackagesDir(options) |
| - .then((_) => _emitTransformedFiles(assets, options)) |
| + _emitPackagesDir(options); |
| + return _emitTransformedFiles(assets, options) |
| .then((_) => _addPackagesSymlinks(assets, options)) |
| .then((_) => assets); |
| }); |
| @@ -265,22 +265,20 @@ Future _addPackagesSymlinks(AssetSet assets, BarbackOptions options) { |
| * Emits a 'packages' directory directly under `out/packages` with the contents |
| * of every file that was not transformed by barback. |
| */ |
| -Future _emitPackagesDir(BarbackOptions options) { |
| - if (options.transformPolymerDependencies) return new Future.value(null); |
| +void _emitPackagesDir(BarbackOptions options) { |
| + if (options.transformPolymerDependencies) return; |
| var outPackages = path.join(options.outDir, 'packages'); |
| _ensureDir(outPackages); |
| // Copy all the files we didn't process |
| - var futures = []; |
| var dirs = options.packageDirs; |
| for (var package in _polymerPackageDependencies) { |
| for (var relpath in _listPackageDir(package, 'lib', options)) { |
| var inpath = path.join(dirs[package], relpath); |
| var outpath = path.join(outPackages, package, relpath.substring(4)); |
| - futures.add(_copyFile(inpath, outpath)); |
|
kevmoo-old
2013/10/05 04:23:12
Could this be the problem? We're adding a bunch of
Jennifer Messerly
2013/10/05 05:23:26
Sure, but then you're running them all serially. H
Søren Gjesse
2013/10/07 06:40:27
With async primitives you have the ability to easi
|
| + _copyFileSync(inpath, outpath); |
| } |
| } |
| - return Future.wait(futures); |
| } |
| /** Ensure [dirpath] exists. */ |
| @@ -299,11 +297,9 @@ String _firstDir(String url) { |
| } |
| /** Copy a file from [inpath] to [outpath]. */ |
| -Future _copyFile(String inpath, String outpath) { |
| +void _copyFileSync(String inpath, String outpath) { |
| _ensureDir(path.dirname(outpath)); |
| - var writer = new File(outpath).openWrite(); |
| - return writer.addStream(new File(inpath).openRead()) |
| - .then((_) => writer.close()); |
| + new File(outpath).writeAsBytesSync(new File(inpath).readAsBytesSync()); |
| } |
| /** Write contents of an [asset] into a file at [filepath]. */ |