| 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 '../serve/utils.dart'; | 9 import '../serve/utils.dart'; |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 void declareOutputs(DeclaringAggregateTransform transform) { | 37 void declareOutputs(DeclaringAggregateTransform transform) { |
| 38 transform.declareOutput(new AssetId(transform.package, | 38 transform.declareOutput(new AssetId(transform.package, |
| 39 p.url.join(transform.key, 'out.txt'))); | 39 p.url.join(transform.key, 'out.txt'))); |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 """; | 42 """; |
| 43 | 43 |
| 44 main() { | 44 main() { |
| 45 withBarbackVersions(">=0.14.1", () { | 45 integration("loads a lazy aggregate transformer", () { |
| 46 integration("loads a lazy aggregate transformer", () { | 46 d.dir(appPath, [ |
| 47 d.dir(appPath, [ | 47 d.pubspec({ |
| 48 d.pubspec({ | 48 "name": "myapp", |
| 49 "name": "myapp", | 49 "transformers": ["myapp"] |
| 50 "transformers": ["myapp"] | 50 }), |
| 51 }), | 51 d.dir("lib", [ |
| 52 d.dir("lib", [ | 52 d.file("transformer.dart", AGGREGATE_TRANSFORMER), |
| 53 d.file("transformer.dart", AGGREGATE_TRANSFORMER), | 53 ]), |
| 54 ]), | 54 d.dir("web", [ |
| 55 d.dir("web", [ | 55 d.file("foo.txt", "foo"), |
| 56 d.file("foo.txt", "foo"), | 56 d.file("bar.txt", "bar") |
| 57 d.file("bar.txt", "bar") | 57 ]) |
| 58 ]) | 58 ]).create(); |
| 59 ]).create(); | |
| 60 | 59 |
| 61 createLockFile('myapp', pkg: ['barback']); | 60 createLockFile('myapp', pkg: ['barback']); |
| 62 | 61 |
| 63 var server = pubServe(); | 62 var server = pubServe(); |
| 64 // The transformer should preserve laziness. | 63 // The transformer should preserve laziness. |
| 65 server.stdout.expect("Build completed successfully"); | 64 server.stdout.expect("Build completed successfully"); |
| 66 | 65 |
| 67 requestShouldSucceed("out.txt", "bar\nfoo"); | 66 requestShouldSucceed("out.txt", "bar\nfoo"); |
| 68 endPubServe(); | 67 endPubServe(); |
| 69 }); | |
| 70 }); | 68 }); |
| 71 } | 69 } |
| OLD | NEW |