Chromium Code Reviews| Index: sdk/lib/_internal/pub/lib/src/barback/sources.dart |
| diff --git a/sdk/lib/_internal/pub/lib/src/barback/sources.dart b/sdk/lib/_internal/pub/lib/src/barback/sources.dart |
| index ece690b52d18da8e32391cc7ffa6bc950dff36d2..631b54d52491ff3f4813d922b02baf94aed040ed 100644 |
| --- a/sdk/lib/_internal/pub/lib/src/barback/sources.dart |
| +++ b/sdk/lib/_internal/pub/lib/src/barback/sources.dart |
| @@ -50,6 +50,16 @@ Future watchSources(PackageGraph graph, Barback barback, |
| var parts = path.split(event.path); |
| if (parts.contains("packages") || parts.contains("assets")) return; |
| + // Skip ".js" files that were (most likely) compiled from nearby ".dart" |
| + // files. These are created by the Editor's "Run as JavaScript" command |
| + // and are written directly into the package's directory. When pub's |
| + // dart2js transformer then tries to create the same file name, we get |
| + // a build error. To avoid that, just don't consider that file to be a |
| + // source. |
| + // TODO(rnystrom): Remove this when the Editor no longer generates .js |
| + // files. |
|
nweiz
2014/01/06 23:48:22
Refer to issue 15859 here and below.
Bob Nystrom
2014/01/08 01:44:18
Done.
|
| + if (event.path.endsWith(".dart.js")) return; |
| + |
| var id = new AssetId(package.name, |
| path.relative(event.path, from: package.dir)); |
| if (event.type == ChangeType.REMOVE) { |
| @@ -90,6 +100,16 @@ List<AssetId> _listAssets(Entrypoint entrypoint, Package package) { |
| // Skip directories. |
| if (!fileExists(entry)) continue; |
| + // Skip ".js" files that were (most likely) compiled from nearby ".dart" |
| + // files. These are created by the Editor's "Run as JavaScript" command |
| + // and are written directly into the package's directory. When pub's |
| + // dart2js transformer then tries to create the same file name, we get |
| + // a build error. To avoid that, just don't consider that file to be a |
| + // source. |
| + // TODO(rnystrom): Remove this when the Editor no longer generates .js |
| + // files. |
| + if (entry.endsWith(".dart.js")) continue; |
| + |
| var id = new AssetId(package.name, |
| path.relative(entry, from: package.dir)); |
| files.add(id); |