Index: benchmark/lib/report.dart |
diff --git a/benchmark/lib/report.dart b/benchmark/lib/report.dart |
index aa3ec4dc86827aca5138455e0ad6e168d616f374..0eed2397a72579cc0c6bbfa8a11ca7a7227887cb 100644 |
--- a/benchmark/lib/report.dart |
+++ b/benchmark/lib/report.dart |
@@ -66,12 +66,14 @@ pb.Packages createPackages(String pubspecYaml, String pubspecLock) { |
/// Quick and dirty lock file parser. |
/// - ignores indentation |
/// - assumes one top-level key "packages:" |
-/// - assumes all other lines without a value start a new package |
-/// - only allows three known keys within a package |
+/// - assumes all other lines without a value except 'description' |
+/// start a new package |
+/// - only allows known keys within a package |
List<pb.PackageVersion> _parseLockFile(String contents) { |
var out = <pb.PackageVersion>[]; |
bool inPackages = false; |
+ bool inDescription = false; |
pb.PackageVersion pv = null; |
var lineNumber = 0; |
for (var line in contents.split("\n")) { |
@@ -99,15 +101,22 @@ List<pb.PackageVersion> _parseLockFile(String contents) { |
} |
if (value == "") { |
+ if (key == "description") { |
+ inDescription = true; |
+ continue; |
+ } |
if (pv != null) out.add(pv); |
pv = new pb.PackageVersion()..name = key; |
continue; |
} |
if (pv == null) { |
- throw "can't parse pubspec.lock at line $lineNumber"; |
+ throw "can't parse pubspec.lock at line $lineNumber - no value for $key"; |
} |
+ if (inDescription && (key == "name" || key == "url")) continue; |
+ inDescription = false; |
+ |
switch (key) { |
case "description": |
break; |
@@ -122,8 +131,10 @@ List<pb.PackageVersion> _parseLockFile(String contents) { |
break; |
case "relative": |
break; // ignore |
+ case "sdk": |
+ break; // ignore |
default: |
- throw "can't parse pubspec.lock at line $lineNumber"; |
+ throw "can't parse pubspec.lock at line $lineNumber - unknown key $key"; |
} |
} |
return out; |