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 import 'package:barback/barback.dart'; | 5 import 'package:barback/barback.dart'; |
6 import 'package:path/path.dart' as p; | 6 import 'package:path/path.dart' as p; |
7 import 'package:pub_semver/pub_semver.dart'; | 7 import 'package:pub_semver/pub_semver.dart'; |
8 | 8 |
9 /// The currently supported versions of packages that this version of pub works | 9 /// The currently supported versions of packages that this version of pub works |
10 /// with. | 10 /// with. |
(...skipping 19 matching lines...) Expand all Loading... |
30 /// | 30 /// |
31 /// Whenever a new minor or patch version of barback is published, this *must* | 31 /// Whenever a new minor or patch version of barback is published, this *must* |
32 /// be incremented to synchronize with that. See the barback [compatibility | 32 /// be incremented to synchronize with that. See the barback [compatibility |
33 /// documentation][compat] for details on the relationship between this | 33 /// documentation][compat] for details on the relationship between this |
34 /// constraint and barback's version. | 34 /// constraint and barback's version. |
35 /// | 35 /// |
36 /// [compat]: https://gist.github.com/nex3/10942218 | 36 /// [compat]: https://gist.github.com/nex3/10942218 |
37 final pubConstraints = { | 37 final pubConstraints = { |
38 "barback": new VersionConstraint.parse(">=0.15.0 <0.15.3"), | 38 "barback": new VersionConstraint.parse(">=0.15.0 <0.15.3"), |
39 "source_span": new VersionConstraint.parse(">=1.0.0 <2.0.0"), | 39 "source_span": new VersionConstraint.parse(">=1.0.0 <2.0.0"), |
40 "stack_trace": new VersionConstraint.parse(">=0.9.1 <2.0.0") | 40 "stack_trace": new VersionConstraint.parse(">=0.9.1 <2.0.0"), |
| 41 "async": new VersionConstraint.parse(">=1.8.0 <2.0.0") |
41 }; | 42 }; |
42 | 43 |
43 /// Converts [id] to a "package:" URI. | 44 /// Converts [id] to a "package:" URI. |
44 /// | 45 /// |
45 /// This will throw an [ArgumentError] if [id] doesn't represent a library in | 46 /// This will throw an [ArgumentError] if [id] doesn't represent a library in |
46 /// `lib/`. | 47 /// `lib/`. |
47 Uri idToPackageUri(AssetId id) { | 48 Uri idToPackageUri(AssetId id) { |
48 if (!id.path.startsWith('lib/')) { | 49 if (!id.path.startsWith('lib/')) { |
49 throw new ArgumentError("Asset id $id doesn't identify a library."); | 50 throw new ArgumentError("Asset id $id doesn't identify a library."); |
50 } | 51 } |
(...skipping 27 matching lines...) Expand all Loading... |
78 if (parts.length <= index + 1) { | 79 if (parts.length <= index + 1) { |
79 throw new FormatException( | 80 throw new FormatException( |
80 'Invalid URL path "${url.path}". Expected package name ' | 81 'Invalid URL path "${url.path}". Expected package name ' |
81 'after "packages".'); | 82 'after "packages".'); |
82 } | 83 } |
83 | 84 |
84 var package = parts[index + 1]; | 85 var package = parts[index + 1]; |
85 var assetPath = p.url.join("lib", p.url.joinAll(parts.skip(index + 2))); | 86 var assetPath = p.url.join("lib", p.url.joinAll(parts.skip(index + 2))); |
86 return new AssetId(package, assetPath); | 87 return new AssetId(package, assetPath); |
87 } | 88 } |
OLD | NEW |