OLD | NEW |
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 pub.package; | 5 library pub.package; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
| 9 import 'package:barback/barback.dart'; |
9 import 'package:path/path.dart' as p; | 10 import 'package:path/path.dart' as p; |
10 import 'package:barback/barback.dart'; | 11 import 'package:pub_semver/pub_semver.dart'; |
11 | 12 |
12 import 'barback/transformer_id.dart'; | 13 import 'barback/transformer_id.dart'; |
13 import 'io.dart'; | 14 import 'io.dart'; |
14 import 'git.dart' as git; | 15 import 'git.dart' as git; |
15 import 'pubspec.dart'; | 16 import 'pubspec.dart'; |
16 import 'source_registry.dart'; | 17 import 'source_registry.dart'; |
17 import 'utils.dart'; | 18 import 'utils.dart'; |
18 import 'version.dart'; | |
19 | 19 |
20 final _README_REGEXP = new RegExp(r"^README($|\.)", caseSensitive: false); | 20 final _README_REGEXP = new RegExp(r"^README($|\.)", caseSensitive: false); |
21 | 21 |
22 /// A named, versioned, unit of code and resource reuse. | 22 /// A named, versioned, unit of code and resource reuse. |
23 class Package { | 23 class Package { |
24 /// Compares [a] and [b] orders them by name then version number. | 24 /// Compares [a] and [b] orders them by name then version number. |
25 /// | 25 /// |
26 /// This is normally used as a [Comparator] to pass to sort. This does not | 26 /// This is normally used as a [Comparator] to pass to sort. This does not |
27 /// take a package's description or root directory into account, so multiple | 27 /// take a package's description or root directory into account, so multiple |
28 /// distinct packages may order the same. | 28 /// distinct packages may order the same. |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 380 |
381 bool operator ==(other) { | 381 bool operator ==(other) { |
382 // TODO(rnystrom): We're assuming here that we don't need to delve into the | 382 // TODO(rnystrom): We're assuming here that we don't need to delve into the |
383 // description. | 383 // description. |
384 return other is PackageDep && | 384 return other is PackageDep && |
385 other.name == name && | 385 other.name == name && |
386 other.source == source && | 386 other.source == source && |
387 other.constraint == constraint; | 387 other.constraint == constraint; |
388 } | 388 } |
389 } | 389 } |
OLD | NEW |