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

Unified Diff: sdk/lib/_internal/pub/lib/src/source_registry.dart

Issue 491993002: Don't recompile dependency executables that haven't changed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/lib/src/source_registry.dart
diff --git a/sdk/lib/_internal/pub/lib/src/source_registry.dart b/sdk/lib/_internal/pub/lib/src/source_registry.dart
index ffac4f8d7d8ac0bf43ba1b94b1b5ce005e36bbcc..d46ae93ae77299674c4b8004105cf8bf41bb7bf5 100644
--- a/sdk/lib/_internal/pub/lib/src/source_registry.dart
+++ b/sdk/lib/_internal/pub/lib/src/source_registry.dart
@@ -6,6 +6,7 @@ library pub.source_registry;
import 'dart:collection';
+import 'package.dart';
import 'source.dart';
import 'source/unknown.dart';
@@ -24,6 +25,22 @@ class SourceRegistry extends IterableBase<Source> {
return sources.iterator;
}
+ /// Returns whether [id1] and [id2] refer to the same package, including
+ /// validating that their descriptions are equivalent.
+ bool idsEqual(PackageId id1, PackageId id2) {
+ if (id1 != id2) return false;
+ if (id1 == null && id2 == null) return true;
+ return idDescriptionsEqual(id1, id2);
+ }
+
+ /// Returns whether [id1] and [id2] have the same source and description.
+ ///
+ /// This doesn't check whether the name or versions are equal.
+ bool idDescriptionsEqual(PackageId id1, PackageId id2) {
+ if (id1.source != id2.source) return false;
+ return this[id1.source].descriptionsEqual(id1.description, id2.description);
+ }
+
/// Sets the default source.
///
/// This takes a string, which must be the name of a registered source.

Powered by Google App Engine
This is Rietveld 408576698