OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 import 'dart:io'; | 5 import 'dart:io'; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 | 7 |
8 import 'package:archive/archive.dart'; | 8 import 'package:archive/archive.dart'; |
9 import 'package:args/args.dart'; | 9 import 'package:args/args.dart'; |
10 import 'package:yaml/yaml.dart'; | 10 import 'package:yaml/yaml.dart'; |
11 | 11 |
12 const String kSnapshotKey = 'snapshot_blob.bin'; | 12 const String kSnapshotKey = 'snapshot_blob.bin'; |
13 const List<String> kDensities = const ['drawable-xxhdpi']; | 13 const List<String> kDensities = const ['drawable-xxhdpi']; |
14 const List<String> kThemes = const ['white', 'black', 'grey600']; | 14 const List<String> kThemes = const ['white', 'black']; |
15 const List<int> kSizes = const [24]; | 15 const List<int> kSizes = const [24]; |
16 | 16 |
17 class Asset { | 17 class Asset { |
18 final String base; | 18 final String base; |
19 final String key; | 19 final String key; |
20 | 20 |
21 Asset({ this.base, this.key }); | 21 Asset({ this.base, this.key }); |
22 } | 22 } |
23 | 23 |
24 Iterable<Asset> parseAssets(Map manifestDescriptor, String manifestPath) sync* { | 24 Iterable<Asset> parseAssets(Map manifestDescriptor, String manifestPath) sync* { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 for (Asset asset in assets) | 126 for (Asset asset in assets) |
127 archive.addFile(await createFile(asset.key, asset.base)); | 127 archive.addFile(await createFile(asset.key, asset.base)); |
128 | 128 |
129 for (MaterialAsset asset in materialAssets) | 129 for (MaterialAsset asset in materialAssets) |
130 archive.addFile(await createFile(asset.key, args['asset-base'])); | 130 archive.addFile(await createFile(asset.key, args['asset-base'])); |
131 | 131 |
132 File outputFile = new File(args['output-file']); | 132 File outputFile = new File(args['output-file']); |
133 await outputFile.writeAsBytes(new ZipEncoder().encode(archive)); | 133 await outputFile.writeAsBytes(new ZipEncoder().encode(archive)); |
134 } | 134 } |
OLD | NEW |