| Index: utils/pub/system_cache.dart
|
| diff --git a/utils/pub/system_cache.dart b/utils/pub/system_cache.dart
|
| index 0e4822c6c37f00eda1a31c65ff7a59cc5e36d4ee..932cbbb48771c38daaad145a962a7a7e10d191c8 100644
|
| --- a/utils/pub/system_cache.dart
|
| +++ b/utils/pub/system_cache.dart
|
| @@ -6,9 +6,12 @@ library system_cache;
|
|
|
| import 'dart:io';
|
|
|
| +import 'git_source.dart';
|
| +import 'hosted_source.dart';
|
| import 'io.dart';
|
| import 'io.dart' as io show createTempDir;
|
| import 'package.dart';
|
| +import 'sdk_source.dart';
|
| import 'source.dart';
|
| import 'source_registry.dart';
|
| import 'utils.dart';
|
| @@ -46,6 +49,16 @@ class SystemCache {
|
| : _pendingInstalls = new Map<PackageId, Future<Package>>(),
|
| sources = new SourceRegistry();
|
|
|
| + /// Creates a system cache and registers the standard set of sources.
|
| + factory SystemCache.withSources(String rootDir, String sdkDir) {
|
| + var cache = new SystemCache(rootDir);
|
| + cache.register(new SdkSource(sdkDir));
|
| + cache.register(new GitSource());
|
| + cache.register(new HostedSource());
|
| + cache.sources.setDefault('hosted');
|
| + return cache;
|
| + }
|
| +
|
| /**
|
| * Registers a new source. This source must not have the same name as a source
|
| * that's already been registered.
|
|
|