OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// Pub-specific scheduled_test descriptors. | 5 /// Pub-specific scheduled_test descriptors. |
6 import 'package:oauth2/oauth2.dart' as oauth2; | 6 import 'package:oauth2/oauth2.dart' as oauth2; |
7 import 'package:pub/src/io.dart'; | 7 import 'package:pub/src/io.dart'; |
8 import 'package:pub/src/utils.dart'; | 8 import 'package:pub/src/utils.dart'; |
9 import 'package:scheduled_test/descriptor.dart'; | 9 import 'package:scheduled_test/descriptor.dart'; |
10 import 'package:scheduled_test/scheduled_server.dart'; | 10 import 'package:scheduled_test/scheduled_server.dart'; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 /// [contents] may contain [Future]s that resolve to serializable objects, | 49 /// [contents] may contain [Future]s that resolve to serializable objects, |
50 /// which may in turn contain [Future]s recursively. | 50 /// which may in turn contain [Future]s recursively. |
51 Descriptor pubspec(Map contents) { | 51 Descriptor pubspec(Map contents) { |
52 return async(awaitObject(contents).then((resolvedContents) => | 52 return async(awaitObject(contents).then((resolvedContents) => |
53 file("pubspec.yaml", yaml(resolvedContents)))); | 53 file("pubspec.yaml", yaml(resolvedContents)))); |
54 } | 54 } |
55 | 55 |
56 /// Describes a file named `pubspec.yaml` for an application package with the | 56 /// Describes a file named `pubspec.yaml` for an application package with the |
57 /// given [dependencies]. | 57 /// given [dependencies]. |
58 Descriptor appPubspec([Map dependencies]) { | 58 Descriptor appPubspec([Map dependencies]) { |
59 var map = {"name": "myapp"}; | 59 var map = <String, dynamic>{"name": "myapp"}; |
60 if (dependencies != null) map["dependencies"] = dependencies; | 60 if (dependencies != null) map["dependencies"] = dependencies; |
61 return pubspec(map); | 61 return pubspec(map); |
62 } | 62 } |
63 | 63 |
64 /// Describes a file named `pubspec.yaml` for a library package with the given | 64 /// Describes a file named `pubspec.yaml` for a library package with the given |
65 /// [name], [version], and [deps]. If "sdk" is given, then it adds an SDK | 65 /// [name], [version], and [deps]. If "sdk" is given, then it adds an SDK |
66 /// constraint on that version. | 66 /// constraint on that version. |
67 Descriptor libPubspec(String name, String version, {Map deps, String sdk}) { | 67 Descriptor libPubspec(String name, String version, {Map deps, String sdk}) { |
68 var map = packageMap(name, version, deps); | 68 var map = packageMap(name, version, deps); |
69 if (sdk != null) map["environment"] = {"sdk": sdk}; | 69 if (sdk != null) map["environment"] = {"sdk": sdk}; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 /// | 194 /// |
195 /// [dependencies] maps package names to strings describing where the packages | 195 /// [dependencies] maps package names to strings describing where the packages |
196 /// are located on disk. If the strings are semantic versions, then the packages | 196 /// are located on disk. If the strings are semantic versions, then the packages |
197 /// are located in the system cache; otherwise, the strings are interpreted as | 197 /// are located in the system cache; otherwise, the strings are interpreted as |
198 /// relative `file:` URLs. | 198 /// relative `file:` URLs. |
199 /// | 199 /// |
200 /// Validation checks that the `.packages` file exists, has the expected | 200 /// Validation checks that the `.packages` file exists, has the expected |
201 /// entries (one per key in [dependencies]), each with a path that contains | 201 /// entries (one per key in [dependencies]), each with a path that contains |
202 /// either the version string (for a reference to the pub cache) or a | 202 /// either the version string (for a reference to the pub cache) or a |
203 /// path to a path dependency, relative to the application directory. | 203 /// path to a path dependency, relative to the application directory. |
204 Descriptor packagesFile([Map dependencies]) => | 204 Descriptor packagesFile([Map<String, String> dependencies]) => |
205 new PackagesFileDescriptor(dependencies); | 205 new PackagesFileDescriptor(dependencies); |
OLD | NEW |