Skip to content
Snippets Groups Projects
Commit ffc19203 authored by nweiz@google.com's avatar nweiz@google.com Committed by Natalie Weizenbaum
Browse files

Fix a bug where pub would fail to load a transformer.

If a transformer is defined in a dependency, used in the root package,
and restricted (via $include or $exclude) to only run on files in
test/, pub will think it's not necessary and fail to load it.

R=rnystrom@google.com

Review URL: https://codereview.chromium.org//1052353003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@44876 260f80e4-7a28-3924-810f-c04153c831b5
parent 787e9551
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,7 @@ class DependencyComputer {
return phase.expand((config) {
var id = config.id;
if (id.isBuiltInTransformer) return [];
if (id.package != _graph.entrypoint.root.name &&
if (package.name != _graph.entrypoint.root.name &&
!config.canTransformPublicFiles) {
return [];
}
......
......@@ -47,6 +47,28 @@ void main() {
expectDependencies({"myapp": []});
});
integration("does return a dependency's transformer that the root package "
"uses", () {
d.dir(appPath, [
d.pubspec({
"name": "myapp",
"dependencies": {"foo": {"path": "../foo"}},
"transformers": [{"foo": {"\$include": "test/myapp_test.dart"}}]
}),
d.dir("test", [d.file("myapp_test.dart", "")])
]).create();
d.dir("foo", [
d.pubspec({
"name": "foo",
"version": "1.0.0"
}),
d.dir("lib", [d.file("foo.dart", transformer())])
]).create();
expectDependencies({"foo": []});
});
integration("doesn't return a dependency's transformer that can run on bin",
() {
d.dir(appPath, [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment