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

Unified Diff: sdk/lib/_internal/pub/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
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 51eb18a0fcb4290a1d83dfa1e8df1616a31a3208..fbf9f80e79247540f74e8679f1da752777b7c702 100644
--- a/sdk/lib/_internal/pub/test/test_pub.dart
+++ b/sdk/lib/_internal/pub/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,11 +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";
@@ -736,7 +731,7 @@ Iterable<String> pkg, Map<String, String> hosted}) {
_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 "
"with a barback dependency within a withBarbackVersions() "
@@ -744,14 +739,14 @@ Iterable<String> pkg, Map<String, String> hosted}) {
}
if (_packageOverrides.containsKey(package)) {
- packagePath = _packageOverrides[package];
+ path = _packageOverrides[package];
} else {
- packagePath = p.join(pkgPath, package);
+ path = packagePath(package);
}
- dependencies[package] = packagePath;
+ dependencies[package] = path;
var pubspec = loadYaml(
- readTextFile(p.join(packagePath, 'pubspec.yaml')));
+ readTextFile(p.join(path, 'pubspec.yaml')));
var packageDeps = pubspec['dependencies'];
if (packageDeps == null) return;
packageDeps.keys.forEach(_addPackage);
@@ -779,6 +774,12 @@ Iterable<String> pkg, Map<String, String> hosted}) {
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/test/serve_packages.dart ('k') | sdk/lib/_internal/pub_generated/test/dependency_computer/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698