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

Side by Side Diff: utils/pub/source.dart

Issue 11363249: Fix error reporting on invalid command line args. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/pub/version_solver.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library source; 5 library source;
6 6
7 import 'io.dart'; 7 import 'io.dart';
8 import 'package.dart'; 8 import 'package.dart';
9 import 'pubspec.dart'; 9 import 'pubspec.dart';
10 import 'system_cache.dart'; 10 import 'system_cache.dart';
11 import 'version.dart'; 11 import 'version.dart';
12 12
13 /** 13 /**
14 * A source from which to install packages. 14 * A source from which to install packages.
15 * 15 *
16 * Each source has many packages that it looks up using [PackageId]s. The source 16 * Each source has many packages that it looks up using [PackageId]s. The source
17 * is responsible for installing these packages to the package cache. 17 * is responsible for installing these packages to the package cache.
18 */ 18 */
19 abstract class Source { 19 abstract class Source {
20 /** 20 /**
21 * The name of the source. Should be lower-case, suitable for use in a 21 * The name of the source. Should be lower-case, suitable for use in a
22 * filename, and unique accross all sources. 22 * filename, and unique accross all sources.
23 */ 23 */
24 abstract String get name; 24 String get name;
25 25
26 /// Whether or not this source is the default source. 26 /// Whether or not this source is the default source.
27 bool get isDefault => systemCache.sources.defaultSource == this; 27 bool get isDefault => systemCache.sources.defaultSource == this;
28 28
29 /** 29 /**
30 * Whether this source's packages should be cached in Pub's global cache 30 * Whether this source's packages should be cached in Pub's global cache
31 * directory. 31 * directory.
32 * 32 *
33 * A source should be cached if it requires network access to retrieve 33 * A source should be cached if it requires network access to retrieve
34 * packages. It doesn't need to be cached if all packages are available 34 * packages. It doesn't need to be cached if all packages are available
35 * locally. 35 * locally.
36 */ 36 */
37 abstract bool get shouldCache; 37 bool get shouldCache;
38 38
39 /** 39 /**
40 * The system cache with which this source is registered. 40 * The system cache with which this source is registered.
41 */ 41 */
42 SystemCache get systemCache { 42 SystemCache get systemCache {
43 assert(_systemCache != null); 43 assert(_systemCache != null);
44 return _systemCache; 44 return _systemCache;
45 } 45 }
46 46
47 /** 47 /**
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 * to JSON and YAML. It must also be equal to [id] according to 189 * to JSON and YAML. It must also be equal to [id] according to
190 * [descriptionsEqual]. 190 * [descriptionsEqual].
191 * 191 *
192 * By default, this just returns [id]. 192 * By default, this just returns [id].
193 */ 193 */
194 Future<PackageId> resolveId(PackageId id) => new Future.immediate(id); 194 Future<PackageId> resolveId(PackageId id) => new Future.immediate(id);
195 195
196 /// Returns the source's name. 196 /// Returns the source's name.
197 String toString() => name; 197 String toString() => name;
198 } 198 }
OLDNEW
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/pub/version_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698