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

Unified Diff: utils/pub/pubspec.dart

Issue 12280019: Revert "Support relative paths in path dependencies." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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/path_source.dart ('k') | utils/pub/sdk_source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/pubspec.dart
diff --git a/utils/pub/pubspec.dart b/utils/pub/pubspec.dart
index fac89ebb8b774ab24d66857c7920eb32a33826f8..779a29490dde802ead5d07764cc71451c645ca62 100644
--- a/utils/pub/pubspec.dart
+++ b/utils/pub/pubspec.dart
@@ -38,8 +38,7 @@ class Pubspec {
if (!fileExists(pubspecPath)) throw new PubspecNotFoundException(name);
try {
- var pubspec = new Pubspec.parse(pubspecPath, readTextFile(pubspecPath),
- sources);
+ var pubspec = new Pubspec.parse(readTextFile(pubspecPath), sources);
if (pubspec.name == null) {
throw new PubspecHasNoNameException(name);
@@ -70,12 +69,10 @@ class Pubspec {
bool get isEmpty =>
name == null && version == Version.none && dependencies.isEmpty;
- /// Parses the pubspec stored at [filePath] whose text is [contents]. If the
- /// pubspec doesn't define version for itself, it defaults to [Version.none].
- /// [filePath] may be `null` if the pubspec is not on the user's local
- /// file system.
- factory Pubspec.parse(String filePath, String contents,
- SourceRegistry sources) {
+ // TODO(rnystrom): Make this a static method to match corelib.
+ /// Parses the pubspec whose text is [contents]. If the pubspec doesn't define
+ /// version for itself, it defaults to [Version.none].
+ factory Pubspec.parse(String contents, SourceRegistry sources) {
var name = null;
var version = Version.none;
@@ -100,7 +97,7 @@ class Pubspec {
version = new Version.parse(parsedPubspec['version']);
}
- var dependencies = _parseDependencies(filePath, sources,
+ var dependencies = _parseDependencies(sources,
parsedPubspec['dependencies']);
var environmentYaml = parsedPubspec['environment'];
@@ -190,8 +187,7 @@ void _validateFieldUrl(url, String field) {
}
}
-List<PackageRef> _parseDependencies(String pubspecPath, SourceRegistry sources,
- yaml) {
+List<PackageRef> _parseDependencies(SourceRegistry sources, yaml) {
var dependencies = <PackageRef>[];
// Allow an empty dependencies key.
@@ -237,8 +233,7 @@ List<PackageRef> _parseDependencies(String pubspecPath, SourceRegistry sources,
'Dependency specification $spec should be a string or a mapping.');
}
- description = source.parseDescription(pubspecPath, description,
- fromLockFile: false);
+ source.validateDescription(description, fromLockFile: false);
dependencies.add(new PackageRef(
name, source, versionConstraint, description));
« no previous file with comments | « utils/pub/path_source.dart ('k') | utils/pub/sdk_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698