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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/lock_file.dart

Issue 602253002: Use pub_semver package in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
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 pub.lock_file; 5 library pub.lock_file;
6 6
7 import 'package:path/path.dart' as p; 7 import 'package:path/path.dart' as p;
8 import 'package:pub_semver/pub_semver.dart';
8 import 'package:source_span/source_span.dart'; 9 import 'package:source_span/source_span.dart';
9 import 'package:yaml/yaml.dart'; 10 import 'package:yaml/yaml.dart';
10 11
11 import 'io.dart'; 12 import 'io.dart';
12 import 'package.dart'; 13 import 'package.dart';
13 import 'source_registry.dart'; 14 import 'source_registry.dart';
14 import 'utils.dart'; 15 import 'utils.dart';
15 import 'version.dart';
16 16
17 /// A parsed and validated `pubspec.lock` file. 17 /// A parsed and validated `pubspec.lock` file.
18 class LockFile { 18 class LockFile {
19 /// The packages this lockfile pins. 19 /// The packages this lockfile pins.
20 Map<String, PackageId> packages; 20 Map<String, PackageId> packages;
21 21
22 /// Creates a new lockfile containing [ids]. 22 /// Creates a new lockfile containing [ids].
23 factory LockFile(List<PackageId> ids) { 23 factory LockFile(List<PackageId> ids) {
24 var lockFile = new LockFile.empty(); 24 var lockFile = new LockFile.empty();
25 for (var id in ids) { 25 for (var id in ids) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 }; 127 };
128 }); 128 });
129 129
130 return """ 130 return """
131 # Generated by pub 131 # Generated by pub
132 # See http://pub.dartlang.org/doc/glossary.html#lockfile 132 # See http://pub.dartlang.org/doc/glossary.html#lockfile
133 ${yamlToString({'packages': data})} 133 ${yamlToString({'packages': data})}
134 """; 134 """;
135 } 135 }
136 } 136 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/global_packages.dart ('k') | sdk/lib/_internal/pub/lib/src/package.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698