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

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/package_graph.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/package_graph.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/package_graph.dart b/sdk/lib/_internal/pub_generated/lib/src/package_graph.dart
new file mode 100644
index 0000000000000000000000000000000000000000..26326c82757b95b3a754db064bec8f1a6dc6bb40
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/lib/src/package_graph.dart
@@ -0,0 +1,25 @@
+library pub.package_graph;
+import 'entrypoint.dart';
+import 'lock_file.dart';
+import 'package.dart';
+import 'utils.dart';
+class PackageGraph {
+ final Entrypoint entrypoint;
+ final LockFile lockFile;
+ final Map<String, Package> packages;
+ Map<String, Set<Package>> _transitiveDependencies;
+ PackageGraph(this.entrypoint, this.lockFile, this.packages);
+ Set<Package> transitiveDependencies(String package) {
+ if (package == entrypoint.root.name) return packages.values.toSet();
+ if (_transitiveDependencies == null) {
+ var closure = transitiveClosure(
+ mapMap(
+ packages,
+ value: (_, package) => package.dependencies.map((dep) => dep.name)));
+ _transitiveDependencies = mapMap(
+ closure,
+ value: (_, names) => names.map((name) => packages[name]).toSet());
+ }
+ return _transitiveDependencies[package];
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698