| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS 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 import 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 d.file("foo.dart", "final message = 'Hello!';") | 196 d.file("foo.dart", "final message = 'Hello!';") |
| 197 ]) | 197 ]) |
| 198 ]); | 198 ]); |
| 199 | 199 |
| 200 builder.serve("bar", "5.6.7"); | 200 builder.serve("bar", "5.6.7"); |
| 201 }); | 201 }); |
| 202 | 202 |
| 203 d.appDir({"foo": "1.2.3"}).create(); | 203 d.appDir({"foo": "1.2.3"}).create(); |
| 204 pubGet(output: contains("Precompiled foo.")); | 204 pubGet(output: contains("Precompiled foo.")); |
| 205 | 205 |
| 206 servePackages((builder) => builder.serve("bar", "6.0.0")); | 206 globalPackageServer.add((builder) => builder.serve("bar", "6.0.0")); |
| 207 pubUpgrade(output: contains("Precompiled foo.")); | 207 pubUpgrade(output: contains("Precompiled foo.")); |
| 208 }); | 208 }); |
| 209 | 209 |
| 210 integration("doesn't recache when an unrelated dependency is updated", () { | 210 integration("doesn't recache when an unrelated dependency is updated", () { |
| 211 servePackages((builder) { | 211 servePackages((builder) { |
| 212 builder.serveRealPackage('barback'); | 212 builder.serveRealPackage('barback'); |
| 213 | 213 |
| 214 builder.serve("foo", "1.2.3", | 214 builder.serve("foo", "1.2.3", |
| 215 deps: {'barback': 'any'}, | 215 deps: {'barback': 'any'}, |
| 216 pubspec: {'transformers': ['foo']}, | 216 pubspec: {'transformers': ['foo']}, |
| 217 contents: [ | 217 contents: [ |
| 218 d.dir("lib", [ | 218 d.dir("lib", [ |
| 219 d.file("transformer.dart", replaceTransformer("Hello", "Goodbye")), | 219 d.file("transformer.dart", replaceTransformer("Hello", "Goodbye")), |
| 220 d.file("foo.dart", "final message = 'Hello!';") | 220 d.file("foo.dart", "final message = 'Hello!';") |
| 221 ]) | 221 ]) |
| 222 ]); | 222 ]); |
| 223 | 223 |
| 224 builder.serve("bar", "5.6.7"); | 224 builder.serve("bar", "5.6.7"); |
| 225 }); | 225 }); |
| 226 | 226 |
| 227 d.appDir({"foo": "1.2.3"}).create(); | 227 d.appDir({"foo": "1.2.3"}).create(); |
| 228 pubGet(output: contains("Precompiled foo.")); | 228 pubGet(output: contains("Precompiled foo.")); |
| 229 | 229 |
| 230 servePackages((builder) => builder.serve("bar", "6.0.0")); | 230 globalPackageServer.add((builder) => builder.serve("bar", "6.0.0")); |
| 231 pubUpgrade(output: isNot(contains("Precompiled foo."))); | 231 pubUpgrade(output: isNot(contains("Precompiled foo."))); |
| 232 }); | 232 }); |
| 233 | 233 |
| 234 integration("caches the dependency in debug mode", () { | 234 integration("caches the dependency in debug mode", () { |
| 235 servePackages((builder) { | 235 servePackages((builder) { |
| 236 builder.serveRealPackage('barback'); | 236 builder.serveRealPackage('barback'); |
| 237 | 237 |
| 238 builder.serve("foo", "1.2.3", | 238 builder.serve("foo", "1.2.3", |
| 239 deps: {'barback': 'any'}, | 239 deps: {'barback': 'any'}, |
| 240 pubspec: {'transformers': ['foo']}, | 240 pubspec: {'transformers': ['foo']}, |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 Future apply(Transform transform) { | 433 Future apply(Transform transform) { |
| 434 return transform.primaryInput.readAsString().then((contents) { | 434 return transform.primaryInput.readAsString().then((contents) { |
| 435 transform.addOutput(new Asset.fromString( | 435 transform.addOutput(new Asset.fromString( |
| 436 transform.primaryInput.id, | 436 transform.primaryInput.id, |
| 437 contents.replaceAll("$input", "$output"))); | 437 contents.replaceAll("$input", "$output"))); |
| 438 }); | 438 }); |
| 439 } | 439 } |
| 440 } | 440 } |
| 441 """; | 441 """; |
| 442 } | 442 } |
| OLD | NEW |