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

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

Issue 363543003: Don't load dependencies' useless transformers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 6 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
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/transformers_needed_by_transformers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/barback/transformer_config.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/transformer_config.dart b/sdk/lib/_internal/pub/lib/src/barback/transformer_config.dart
index 676bd8cc97d1feb57179fd42b09e191f72185c83..42ff5ba534f081f244d8b54d60bedbe56ad043ea 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/transformer_config.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/transformer_config.dart
@@ -4,6 +4,7 @@
library pub.barback.transformer_config;
+import 'package:path/path.dart' as p;
import 'package:source_maps/source_maps.dart';
import 'package:yaml/yaml.dart';
@@ -53,6 +54,14 @@ class TransformerConfig {
/// processed.
bool get hasExclusions => includes != null || excludes != null;
+ /// Returns whether this transformer might transform a file that's visible to
+ /// the package's dependers.
+ bool get canTransformPublicFiles {
+ if (includes == null) return true;
+ return includes.any((path) =>
+ p.url.isWithin('lib', path) || p.url.isWithin('bin', path));
+ }
+
/// Parses [identifier] as a [TransformerId] with [configuration].
///
/// [identifierSpan] is the source span for [identifier].
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/transformers_needed_by_transformers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698