| 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.final'))); | 39 p.url.join(transform.key, 'out.final'))); |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 """; | 42 """; |
| 43 | 43 |
| 44 main() { | 44 main() { |
| 45 withBarbackVersions(">=0.14.1", () { | 45 integration("loads a declaring aggregate transformer", () { |
| 46 integration("loads a declaring 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/lazy", "myapp/aggregate"] |
| 50 "transformers": ["myapp/lazy", "myapp/aggregate"] | 50 }), |
| 51 }), | 51 d.dir("lib", [ |
| 52 d.dir("lib", [ | 52 d.file("lazy.dart", LAZY_TRANSFORMER), |
| 53 d.file("lazy.dart", LAZY_TRANSFORMER), | 53 d.file("aggregate.dart", AGGREGATE_TRANSFORMER), |
| 54 d.file("aggregate.dart", AGGREGATE_TRANSFORMER), | 54 ]), |
| 55 ]), | 55 d.dir("web", [ |
| 56 d.dir("web", [ | 56 d.file("foo.txt", "foo"), |
| 57 d.file("foo.txt", "foo"), | 57 d.file("bar.txt", "bar") |
| 58 d.file("bar.txt", "bar") | 58 ]) |
| 59 ]) | 59 ]).create(); |
| 60 ]).create(); | |
| 61 | 60 |
| 62 createLockFile('myapp', pkg: ['barback']); | 61 createLockFile('myapp', pkg: ['barback']); |
| 63 | 62 |
| 64 var server = pubServe(); | 63 var server = pubServe(); |
| 65 // The transformer should preserve laziness. | 64 // The transformer should preserve laziness. |
| 66 server.stdout.expect("Build completed successfully"); | 65 server.stdout.expect("Build completed successfully"); |
| 67 | 66 |
| 68 requestShouldSucceed("out.final", "bar.out\nfoo.out"); | 67 requestShouldSucceed("out.final", "bar.out\nfoo.out"); |
| 69 endPubServe(); | 68 endPubServe(); |
| 70 }); | |
| 71 }); | 69 }); |
| 72 } | 70 } |
| OLD | NEW |