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

Unified Diff: sdk/lib/_internal/pub_generated/test/test_pub.dart

Issue 808713003: Remove barback from the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub_generated/test/serve_packages.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub_generated/test/test_pub.dart
diff --git a/sdk/lib/_internal/pub_generated/test/test_pub.dart b/sdk/lib/_internal/pub_generated/test/test_pub.dart
index de82952ca7ff2f01c39a88d3cff1e85e709b3f46..72ee6a04d5153e75366555ff1a5093cfb3c70e4a 100644
--- a/sdk/lib/_internal/pub_generated/test/test_pub.dart
+++ b/sdk/lib/_internal/pub_generated/test/test_pub.dart
@@ -106,13 +106,13 @@ final _barbackDeps = {
/// Populates [_barbackVersions].
Map<Version, String> _findBarbackVersions() {
var versions = {};
- var currentBarback = p.join(repoRoot, 'pkg', 'barback');
+ var currentBarback = p.join(repoRoot, 'third_party', 'pkg', 'barback');
versions[new Pubspec.load(currentBarback, new SourceRegistry()).version] =
currentBarback;
for (var dir in listDir(p.join(repoRoot, 'third_party', 'pkg'))) {
var basename = p.basename(dir);
- if (!basename.startsWith('barback')) continue;
+ if (!basename.startsWith('barback-')) continue;
versions[new Version.parse(split1(basename, '-').last)] = dir;
}
@@ -232,10 +232,6 @@ String yaml(value) => JSON.encode(value);
String get sandboxDir => _sandboxDir;
String _sandboxDir;
-/// The path to the Dart repo's packages.
-final String pkgPath =
- p.absolute(p.join(p.dirname(Platform.executable), '../../../../pkg'));
-
/// The path of the package cache directory used for tests, relative to the
/// sandbox directory.
final String cachePath = "cache";
@@ -763,7 +759,7 @@ LockFile _createLockFile({Iterable<String> sandbox, Iterable<String> pkg,
_addPackage(String package) {
if (dependencies.containsKey(package)) return;
- var packagePath;
+ var path;
if (package == 'barback' && _packageOverrides == null) {
throw new StateError(
"createLockFile() can only create a lock file "
@@ -771,13 +767,13 @@ LockFile _createLockFile({Iterable<String> sandbox, Iterable<String> pkg,
}
if (_packageOverrides.containsKey(package)) {
- packagePath = _packageOverrides[package];
+ path = _packageOverrides[package];
} else {
- packagePath = p.join(pkgPath, package);
+ path = packagePath(package);
}
- dependencies[package] = packagePath;
- var pubspec = loadYaml(readTextFile(p.join(packagePath, 'pubspec.yaml')));
+ dependencies[package] = path;
+ var pubspec = loadYaml(readTextFile(p.join(path, 'pubspec.yaml')));
var packageDeps = pubspec['dependencies'];
if (packageDeps == null) return;
packageDeps.keys.forEach(_addPackage);
@@ -805,6 +801,12 @@ LockFile _createLockFile({Iterable<String> sandbox, Iterable<String> pkg,
return lockFile;
}
+/// Returns the path to [package] within the repo.
+String packagePath(String package) =>
+ dirExists(p.join(repoRoot, 'pkg', package)) ?
+ p.join(repoRoot, 'pkg', package) :
+ p.join(repoRoot, 'third_party', 'pkg', package);
+
/// Uses [client] as the mock HTTP client for this test.
///
/// Note that this will only affect HTTP requests made via http.dart in the
« no previous file with comments | « sdk/lib/_internal/pub_generated/test/serve_packages.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698