Index: sdk/lib/_internal/pub/test/test_pub.dart |
diff --git a/sdk/lib/_internal/pub/test/test_pub.dart b/sdk/lib/_internal/pub/test/test_pub.dart |
index 2380ed31d10e97c22177401a1f972b7de5a88863..f99305fa1a47545fff19f3a798f26275a64dd249 100644 |
--- a/sdk/lib/_internal/pub/test/test_pub.dart |
+++ b/sdk/lib/_internal/pub/test/test_pub.dart |
@@ -284,6 +284,11 @@ String yaml(value) => JSON.encode(value); |
String get sandboxDir => _sandboxDir; |
String _sandboxDir; |
+/// The path to the Dart repo's packages. |
+final String pkgPath = path.absolute(path.join( |
+ path.dirname(Platform.executable), |
+ '..', '..', '..', '..', 'pkg')); |
+ |
/// The path of the package cache directory used for tests. Relative to the |
/// sandbox directory. |
final String cachePath = "cache"; |
@@ -674,10 +679,6 @@ void createLockFile(String package, {Iterable<String> sandbox, |
} |
if (pkg != null) { |
- var pkgDir = path.absolute(path.join( |
- path.dirname(Platform.executable), |
- '..', '..', '..', '..', 'pkg')); |
- |
_addPackage(String package) { |
if (dependencies.containsKey(package)) return; |
@@ -690,7 +691,7 @@ void createLockFile(String package, {Iterable<String> sandbox, |
} |
packagePath = _barbackDir; |
} else { |
- packagePath = path.join(pkgDir, package); |
+ packagePath = path.join(pkgPath, package); |
} |
dependencies[package] = packagePath; |