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'; | 11 import 'package:pub/src/io.dart'; |
12 import 'package:pub/src/pubspec.dart'; | |
13 import 'package:pub/src/source_registry.dart'; | |
14 import 'package:pub/src/utils.dart'; | 12 import 'package:pub/src/utils.dart'; |
15 import 'package:pub_semver/pub_semver.dart'; | 13 import 'package:pub_semver/pub_semver.dart'; |
16 import 'package:scheduled_test/scheduled_test.dart'; | 14 import 'package:scheduled_test/scheduled_test.dart'; |
17 import 'package:yaml/yaml.dart'; | 15 import 'package:yaml/yaml.dart'; |
18 | 16 |
19 import 'descriptor.dart' as d; | 17 import 'descriptor.dart' as d; |
20 import 'test_pub.dart'; | 18 import 'test_pub.dart'; |
21 | 19 |
22 /// The [d.DirectoryDescriptor] describing the server layout of `/api/packages` | 20 /// The [d.DirectoryDescriptor] describing the server layout of `/api/packages` |
23 /// on the test server. | 21 /// on the test server. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 194 |
197 /// A package that's intended to be served. | 195 /// A package that's intended to be served. |
198 class _ServedPackage { | 196 class _ServedPackage { |
199 final Map pubspec; | 197 final Map pubspec; |
200 final List<d.Descriptor> contents; | 198 final List<d.Descriptor> contents; |
201 | 199 |
202 Version get version => new Version.parse(pubspec['version']); | 200 Version get version => new Version.parse(pubspec['version']); |
203 | 201 |
204 _ServedPackage(this.pubspec, this.contents); | 202 _ServedPackage(this.pubspec, this.contents); |
205 } | 203 } |
OLD | NEW |