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

Side by Side Diff: test/descriptor/packages.dart

Issue 2184303002: Make pub strong-mode clean. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 4 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
« no previous file with comments | « test/descriptor/git.dart ('k') | test/descriptor/tar.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// Pub-specific scheduled_test descriptors. 5 /// Pub-specific scheduled_test descriptors.
6 import "dart:io" show File; 6 import "dart:io" show File;
7 import "dart:async" show Future; 7 import "dart:async" show Future;
8 import "dart:convert" show UTF8; 8 import "dart:convert" show UTF8;
9 9
10 import 'package:package_config/packages_file.dart' as packages_file; 10 import 'package:package_config/packages_file.dart' as packages_file;
(...skipping 17 matching lines...) Expand all
28 /// Describes a `.packages` file with the given dependencies. 28 /// Describes a `.packages` file with the given dependencies.
29 /// 29 ///
30 /// [dependencies] maps package names to strings describing where the packages 30 /// [dependencies] maps package names to strings describing where the packages
31 /// are located on disk. 31 /// are located on disk.
32 PackagesFileDescriptor([this._dependencies]) : super('.packages'); 32 PackagesFileDescriptor([this._dependencies]) : super('.packages');
33 33
34 Future create([String parent]) => schedule(() { 34 Future create([String parent]) => schedule(() {
35 if (parent == null) parent = defaultRoot; 35 if (parent == null) parent = defaultRoot;
36 var contents = const <int>[]; 36 var contents = const <int>[];
37 if (_dependencies != null) { 37 if (_dependencies != null) {
38 var mapping = {}; 38 var mapping = <String, Uri>{};
39 _dependencies.forEach((package, version) { 39 _dependencies.forEach((package, version) {
40 var packagePath; 40 var packagePath;
41 if (_semverRE.hasMatch(version)) { 41 if (_semverRE.hasMatch(version)) {
42 // If it's a semver, it's a cache reference. 42 // If it's a semver, it's a cache reference.
43 packagePath = p.join(cachePath, "$package-$version"); 43 packagePath = p.join(cachePath, "$package-$version");
44 } else { 44 } else {
45 // Otherwise it's a path relative to the pubspec file, 45 // Otherwise it's a path relative to the pubspec file,
46 // which is also relative to the .packages file. 46 // which is also relative to the .packages file.
47 packagePath = p.fromUri(version); 47 packagePath = p.fromUri(version);
48 } 48 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 for (var key in map.keys) { 104 for (var key in map.keys) {
105 if (!_dependencies.containsKey(key)) { 105 if (!_dependencies.containsKey(key)) {
106 fail(".packages file contains unexpected entry: $key"); 106 fail(".packages file contains unexpected entry: $key");
107 } 107 }
108 } 108 }
109 } 109 }
110 } 110 }
111 111
112 String describe() => name; 112 String describe() => name;
113 } 113 }
OLDNEW
« no previous file with comments | « test/descriptor/git.dart ('k') | test/descriptor/tar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698