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 |
index eeed9bcee85b38f48026cd410223213e93729b87..9dc9e9f1d2815801f39e5398e25e5bbad454b42d 100644 |
--- a/sdk/lib/_internal/pub_generated/lib/src/package_graph.dart |
+++ b/sdk/lib/_internal/pub_generated/lib/src/package_graph.dart |
@@ -3,6 +3,8 @@ import 'barback/transformer_cache.dart'; |
import 'entrypoint.dart'; |
import 'lock_file.dart'; |
import 'package.dart'; |
+import 'source/cached.dart'; |
+import 'source/hosted.dart'; |
import 'utils.dart'; |
class PackageGraph { |
final Entrypoint entrypoint; |
@@ -35,4 +37,15 @@ class PackageGraph { |
} |
return _transitiveDependencies[package]; |
} |
+ bool isPackageMutable(String package) { |
+ var id = lockFile.packages[package]; |
+ if (id == null) return true; |
+ var source = entrypoint.cache.sources[id.source]; |
+ if (source is! CachedSource) return true; |
+ return transitiveDependencies(package).any((dep) { |
+ var depId = lockFile.packages[dep.name]; |
+ if (depId == null) return true; |
+ return entrypoint.cache.sources[depId.source] is! CachedSource; |
+ }); |
+ } |
} |