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 library pub.barback; | |
6 | |
7 import 'package:barback/barback.dart'; | 5 import 'package:barback/barback.dart'; |
8 import 'package:path/path.dart' as p; | 6 import 'package:path/path.dart' as p; |
9 import 'package:pub_semver/pub_semver.dart'; | 7 import 'package:pub_semver/pub_semver.dart'; |
10 | 8 |
11 /// 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 |
12 /// with. | 10 /// with. |
13 /// | 11 /// |
14 /// Pub implicitly constrains these packages to these versions as long as | 12 /// Pub implicitly constrains these packages to these versions as long as |
15 /// barback is a dependency. | 13 /// barback is a dependency. |
16 /// | 14 /// |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 if (parts.length <= index + 1) { | 78 if (parts.length <= index + 1) { |
81 throw new FormatException( | 79 throw new FormatException( |
82 'Invalid URL path "${url.path}". Expected package name ' | 80 'Invalid URL path "${url.path}". Expected package name ' |
83 'after "packages".'); | 81 'after "packages".'); |
84 } | 82 } |
85 | 83 |
86 var package = parts[index + 1]; | 84 var package = parts[index + 1]; |
87 var assetPath = p.url.join("lib", p.url.joinAll(parts.skip(index + 2))); | 85 var assetPath = p.url.join("lib", p.url.joinAll(parts.skip(index + 2))); |
88 return new AssetId(package, assetPath); | 86 return new AssetId(package, assetPath); |
89 } | 87 } |
OLD | NEW |