| 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 pub_upgrade_test; | 5 library pub_upgrade_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:pub/src/lock_file.dart'; | 9 import 'package:pub/src/lock_file.dart'; |
| 10 import 'package:pub/src/log.dart' as log; | 10 import 'package:pub/src/log.dart' as log; |
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 return _packages[id.description][id.version].pubspec; | 1430 return _packages[id.description][id.version].pubspec; |
| 1431 }); | 1431 }); |
| 1432 } | 1432 } |
| 1433 | 1433 |
| 1434 Future<Package> downloadToSystemCache(PackageId id) => | 1434 Future<Package> downloadToSystemCache(PackageId id) => |
| 1435 throw new UnsupportedError('Cannot download mock packages'); | 1435 throw new UnsupportedError('Cannot download mock packages'); |
| 1436 | 1436 |
| 1437 List<Package> getCachedPackages() => | 1437 List<Package> getCachedPackages() => |
| 1438 throw new UnsupportedError('Cannot get mock packages'); | 1438 throw new UnsupportedError('Cannot get mock packages'); |
| 1439 | 1439 |
| 1440 Future<Pair<int, int>> repairCachedPackages() => | 1440 Future<Pair<List<Package>, List<Package>>> repairCachedPackages() => |
| 1441 throw new UnsupportedError('Cannot repair mock packages'); | 1441 throw new UnsupportedError('Cannot repair mock packages'); |
| 1442 | 1442 |
| 1443 void addPackage(String description, Package package) { | 1443 void addPackage(String description, Package package) { |
| 1444 _packages.putIfAbsent(description, () => new Map<Version, Package>()); | 1444 _packages.putIfAbsent(description, () => new Map<Version, Package>()); |
| 1445 _packages[description][package.version] = package; | 1445 _packages[description][package.version] = package; |
| 1446 } | 1446 } |
| 1447 } | 1447 } |
| 1448 | 1448 |
| 1449 Package mockPackage(PackageId id, Map dependencyStrings, Map overrides) { | 1449 Package mockPackage(PackageId id, Map dependencyStrings, Map overrides) { |
| 1450 var sdkConstraint = null; | 1450 var sdkConstraint = null; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1532 } | 1532 } |
| 1533 | 1533 |
| 1534 var source = "mock1"; | 1534 var source = "mock1"; |
| 1535 if (match[7] != null) { | 1535 if (match[7] != null) { |
| 1536 source = match[7]; | 1536 source = match[7]; |
| 1537 if (source == "root") source = null; | 1537 if (source == "root") source = null; |
| 1538 } | 1538 } |
| 1539 | 1539 |
| 1540 return new PackageId(name, source, parsedVersion, description); | 1540 return new PackageId(name, source, parsedVersion, description); |
| 1541 } | 1541 } |
| OLD | NEW |