OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 lock_file; | 5 library lock_file; |
6 | 6 |
7 import 'dart:json' as json; | 7 import 'dart:json' as json; |
8 import 'io.dart'; | 8 import 'io.dart'; |
9 import 'package.dart'; | 9 import 'package.dart'; |
10 import 'source_registry.dart'; | 10 import 'source_registry.dart'; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 packages.forEach((name, id) { | 90 packages.forEach((name, id) { |
91 packagesObj[name] = { | 91 packagesObj[name] = { |
92 'version': id.version.toString(), | 92 'version': id.version.toString(), |
93 'source': id.source.name, | 93 'source': id.source.name, |
94 'description': id.description | 94 'description': id.description |
95 }; | 95 }; |
96 }); | 96 }); |
97 | 97 |
98 // TODO(nweiz): Serialize using the YAML library once it supports | 98 // TODO(nweiz): Serialize using the YAML library once it supports |
99 // serialization. For now, we use JSON, since it's a subset of YAML anyway. | 99 // serialization. For now, we use JSON, since it's a subset of YAML anyway. |
100 return ''' | 100 return |
101 # Generated by pub. See: http://pub.dartlang.org/doc/glossary.html#lockf
ile | 101 '# Generated by pub\n' |
102 ${json.stringify({'packages': packagesObj})} | 102 '# See http://pub.dartlang.org/doc/glossary.html#lockfile\n' |
103 '''; | 103 '\n' |
| 104 '${json.stringify({'packages': packagesObj})}\n'; |
104 } | 105 } |
105 } | 106 } |
OLD | NEW |