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

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/package.dart

Issue 887223007: Revert "Use native async/await support in pub." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months 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_generated/lib/src/package.dart
diff --git a/sdk/lib/_internal/pub/lib/src/package.dart b/sdk/lib/_internal/pub_generated/lib/src/package.dart
similarity index 91%
copy from sdk/lib/_internal/pub/lib/src/package.dart
copy to sdk/lib/_internal/pub_generated/lib/src/package.dart
index d59a0945fff1622cb040359f6dd40c7b423f27c1..e454d4b0b558373d6caff54a14865502bb16af09 100644
--- a/sdk/lib/_internal/pub/lib/src/package.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/package.dart
@@ -80,11 +80,14 @@ class Package {
/// Returns a list of asset ids for all Dart executables in this package's bin
/// directory.
List<AssetId> get executableIds {
- return ordered(listFiles(beneath: "bin", recursive: false))
- .where((executable) => p.extension(executable) == '.dart')
- .map((executable) {
+ return ordered(
+ listFiles(
+ beneath: "bin",
+ recursive: false)).where(
+ (executable) => p.extension(executable) == '.dart').map((executable) {
return new AssetId(
- name, p.toUri(p.relative(executable, from: dir)).toString());
+ name,
+ p.toUri(p.relative(executable, from: dir)).toString());
}).toList();
}
@@ -95,8 +98,9 @@ class Package {
/// pub.dartlang.org for choosing the primary one: the README with the fewest
/// extensions that is lexically ordered first is chosen.
String get readmePath {
- var readmes = listFiles(recursive: false).map(p.basename).
- where((entry) => entry.contains(_README_REGEXP));
+ var readmes = listFiles(
+ recursive: false).map(
+ p.basename).where((entry) => entry.contains(_README_REGEXP));
if (readmes.isEmpty) return null;
return p.join(dir, readmes.reduce((readme1, readme2) {
@@ -121,7 +125,7 @@ class Package {
///
/// The package will have no directory associated with it.
Package.inMemory(this.pubspec)
- : dir = null;
+ : dir = null;
/// Creates a package with [pubspec] located at [dir].
Package(this.pubspec, this.dir);
@@ -133,10 +137,10 @@ class Package {
/// [dir]. For example, a [CachedPackage]'s `lib` directory is in the
/// `.pub/deps` directory.
String path(String part1, [String part2, String part3, String part4,
- String part5, String part6, String part7]) {
+ String part5, String part6, String part7]) {
if (dir == null) {
- throw new StateError("Package $name is in-memory and doesn't have paths "
- "on disk.");
+ throw new StateError(
+ "Package $name is in-memory and doesn't have paths " "on disk.");
}
return p.join(dir, part1, part2, part3, part4, part5, part6, part7);
}
@@ -145,8 +149,8 @@ class Package {
/// [path] or [listFiles]), returns it relative to the package root.
String relative(String path) {
if (dir == null) {
- throw new StateError("Package $name is in-memory and doesn't have paths "
- "on disk.");
+ throw new StateError(
+ "Package $name is in-memory and doesn't have paths " "on disk.");
}
return p.relative(path, from: dir);
}
@@ -212,8 +216,7 @@ class Package {
// List all files that aren't gitignored, including those not checked in
// to Git.
files = git.runSync(
- ["ls-files", "--cached", "--others", "--exclude-standard",
- relativeBeneath],
+ ["ls-files", "--cached", "--others", "--exclude-standard", relativeBeneath],
workingDir: dir);
// If we're not listing recursively, strip out paths that contain
@@ -222,8 +225,8 @@ class Package {
if (!recursive) {
// If we're listing a subdirectory, we only want to look for slashes
// after the subdirectory prefix.
- var relativeStart = relativeBeneath == '.' ? 0 :
- relativeBeneath.length + 1;
+ var relativeStart =
+ relativeBeneath == '.' ? 0 : relativeBeneath.length + 1;
files = files.where((file) => !file.contains('/', relativeStart));
}
@@ -238,7 +241,10 @@ class Package {
return fileExists(file);
});
} else {
- files = listDir(beneath, recursive: recursive, includeDirs: false,
+ files = listDir(
+ beneath,
+ recursive: recursive,
+ includeDirs: false,
whitelist: _WHITELISTED_FILES);
}
@@ -303,11 +309,11 @@ class _PackageName {
/// Returns a [PackageId] for this package with the given concrete version.
PackageId atVersion(Version version) =>
- new PackageId(name, source, version, description);
+ new PackageId(name, source, version, description);
/// Returns a [PackageDep] for this package with the given version constraint.
PackageDep withConstraint(VersionConstraint constraint) =>
- new PackageDep(name, source, constraint, description);
+ new PackageDep(name, source, constraint, description);
}
/// A reference to a [Package], but not any particular version(s) of it.
@@ -320,9 +326,7 @@ class PackageRef extends _PackageName {
bool operator ==(other) {
// TODO(rnystrom): We're assuming here that we don't need to delve into the
// description.
- return other is PackageRef &&
- other.name == name &&
- other.source == source;
+ return other is PackageRef && other.name == name && other.source == source;
}
}
@@ -352,9 +356,9 @@ class PackageId extends _PackageName {
// TODO(rnystrom): We're assuming here that we don't need to delve into the
// description.
return other is PackageId &&
- other.name == name &&
- other.source == source &&
- other.version == version;
+ other.name == name &&
+ other.source == source &&
+ other.version == version;
}
String toString() {
@@ -382,8 +386,8 @@ class PackageDep extends _PackageName {
// TODO(rnystrom): We're assuming here that we don't need to delve into the
// description.
return other is PackageDep &&
- other.name == name &&
- other.source == source &&
- other.constraint == constraint;
+ other.name == name &&
+ other.source == source &&
+ other.constraint == constraint;
}
}
« no previous file with comments | « sdk/lib/_internal/pub_generated/lib/src/oauth2.dart ('k') | sdk/lib/_internal/pub_generated/lib/src/package_graph.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698