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

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/source/cached.dart

Issue 557563002: Store the async-await compiled pub code directly in the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/source/cached.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/source/cached.dart b/sdk/lib/_internal/pub_generated/lib/src/source/cached.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e3823ea9b03ce7f8ff41a0d9bbb86865264dfc7a
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/lib/src/source/cached.dart
@@ -0,0 +1,33 @@
+library pub.source.cached;
+import 'dart:async';
+import 'package:path/path.dart' as path;
+import '../io.dart';
+import '../package.dart';
+import '../pubspec.dart';
+import '../source.dart';
+import '../utils.dart';
+abstract class CachedSource extends Source {
+ String get systemCacheRoot => path.join(systemCache.rootDir, name);
+ Future<Pubspec> doDescribe(PackageId id) {
+ return getDirectory(id).then((packageDir) {
+ if (fileExists(path.join(packageDir, "pubspec.yaml"))) {
+ return new Pubspec.load(
+ packageDir,
+ systemCache.sources,
+ expectedName: id.name);
+ }
+ return describeUncached(id);
+ });
+ }
+ Future<Pubspec> describeUncached(PackageId id);
+ Future get(PackageId id, String symlink) {
+ return downloadToSystemCache(id).then((pkg) {
+ createPackageSymlink(id.name, pkg.dir, symlink);
+ });
+ }
+ Future<bool> isInSystemCache(PackageId id) =>
+ getDirectory(id).then(dirExists);
+ Future<Package> downloadToSystemCache(PackageId id);
+ List<Package> getCachedPackages();
+ Future<Pair<int, int>> repairCachedPackages();
+}

Powered by Google App Engine
This is Rietveld 408576698