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

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

Issue 113143005: Don't try to get dart2js inputs from barback for directories that aren't public. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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/test/transformer/dart2js/reads_nonpublic_files_from_disk_test.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/dart2js_transformer.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
index f21ed9e4a638b17ee3f3e6c0ee5dca64ff0f239c..9bb302236adc8bf250137995464d5f219c5947c2 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
@@ -261,6 +261,7 @@ class _BarbackCompilerProvider implements dart.CompilerProvider {
Future<String> _readResource(Uri url) {
// See if the path is within a package. If so, use Barback so we can use
// generated Dart assets.
+
var id = _sourceUrlToId(url);
if (id != null) return _transform.readInputAsString(id);
@@ -276,11 +277,16 @@ class _BarbackCompilerProvider implements dart.CompilerProvider {
var id = specialUrlToId(url);
if (id != null) return id;
- // See if it's a path within the root package.
+ // See if it's a path to a "public" asset within the root package. All
+ // other files in the root package are not visible to transformers, so
+ // should be loaded directly from disk.
var rootDir = _graph.entrypoint.root.dir;
var sourcePath = path.fromUri(url);
- if (isBeneath(sourcePath, rootDir)) {
+ if (isBeneath(sourcePath, path.join(rootDir, "lib")) ||
+ isBeneath(sourcePath, path.join(rootDir, "asset")) ||
+ isBeneath(sourcePath, path.join(rootDir, "web"))) {
var relative = path.relative(sourcePath, from: rootDir);
+
return new AssetId(_graph.entrypoint.root.name, relative);
}
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/transformer/dart2js/reads_nonpublic_files_from_disk_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698