OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library pub_tests; | 5 library pub_tests; |
6 | 6 |
7 import '../descriptor.dart' as d; | 7 import '../descriptor.dart' as d; |
8 import '../test_pub.dart'; | 8 import '../test_pub.dart'; |
9 import 'utils.dart'; | 9 import 'utils.dart'; |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 | 29 |
30 Future declareOutputs(DeclaringTransform transform) { | 30 Future declareOutputs(DeclaringTransform transform) { |
31 transform.declareOutput(transform.primaryId.changeExtension(".final")); | 31 transform.declareOutput(transform.primaryId.changeExtension(".final")); |
32 return new Future.value(); | 32 return new Future.value(); |
33 } | 33 } |
34 } | 34 } |
35 """; | 35 """; |
36 | 36 |
37 main() { | 37 main() { |
38 initConfig(); | |
39 withBarbackVersions("any", () { | 38 withBarbackVersions("any", () { |
40 integration("supports a user-defined declaring transformer", () { | 39 integration("supports a user-defined declaring transformer", () { |
41 d.dir(appPath, [ | 40 d.dir(appPath, [ |
42 d.pubspec({ | 41 d.pubspec({ |
43 "name": "myapp", | 42 "name": "myapp", |
44 "transformers": ["myapp/src/lazy", "myapp/src/declaring"] | 43 "transformers": ["myapp/src/lazy", "myapp/src/declaring"] |
45 }), | 44 }), |
46 d.dir("lib", [d.dir("src", [ | 45 d.dir("lib", [d.dir("src", [ |
47 // Include a lazy transformer before the declaring transformer, | 46 // Include a lazy transformer before the declaring transformer, |
48 // because otherwise its behavior is indistinguishable from a normal | 47 // because otherwise its behavior is indistinguishable from a normal |
(...skipping 15 matching lines...) Expand all Loading... |
64 requestShouldSucceed("foo.final", "foo.out.final"); | 63 requestShouldSucceed("foo.final", "foo.out.final"); |
65 server.stdout.expect(emitsLines( | 64 server.stdout.expect(emitsLines( |
66 '[Info from LazyRewrite]:\n' | 65 '[Info from LazyRewrite]:\n' |
67 'Rewriting myapp|web/foo.txt.\n' | 66 'Rewriting myapp|web/foo.txt.\n' |
68 '[Info from DeclaringRewrite]:\n' | 67 '[Info from DeclaringRewrite]:\n' |
69 'Rewriting myapp|web/foo.out.')); | 68 'Rewriting myapp|web/foo.out.')); |
70 endPubServe(); | 69 endPubServe(); |
71 }); | 70 }); |
72 }); | 71 }); |
73 } | 72 } |
OLD | NEW |