OLD | NEW |
1 library pub.lock_file; | 1 library pub.lock_file; |
2 import 'package:path/path.dart' as p; | 2 import 'package:path/path.dart' as p; |
| 3 import 'package:pub_semver/pub_semver.dart'; |
3 import 'package:source_span/source_span.dart'; | 4 import 'package:source_span/source_span.dart'; |
4 import 'package:yaml/yaml.dart'; | 5 import 'package:yaml/yaml.dart'; |
5 import 'io.dart'; | 6 import 'io.dart'; |
6 import 'package.dart'; | 7 import 'package.dart'; |
7 import 'source_registry.dart'; | 8 import 'source_registry.dart'; |
8 import 'utils.dart'; | 9 import 'utils.dart'; |
9 import 'version.dart'; | |
10 class LockFile { | 10 class LockFile { |
11 Map<String, PackageId> packages; | 11 Map<String, PackageId> packages; |
12 factory LockFile(List<PackageId> ids) { | 12 factory LockFile(List<PackageId> ids) { |
13 var lockFile = new LockFile.empty(); | 13 var lockFile = new LockFile.empty(); |
14 for (var id in ids) { | 14 for (var id in ids) { |
15 if (!id.isRoot) lockFile.packages[id.name] = id; | 15 if (!id.isRoot) lockFile.packages[id.name] = id; |
16 } | 16 } |
17 return lockFile; | 17 return lockFile; |
18 } | 18 } |
19 LockFile._(this.packages); | 19 LockFile._(this.packages); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 'description': description | 88 'description': description |
89 }; | 89 }; |
90 }); | 90 }); |
91 return """ | 91 return """ |
92 # Generated by pub | 92 # Generated by pub |
93 # See http://pub.dartlang.org/doc/glossary.html#lockfile | 93 # See http://pub.dartlang.org/doc/glossary.html#lockfile |
94 ${yamlToString({'packages' : data})} | 94 ${yamlToString({'packages' : data})} |
95 """; | 95 """; |
96 } | 96 } |
97 } | 97 } |
OLD | NEW |