| 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:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 | 10 |
| (...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1455 }); | 1455 }); |
| 1456 | 1456 |
| 1457 var dependencyOverrides = <PackageDep>[]; | 1457 var dependencyOverrides = <PackageDep>[]; |
| 1458 if (overrides != null) { | 1458 if (overrides != null) { |
| 1459 overrides.forEach((spec, constraint) { | 1459 overrides.forEach((spec, constraint) { |
| 1460 dependencyOverrides.add(parseSpec(spec).withConstraint( | 1460 dependencyOverrides.add(parseSpec(spec).withConstraint( |
| 1461 new VersionConstraint.parse(constraint))); | 1461 new VersionConstraint.parse(constraint))); |
| 1462 }); | 1462 }); |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 var pubspec = new Pubspec(id.name, id.version, dependencies, | 1465 return new Package.inMemory(new Pubspec(id.name, |
| 1466 devDependencies, dependencyOverrides, | 1466 version: id.version, |
| 1467 new PubspecEnvironment(sdkConstraint), []); | 1467 dependencies: dependencies, |
| 1468 return new Package.inMemory(pubspec); | 1468 devDependencies: devDependencies, |
| 1469 dependencyOverrides: dependencyOverrides, |
| 1470 sdkConstraint: sdkConstraint)); |
| 1469 } | 1471 } |
| 1470 | 1472 |
| 1471 /// Creates a new [PackageId] parsed from [text], which looks something like | 1473 /// Creates a new [PackageId] parsed from [text], which looks something like |
| 1472 /// this: | 1474 /// this: |
| 1473 /// | 1475 /// |
| 1474 /// foo-xyz 1.0.0 from mock | 1476 /// foo-xyz 1.0.0 from mock |
| 1475 /// | 1477 /// |
| 1476 /// The package name is "foo". A hyphenated suffix like "-xyz" here is part | 1478 /// The package name is "foo". A hyphenated suffix like "-xyz" here is part |
| 1477 /// of the package description, but not its name, so the description here is | 1479 /// of the package description, but not its name, so the description here is |
| 1478 /// "foo-xyz". | 1480 /// "foo-xyz". |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 } | 1512 } |
| 1511 | 1513 |
| 1512 var source = "mock1"; | 1514 var source = "mock1"; |
| 1513 if (match[7] != null) { | 1515 if (match[7] != null) { |
| 1514 source = match[7]; | 1516 source = match[7]; |
| 1515 if (source == "root") source = null; | 1517 if (source == "root") source = null; |
| 1516 } | 1518 } |
| 1517 | 1519 |
| 1518 return new PackageId(name, source, parsedVersion, description); | 1520 return new PackageId(name, source, parsedVersion, description); |
| 1519 } | 1521 } |
| OLD | NEW |