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

Unified Diff: utils/pub/source.dart

Issue 10399076: Get codebase ready for actually supporting versioning. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 8 years, 7 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
« no previous file with comments | « utils/pub/sdk_source.dart ('k') | utils/pub/system_cache.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/source.dart
diff --git a/utils/pub/source.dart b/utils/pub/source.dart
index da01f1214930d47b5c335afc66334e182f770407..85e9c99a0acb33bb83570ba6bd6d7bcaf8c09787 100644
--- a/utils/pub/source.dart
+++ b/utils/pub/source.dart
@@ -2,6 +2,16 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+#library('pub_source');
+
+#import('io.dart');
+#import('pub.dart');
+#import('utils.dart');
+
+#source('git_source.dart');
+#source('sdk_source.dart');
+#source('source_registry.dart');
+
/**
* A source from which to install packages.
*
@@ -41,15 +51,21 @@ class Source {
abstract Future<bool> install(PackageId id, String path);
/**
- * Returns the name of the package identified by [id]. By default, this is
- * just `id.fullName`, but some sources (e.g. Git) may have more complicated
- * resolution logic.
- *
- * This method should be light-weight. It doesn't need to validate that the
- * given package exists.
+ * When a [Pubspec] is parsed, it reads in the description for each
+ * dependency. It is up to the dependency's [Source] to determine how that
+ * should be interpreted. This will be called during parsing to validate that
+ * the given [description] is well-formed according to this source. It should
+ * return if the description is valid, or throw a [FormatException] if not.
+ */
+ void validateDescription(description) {}
+
+ /**
+ * Returns a human-friendly name for the package identified by [id]. This
+ * method should be light-weight. It doesn't need to validate that the given
+ * package exists.
*
* The package name should be lower-case and suitable for use in a filename.
* It may contain forward slashes.
*/
- String packageName(PackageId id) => id.fullName;
+ String packageName(PackageId id) => id.description;
}
« no previous file with comments | « utils/pub/sdk_source.dart ('k') | utils/pub/system_cache.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698