| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2013, 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 d.file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:io'; | 5 import 'dart:io'; |
| 6 | 6 |
| 7 import '../../../../../pkg/pathos/lib/path.dart' as path; | 7 import '../../../../../pkg/pathos/lib/path.dart' as path; |
| 8 | 8 |
| 9 import '../../descriptor.dart' as d; | |
| 10 import '../../test_pub.dart'; | 9 import '../../test_pub.dart'; |
| 11 | 10 |
| 12 main() { | 11 main() { |
| 13 // new File().fullPathSync() does not resolve through NTFS junction points, | 12 // new File().fullPathSync() does not resolve through NTFS junction points, |
| 14 // so this feature does not work on Windows. | 13 // so this feature does not work on Windows. |
| 15 if (Platform.operatingSystem == "windows") return; | 14 if (Platform.operatingSystem == "windows") return; |
| 16 | 15 |
| 17 initConfig(); | 16 initConfig(); |
| 18 integration("shared dependency with symlink", () { | 17 integration("shared dependency with symlink", () { |
| 19 d.dir("shared", [ | 18 dir("shared", [ |
| 20 d.libDir("shared"), | 19 libDir("shared"), |
| 21 d.libPubspec("shared", "0.0.1") | 20 libPubspec("shared", "0.0.1") |
| 22 ]).create(); | 21 ]).scheduleCreate(); |
| 23 | 22 |
| 24 d.dir("foo", [ | 23 dir("foo", [ |
| 25 d.libDir("foo"), | 24 libDir("foo"), |
| 26 d.libPubspec("foo", "0.0.1", deps: [ | 25 libPubspec("foo", "0.0.1", deps: [ |
| 27 {"path": "../shared"} | 26 {"path": "../shared"} |
| 28 ]) | 27 ]) |
| 29 ]).create(); | 28 ]).scheduleCreate(); |
| 30 | 29 |
| 31 d.dir("bar", [ | 30 dir("bar", [ |
| 32 d.libDir("bar"), | 31 libDir("bar"), |
| 33 d.libPubspec("bar", "0.0.1", deps: [ | 32 libPubspec("bar", "0.0.1", deps: [ |
| 34 {"path": "../link/shared"} | 33 {"path": "../link/shared"} |
| 35 ]) | 34 ]) |
| 36 ]).create(); | 35 ]).scheduleCreate(); |
| 37 | 36 |
| 38 d.dir(appPath, [ | 37 dir(appPath, [ |
| 39 d.pubspec({ | 38 pubspec({ |
| 40 "name": "myapp", | 39 "name": "myapp", |
| 41 "dependencies": { | 40 "dependencies": { |
| 42 "foo": {"path": "../foo"}, | 41 "foo": {"path": "../foo"}, |
| 43 "bar": {"path": "../bar"} | 42 "bar": {"path": "../bar"} |
| 44 } | 43 } |
| 45 }) | 44 }) |
| 46 ]).create(); | 45 ]).scheduleCreate(); |
| 47 | 46 |
| 48 d.dir("link").create(); | 47 dir("link").scheduleCreate(); |
| 49 scheduleSymlink("shared", path.join("link", "shared")); | 48 scheduleSymlink("shared", path.join("link", "shared")); |
| 50 | 49 |
| 51 schedulePub(args: ["install"], | 50 schedulePub(args: ["install"], |
| 52 output: new RegExp(r"Dependencies installed!$")); | 51 output: new RegExp(r"Dependencies installed!$")); |
| 53 | 52 |
| 54 d.dir(packagesPath, [ | 53 dir(packagesPath, [ |
| 55 d.dir("foo", [d.file("foo.dart", 'main() => "foo";')]), | 54 dir("foo", [file("foo.dart", 'main() => "foo";')]), |
| 56 d.dir("bar", [d.file("bar.dart", 'main() => "bar";')]), | 55 dir("bar", [file("bar.dart", 'main() => "bar";')]), |
| 57 d.dir("shared", [d.file("shared.dart", 'main() => "shared";')]) | 56 dir("shared", [file("shared.dart", 'main() => "shared";')]) |
| 58 ]).validate(); | 57 ]).scheduleValidate(); |
| 59 }); | 58 }); |
| 60 } | 59 } |
| OLD | NEW |