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 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
7 import 'package:barback/barback.dart'; | 7 import 'package:barback/barback.dart'; |
8 import 'package:path/path.dart' as p; | 8 import 'package:path/path.dart' as p; |
9 import 'package:pub_semver/pub_semver.dart'; | 9 import 'package:pub_semver/pub_semver.dart'; |
10 | 10 |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 PackageDep.magic(String name) | 475 PackageDep.magic(String name) |
476 : super.magic(name), | 476 : super.magic(name), |
477 constraint = Version.none; | 477 constraint = Version.none; |
478 | 478 |
479 String toString() { | 479 String toString() { |
480 if (isRoot) return "$name $constraint (root)"; | 480 if (isRoot) return "$name $constraint (root)"; |
481 if (isMagic) return name; | 481 if (isMagic) return name; |
482 return "$name $constraint from $source ($description)"; | 482 return "$name $constraint from $source ($description)"; |
483 } | 483 } |
484 | 484 |
485 int get hashCode => name.hashCode ^ source.hashCode; | 485 int get hashCode => name.hashCode ^ source.hashCode ^ constraint.hashCode; |
486 | 486 |
487 bool operator ==(other) { | 487 bool operator ==(other) { |
488 // TODO(rnystrom): We're assuming here that we don't need to delve into the | 488 // TODO(rnystrom): We're assuming here that we don't need to delve into the |
489 // description. | 489 // description. |
490 return other is PackageDep && | 490 return other is PackageDep && |
491 other.name == name && | 491 other.name == name && |
492 other.source == source && | 492 other.source == source && |
493 other.constraint == constraint; | 493 other.constraint == constraint; |
494 } | 494 } |
495 } | 495 } |
OLD | NEW |