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

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/barback.dart

Issue 557563002: Store the async-await compiled pub code directly in the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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_generated/lib/src/barback.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/barback.dart b/sdk/lib/_internal/pub_generated/lib/src/barback.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8e1707aa871ee04979323fdf4fbfcb8b4c4a2d84
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/lib/src/barback.dart
@@ -0,0 +1,31 @@
+library pub.barback;
+import 'package:barback/barback.dart';
+import 'package:path/path.dart' as p;
+import 'version.dart';
+final pubConstraints = {
+ "barback": new VersionConstraint.parse(">=0.13.0 <0.15.1"),
+ "source_span": new VersionConstraint.parse(">=1.0.0 <2.0.0"),
+ "stack_trace": new VersionConstraint.parse(">=0.9.1 <2.0.0")
+};
+Uri idToPackageUri(AssetId id) {
+ if (!id.path.startsWith('lib/')) {
+ throw new ArgumentError("Asset id $id doesn't identify a library.");
+ }
+ return new Uri(
+ scheme: 'package',
+ path: p.url.join(id.package, id.path.replaceFirst('lib/', '')));
+}
+AssetId packagesUrlToId(Uri url) {
+ var parts = p.url.split(url.path);
+ if (parts.isNotEmpty && parts.first == "/") parts = parts.skip(1).toList();
+ if (parts.isEmpty) return null;
+ var index = parts.indexOf("packages");
+ if (index == -1) return null;
+ if (parts.length <= index + 1) {
+ throw new FormatException(
+ 'Invalid URL path "${url.path}". Expected package name ' 'after "packages".');
+ }
+ var package = parts[index + 1];
+ var assetPath = p.url.join("lib", p.url.joinAll(parts.skip(index + 2)));
+ return new AssetId(package, assetPath);
+}

Powered by Google App Engine
This is Rietveld 408576698