| Index: utils/pub/system_cache.dart
|
| diff --git a/utils/pub/system_cache.dart b/utils/pub/system_cache.dart
|
| index ce913e0958968802e6ede6add45fc4d50e965150..abd23482441d3e8634b0c7e76bc8385ef036ecd1 100644
|
| --- a/utils/pub/system_cache.dart
|
| +++ b/utils/pub/system_cache.dart
|
| @@ -18,34 +18,25 @@ import 'source_registry.dart';
|
| import 'utils.dart';
|
| import 'version.dart';
|
|
|
| -/**
|
| - * The system-wide cache of installed packages.
|
| - *
|
| - * This cache contains all packages that are downloaded from the internet.
|
| - * Packages that are available locally (e.g. from the SDK) don't use this cache.
|
| - */
|
| +/// The system-wide cache of installed packages.
|
| +///
|
| +/// This cache contains all packages that are downloaded from the internet.
|
| +/// Packages that are available locally (e.g. from the SDK) don't use this
|
| +/// cache.
|
| class SystemCache {
|
| - /**
|
| - * The root directory where this package cache is located.
|
| - */
|
| + /// The root directory where this package cache is located.
|
| final String rootDir;
|
|
|
| String get tempDir => join(rootDir, '_temp');
|
|
|
| - /**
|
| - * Packages which are currently being asynchronously installed to the cache.
|
| - */
|
| + /// Packages which are currently being asynchronously installed to the cache.
|
| final Map<PackageId, Future<Package>> _pendingInstalls;
|
|
|
| - /**
|
| - * The sources from which to install packages.
|
| - */
|
| + /// The sources from which to install packages.
|
| final SourceRegistry sources;
|
|
|
| - /**
|
| - * Creates a new package cache which is backed by the given directory on the
|
| - * user's file system.
|
| - */
|
| + /// Creates a new package cache which is backed by the given directory on the
|
| + /// user's file system.
|
| SystemCache(this.rootDir)
|
| : _pendingInstalls = new Map<PackageId, Future<Package>>(),
|
| sources = new SourceRegistry();
|
| @@ -60,22 +51,18 @@ class SystemCache {
|
| return cache;
|
| }
|
|
|
| - /**
|
| - * Registers a new source. This source must not have the same name as a source
|
| - * that's already been registered.
|
| - */
|
| + /// Registers a new source. This source must not have the same name as a
|
| + /// source that's already been registered.
|
| void register(Source source) {
|
| source.bind(this);
|
| sources.register(source);
|
| }
|
|
|
| - /**
|
| - * Ensures that the package identified by [id] is installed to the cache,
|
| - * loads it, and returns it.
|
| - *
|
| - * It is an error to try installing a package from a source with `shouldCache
|
| - * == false` to the system cache.
|
| - */
|
| + /// Ensures that the package identified by [id] is installed to the cache,
|
| + /// loads it, and returns it.
|
| + ///
|
| + /// It is an error to try installing a package from a source with `shouldCache
|
| + /// == false` to the system cache.
|
| Future<Package> install(PackageId id) {
|
| if (!id.source.shouldCache) {
|
| throw new ArgumentError("Package $id is not cacheable.");
|
|
|