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 library serve_packages; | 5 library serve_packages; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 | 9 |
10 import 'package:path/path.dart' as p; | 10 import 'package:path/path.dart' as p; |
| 11 import 'package:pub/src/io.dart'; |
| 12 import 'package:pub/src/utils.dart'; |
11 import 'package:pub_semver/pub_semver.dart'; | 13 import 'package:pub_semver/pub_semver.dart'; |
12 import 'package:scheduled_test/scheduled_test.dart'; | 14 import 'package:scheduled_test/scheduled_test.dart'; |
13 import 'package:yaml/yaml.dart'; | 15 import 'package:yaml/yaml.dart'; |
14 | 16 |
15 import '../lib/src/io.dart'; | |
16 import '../lib/src/utils.dart'; | |
17 import 'descriptor.dart' as d; | 17 import 'descriptor.dart' as d; |
18 import 'test_pub.dart'; | 18 import 'test_pub.dart'; |
19 | 19 |
20 /// The [d.DirectoryDescriptor] describing the server layout of `/api/packages` | 20 /// The [d.DirectoryDescriptor] describing the server layout of `/api/packages` |
21 /// on the test server. | 21 /// on the test server. |
22 /// | 22 /// |
23 /// This contains metadata for packages that are being served via | 23 /// This contains metadata for packages that are being served via |
24 /// [servePackages]. It's `null` if [servePackages] has not yet been called for | 24 /// [servePackages]. It's `null` if [servePackages] has not yet been called for |
25 /// this test. | 25 /// this test. |
26 d.DirectoryDescriptor _servedApiPackageDir; | 26 d.DirectoryDescriptor _servedApiPackageDir; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 186 |
187 /// A package that's intended to be served. | 187 /// A package that's intended to be served. |
188 class _ServedPackage { | 188 class _ServedPackage { |
189 final Map pubspec; | 189 final Map pubspec; |
190 final List<d.Descriptor> contents; | 190 final List<d.Descriptor> contents; |
191 | 191 |
192 Version get version => new Version.parse(pubspec['version']); | 192 Version get version => new Version.parse(pubspec['version']); |
193 | 193 |
194 _ServedPackage(this.pubspec, this.contents); | 194 _ServedPackage(this.pubspec, this.contents); |
195 } | 195 } |
OLD | NEW |