Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: test/transformer/aggregate_many_to_one.dart

Issue 1947773002: Fix all strong-mode warnings. (Closed) Base URL: git@github.com:dart-lang/barback@master
Patch Set: Code review changes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pubspec.yaml ('k') | test/transformer/declaring_check_content_and_rename.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library barback.test.transformer.aggregate_many_to_one; 5 library barback.test.transformer.aggregate_many_to_one;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 14 matching lines...) Expand all
25 /// well. 25 /// well.
26 final String output; 26 final String output;
27 27
28 AggregateManyToOneTransformer(this.extension, this.output); 28 AggregateManyToOneTransformer(this.extension, this.output);
29 29
30 String doClassifyPrimary(AssetId id) { 30 String doClassifyPrimary(AssetId id) {
31 if (id.extension != ".$extension") return null; 31 if (id.extension != ".$extension") return null;
32 return path.url.dirname(id.path); 32 return path.url.dirname(id.path);
33 } 33 }
34 34
35 Future doApply(AggregateTransform transform) { 35 Future doApply(AggregateTransform transform) async {
36 return getPrimaryInputs(transform).toList().then((assets) { 36 var assets = await getPrimaryInputs(transform).toList();
37 assets.sort((asset1, asset2) => asset1.id.path.compareTo(asset2.id.path)); 37 assets.sort((asset1, asset2) => asset1.id.path.compareTo(asset2.id.path));
38 return Future.wait(assets.map((asset) => asset.readAsString())); 38 var contents = await Future.wait(
39 }).then((contents) { 39 assets.map((asset) => asset.readAsString()));
40 var id = new AssetId(transform.package, 40 var id = new AssetId(transform.package,
41 path.url.join(transform.key, output)); 41 path.url.join(transform.key, output));
42 transform.addOutput(new Asset.fromString(id, contents.join('\n'))); 42 transform.addOutput(new Asset.fromString(id, contents.join('\n')));
43 });
44 } 43 }
45 44
46 String toString() => "aggregate $extension->$output"; 45 String toString() => "aggregate $extension->$output";
47 } 46 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | test/transformer/declaring_check_content_and_rename.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698