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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/transformer_cache.dart

Issue 576333002: Precompile immutable dependencies on "pub get". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes 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/lib/src/barback/transformer_cache.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/transformer_cache.dart b/sdk/lib/_internal/pub/lib/src/barback/transformer_cache.dart
index 0fe07e3eebb6856cba845e16e88b9af3faf93e61..d51e901bc36acd9e3bc4c79537a5d0b4424906c0 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/transformer_cache.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/transformer_cache.dart
@@ -64,7 +64,7 @@ class TransformerCache {
// If none of the snapshot's dependencies have changed, then we can reuse
// it.
- if (!changedPackages.any(snapshotDependencies.contains)) return;
+ if (!overlaps(changedPackages, snapshotDependencies)) return;
// Otherwise, delete it.
deleteEntry(_dir);
@@ -78,21 +78,10 @@ class TransformerCache {
/// it can safely be used to load the stage. Otherwise, a snapshot of the
/// stage should be written there.
String snapshotPath(Set<TransformerId> transformers) {
- // A transformer is considered mutable if it comes from the entrypoint
- // package or a path dependency.
- //
- // TODO(nweiz): Consider git packages with mutable (transitive) dependencies
- // to be mutable themselves.
- var usesMutableTransformer = transformers.any((id) {
- // The entrypoint package doesn't appear in the lockfile.
- var package = _graph.lockFile.packages[id.package];
- if (package == null) return true;
- var source = _graph.entrypoint.cache.sources[package.source];
- return source is! CachedSource;
- });
-
var path = p.join(_dir, "transformers.snapshot");
- if (usesMutableTransformer) {
+ if (_newTransformers != null) return path;
+
+ if (transformers.any((id) => _graph.isPackageMutable(id.package))) {
log.fine("Not caching mutable transformers.");
deleteEntry(_dir);
return null;
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/barback/load_all_transformers.dart ('k') | sdk/lib/_internal/pub/lib/src/entrypoint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698