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

Side by Side Diff: utils/pub/lock_file.dart

Issue 12782016: Switch pkg packages, pub, and dartdoc to use package: imports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « utils/pub/io.dart ('k') | utils/pub/oauth2.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) 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
9 import 'package:yaml/yaml.dart';
10
8 import 'io.dart'; 11 import 'io.dart';
9 import 'package.dart'; 12 import 'package.dart';
10 import 'source_registry.dart'; 13 import 'source_registry.dart';
11 import 'utils.dart'; 14 import 'utils.dart';
12 import 'version.dart'; 15 import 'version.dart';
13 import '../../pkg/yaml/lib/yaml.dart';
14 16
15 /// A parsed and validated `pubspec.lock` file. 17 /// A parsed and validated `pubspec.lock` file.
16 class LockFile { 18 class LockFile {
17 /// The packages this lockfile pins. 19 /// The packages this lockfile pins.
18 Map<String, PackageId> packages; 20 Map<String, PackageId> packages;
19 21
20 LockFile._(this.packages); 22 LockFile._(this.packages);
21 23
22 LockFile.empty() 24 LockFile.empty()
23 : packages = <String, PackageId>{}; 25 : packages = <String, PackageId>{};
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 }); 98 });
97 99
98 // TODO(nweiz): Serialize using the YAML library once it supports 100 // 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. 101 // serialization. For now, we use JSON, since it's a subset of YAML anyway.
100 return ''' 102 return '''
101 # Generated by pub. See: http://pub.dartlang.org/doc/glossary.html#lockf ile 103 # Generated by pub. See: http://pub.dartlang.org/doc/glossary.html#lockf ile
102 ${json.stringify({'packages': packagesObj})} 104 ${json.stringify({'packages': packagesObj})}
103 '''; 105 ''';
104 } 106 }
105 } 107 }
OLDNEW
« no previous file with comments | « utils/pub/io.dart ('k') | utils/pub/oauth2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698